Recent

Author Topic: [Solved]TShapes?  (Read 3156 times)

Cliff48

  • Jr. Member
  • **
  • Posts: 51
[Solved]TShapes?
« on: June 09, 2015, 01:02:37 am »
Is there a tutorial anywhere to show how to add/use Tshapes.

I have searched everywhere on the net and I cant even find how to add one to a form.  Just dropping a shape to the form in designer gives a compilation error.

Appreciate any help.
Cliff
« Last Edit: June 09, 2015, 01:40:45 am by Cliff48 »
Laz Ver 1.4.0  FPC 2.6.4 SVN 48774
Win 7 Ultimate SP1
Intel I7-2600 CPU @  3.40GHZ 8GB Ram 64bit OS

taazz

  • Hero Member
  • *****
  • Posts: 5365
Re: TShapes?
« Reply #1 on: June 09, 2015, 01:10:49 am »
I don't see the problem. I can add any number of shapes on form. Tried it with a new application in lazarus 1.4.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Cliff48

  • Jr. Member
  • **
  • Posts: 51
Re: TShapes?
« Reply #2 on: June 09, 2015, 01:19:00 am »
Code: [Select]
  TForm1 = class(TForm)
    Button1: TButton;
    Image1: TImage;
    sb1: TStatusBar;
    Shape1: TShape;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Image1Click(Sender: TObject);


tshape.pas(19,19) Fatal: Syntax error, "." expected but ";" found

Laz Ver 1.4.0  FPC 2.6.4 SVN 48774
Win 7 Ultimate SP1
Intel I7-2600 CPU @  3.40GHZ 8GB Ram 64bit OS

taazz

  • Hero Member
  • *****
  • Posts: 5365
Re: TShapes?
« Reply #3 on: June 09, 2015, 01:21:56 am »
TShape is declared on ExtCtrls.pas unit not Tshape.pas tshape.pas is not part of lcl as far as I know, try removing it from the uses clause and/or the project.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Cliff48

  • Jr. Member
  • **
  • Posts: 51
Re: TShapes?
« Reply #4 on: June 09, 2015, 01:25:08 am »
Code: [Select]
[code
]uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  ComCtrls, StdCtrls;   

the above generated by Lazarus with no change by me.
Laz Ver 1.4.0  FPC 2.6.4 SVN 48774
Win 7 Ultimate SP1
Intel I7-2600 CPU @  3.40GHZ 8GB Ram 64bit OS

taazz

  • Hero Member
  • *****
  • Posts: 5365
Re: TShapes?
« Reply #5 on: June 09, 2015, 01:26:30 am »
where is the unit tshape.pas declared then?
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Cliff48

  • Jr. Member
  • **
  • Posts: 51
Re: TShapes?
« Reply #6 on: June 09, 2015, 01:36:24 am »
where is the unit tshape.pas declared then?

Tshape was the name of my unit  (prolly a mistake in hindsight) but meant T{est}shape to me.

and just changing the name still gives problems ... i will start again  .. sheez!

Laz Ver 1.4.0  FPC 2.6.4 SVN 48774
Win 7 Ultimate SP1
Intel I7-2600 CPU @  3.40GHZ 8GB Ram 64bit OS

Cliff48

  • Jr. Member
  • **
  • Posts: 51
Re: TShapes?
« Reply #7 on: June 09, 2015, 01:40:05 am »
Thanks for your help.  That fixed it. 
Laz Ver 1.4.0  FPC 2.6.4 SVN 48774
Win 7 Ultimate SP1
Intel I7-2600 CPU @  3.40GHZ 8GB Ram 64bit OS

taazz

  • Hero Member
  • *****
  • Posts: 5365
Re: TShapes?
« Reply #8 on: June 09, 2015, 02:01:12 am »
where is the unit tshape.pas declared then?

Tshape was the name of my unit  (prolly a mistake in hindsight) but meant T{est}shape to me.

and just changing the name still gives problems ... i will start again  .. sheez!
there are multiple parts when renaming a unit the safe way to rename one is to save it as a new unit (save as..) and answer yes to the IDE's "delete old" question.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Cliff48

  • Jr. Member
  • **
  • Posts: 51
Re: [Solved]TShapes?
« Reply #9 on: June 09, 2015, 02:34:08 am »
Thanks taazz I'll remember that.  In this case it didnt matter too much... lol.. I hadn't got far :)
I was experimenting to see if a TShape.Rectangle was a good way to crop an image...  In the last half hour I have achieved far more than in the 2 hours before I posted here.... and it looks perfect for what I want.

Thanks again for getting me sorted out on such a stupid mistake  .. sometimes I cant see the wood for the trees  :)
Laz Ver 1.4.0  FPC 2.6.4 SVN 48774
Win 7 Ultimate SP1
Intel I7-2600 CPU @  3.40GHZ 8GB Ram 64bit OS

taazz

  • Hero Member
  • *****
  • Posts: 5365
Re: [Solved]TShapes?
« Reply #10 on: June 09, 2015, 02:39:34 am »
Thanks again for getting me sorted out on such a stupid mistake 
You are most welcome I'm glad I could help.
sometimes I cant see the wood for the trees  :)
Been there not liked it much but some how I end up there from time to time (actually at least twice a day).
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018