Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-06

New component arraybutton Fatal: Can't find unit Graphics used by arraybutton AND Multiple lazarus installations

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Peter E Williams

Hi All,

Well, it's been over a week since I looked at this and I thought that it was working okay. Now I get Fatal: Can't find unit Graphics used by arraybutton. It is derived from

TArrayButton = class(TGradButton) { class(TButton) }

@name GradButton
@author Eugen Bolz
@lastchange 21.07.2008

I would like advice on whether it is best to use TGradButton or TButton and how to get rid of these Fatal errors due to not finding the units.

The file is saved here:

/home/pewink/Public/My_code/lazarus/0.9.28.2/pewink/Hexxpawn/ArrayButton/

but for reasons which defy me, whenever I try to open or save any file I am directed to this folder:

/home/pewink/Public/My_code/lazarus/0.9.28.2/pewink/test1/

I have Multiple lazarus installations on
both /home/pewink/Public/My_code/lazarus/0.9.28.2/lazarus/ (system default executable) and my own custom lazarus
on /home/pewink/.lazarus/bin/lazarus/

and I think that this is causing all the problems. How do I get back to a single installation of lazarus and not need to worry about the wrong permissions for files??? Both lazarus installations are the SAME version, so I only need one not two!!!

unit arraybutton;
//{$MODE Delphi}
{$mode objfpc}{$H+}

{ ------------------------------------------------------------ Author: Unknown +
------ modifications by Peter E. Williams +
suggestions from alt.comp.lang.borland-delphi newsgroup + suggestions from Mark Meyer in
code is freeware and is placed into the Public Domain by Peter E. Williams
( ).

Version 0.1a - for Lazarus by PEW
Date: 17 June 2010

    Added :--------
    FRowCount, FColCount: integer;
    procedure SetRowCount(r: integer);
    procedure SetColCount(c: integer);
  Version: 0.04a - by PEW. 'col' changed to 'column'. Setcol changed to
     setcolumn.
  Previous versions:
  -----------------
  Versions: 0.03a to 0.03f - trial versions to declare component based
    on tcustomcontrol instead of on tbutton. Unsuccessful.
  Version: 0.02b - mods by Mark Meyer + PEW.
  Version: 0.02 - Dated: 15 February 2001
  Version: 0.01 - Dated: 14 April 2000

Modified to form new unit based on AColorBtn & arraybtn, based entirely on Acolorbtn with Row & Column properties of arraybtn added.

Note: The only difference between this component and AColorBtn is
* essentially that this component has additional 'row' & 'Column' published
properties.

Thanks and Acknowledgements:
---------------------------
Thanks to the unknown person who originally sent me version 0.01 of this code,
and to Bruce Roberts () who posted up v0.02
modifications
to the ng. Thanks also to all those in the
alt.comp.lang.borland-delphi newsgroup
for their discussion of it and support.

Last modified by: Peter E. Williams

Known bugs:
----------

(#1 is now fixed!!!)
#1 - Captions containing #13 characters are displayed as as single line of text.

#2 - There is no visual difference between Enabled true or false. The
Enabled property works otherwise as normal. Workaround is to use
the Font.Style settings to show when a button is Enabled, e.g. for Enabled = true set to [fsbold], false set to [fsitalic] (this
is NOT done automatically).

#3 - Color property is assigned an invalid value of clCream. Reported by "Mark Meyer" <geeky2 at g...>
(via )

Available from:
??????????????
http://www.angelfire.com/biz6/pwillcomputing/peter_delphi_page.html as filename:
arraycolorbtn_src.zip

------------------------------------------------------------ }

interface

uses
{Windows,}{ Messages,} SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

../Hexxpawn/ArrayButton/arraybutton.pas(1,1) Fatal: Can't find unit Graphics used by arraybutton
this error is actually on line 78, column 45 !!!

{StdCtrls,}
LcLType, lresources,

  ugradbtn;
type
  TOnArrowKeyEvent = procedure( Sender: TObject;
    Key: Word;
    Row: integer;
    Column: integer;
    RowCount : integer; // new
    ColCount : integer; // new
    var handled: boolean) of object;
  TArrayButton = class(TGradButton) { class(TButton) }
  private
    IsFocused: Boolean;
    FCanvas: TCanvas;
    FRow,FColumn, FRowCount, FColCount: integer;
    FUseDefaultKeyHandler : boolean;
    FOnArrowKey : TOnArrowKeyEvent;
    procedure SetRow(r: integer);
    procedure SetColumn(c: integer);
    procedure SetRowCount(r: integer);
    procedure SetColCount(c: integer);
{
    procedure CNDrawItem(var Msg: MDrawItemStruct); message CN_DRAWITEM;
    //procedure CNDrawItem(var Msg: TWMDrawItem); message CN_DRAWITEM;
    procedure CMFontChanged(var Msg: TMessage); message CM_FONTCHANGED;
    procedure CMEnabledChanged(var Msg: TMessage); message
CM_ENABLEDCHANGED;
    procedure WMLButtonDblClk(var Message: TWMLButtonDblClk);
      message WM_LBUTTONDBLCLK;
      }
  protected
//    procedure CreateParams(var Params: TCreateParams); override;
//    procedure CreateWnd; override;
//    procedure SetButtonStyle(ADefault: Boolean); override;
    procedure DoArrowKey(key : word);
  public
//      procedure SetBounds (ALeft, ATop, AWidth, AHeight: Integer);
override;
    constructor Create (AOwner: TComponent); override;
    destructor Destroy; override;
    procedure KeyPress(var Key: Char); override;
		procedure KeyUp(var Key: Word; Shift: TShiftState); override;
    procedure KeyDown(var Key: Word; Shift: TShiftState); override;
  published
    property UseDefaultKeyHandler: boolean read FUseDefaultKeyHandler
write FUseDefaultKeyHandler;
    property OnArrowKey : TOnArrowKeyEvent read FOnArrowKey write
FOnArrowKey;
    property Row: integer read FRow write SetRow default 1;
    property Column: integer read FColumn write SetColumn default 1;
    property RowCount: integer read FRowCount write SetRowCount default
1;
    property ColCount: integer read FColCount write SetColCount default
1;
    property Color;
    property Width default 75;
    property Height default 25;
    property ParentShowHint;
    property ShowHint;
    property TabOrder;
    property TabStop;
    property Visible;
    property OnEnter;
    property OnExit;
  end;
procedure Register;
//--------------------
Unit ugradbtn.pas

{
@name GradButton
@author Eugen Bolz
@lastchange 21.07.2008
@version 1.4
@thx to http://www.delphipraxis.net/topic67805_farbverlauf +berechnen.html
@license http://creativecommons.org/licenses/LGPL/2.1/ @wiki http://wiki.lazarus.freepascal.org/TGradButton }

unit ugradbtn;
{$mode objfpc}{$H+}
interface

uses
Classes, SysUtils, Controls, graphics, LCLType, LResources,

  LCLIntf , Buttons, urotatebitmap, types;
Proudly developing Quality Cross Platform Open Source Games Since 1970 with a Commodore PET 4016 with 16 KRAM http://pews-freeware-games.org (<--- brand new) -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot-Multiple lazarus found.png Type: image/png Size: 19517 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100629/0cfef889/attachment-0001.png>

Reply by email

waldo kitty
to Peter E Williams
Peter E Williams wrote
uses Classes, SysUtils, Controls, graphics, LCLType, LResources, LCLIntf , Buttons, urotatebitmap, types;

ummm... you're on linux... there's a huge difference between "Graphics" and "graphics"... the one you likely want is "Graphics" ;)

Reply by email

Mattias Gaertner
to waldo kitty
Show quoted text 7 lines
On 6/28/2010 16:44, Peter E Williams wrote: > uses > Classes, SysUtils, Controls, graphics, LCLType, LResources, > LCLIntf , Buttons, urotatebitmap, types; ummm... you're on linux... there's a huge difference between "Graphics" and "graphics"... the one you likely want is "Graphics" ;)

No.
The filename of unit graphics is written lowercase, so case in source does not matter.

Mattias

Reply by email

Mattias Gaertner
to Peter E Williams: Well, it's been over a week since I looked at this and I thought that it was working…
Show quoted text 5 lines
Hi All, Well, it's been over a week since I looked at this and I thought that it was working okay. Now I get Fatal: Can't find unit Graphics used by arraybutton.

Compile with -vut to see where the compiler searches and what it finds. Probably you have some duplicate ppu files or you have not added LCL as dependency to your project or you have added too many search paths to your other unit files in the compiler options.

Show quoted text 19 lines
It is derived from TArrayButton = class(TGradButton) { class(TButton) } @name GradButton @author Eugen Bolz @lastchange 21.07.2008 I would like advice on whether it is best to use TGradButton or TButton and how to get rid of these Fatal errors due to not finding the units. The file is saved here: /home/pewink/Public/My_code/lazarus/0.9.28.2/pewink/Hexxpawn/ArrayButton/ but for reasons which defy me, whenever I try to open or save any file I am directed to this folder: /home/pewink/Public/My_code/lazarus/0.9.28.2/pewink/test1/

Do you use symlinks?

Show quoted text 6 lines
I have Multiple lazarus installations on both /home/pewink/Public/My_code/lazarus/0.9.28.2/lazarus/ (system default executable) and my own custom lazarus on /home/pewink/.lazarus/bin/lazarus/ and I think that this is causing all the problems.

Unlikely. Then you must have done some more things wrong.

How do I get back to a single installation of lazarus and not need to worry about the wrong permissions for files???

What wrong permission?

Show quoted text 16 lines
Both lazarus installations are the SAME version, so I only need one not two!!! unit arraybutton; //{$MODE Delphi} {$mode objfpc}{$H+} [...] uses {Windows,}{ Messages,} SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ../Hexxpawn/ArrayButton/arraybutton.pas(1,1) Fatal: Can't find unit Graphics used by arraybutton this error is actually on line 78, column 45 !!!

When the compiler reports no valid line/column the error is not in the sources, but in one of the ppu files.

[...]

Mattias

Reply by email

waldo kitty
to Mattias Gaertner: On Mon, 28 Jun 2010 17:02:16 -0400 No. The filename of unit graphics is written…
Mattias Gaertner wrote 14 lines
On Mon, 28 Jun 2010 17:02:16 -0400 waldo kitty wrote: > On 6/28/2010 16:44, Peter E Williams wrote: >> uses >> Classes, SysUtils, Controls, graphics, LCLType, LResources, >> LCLIntf , Buttons, urotatebitmap, types; > > ummm... you're on linux... there's a huge difference between "Graphics" and > "graphics"... the one you likely want is "Graphics" ;) No. The filename of unit graphics is written lowercase, so case in source does not matter.

gee... and i thought i was on to something there... it was the only thing that i saw that was different in that case... i'm still learnin' though ;)

thanks for the correction :)

Reply by email

Marc Weustink
to waldo kitty
waldo kitty wrote 22 lines
On 6/29/2010 02:27, Mattias Gaertner wrote: > On Mon, 28 Jun 2010 17:02:16 -0400 > waldo kitty wrote: > >> On 6/28/2010 16:44, Peter E Williams wrote: >>> uses >>> Classes, SysUtils, Controls, graphics, LCLType, LResources, >>> LCLIntf , Buttons, urotatebitmap, types; >> >> ummm... you're on linux... there's a huge difference between >> "Graphics" and >> "graphics"... the one you likely want is "Graphics" ;) > > No. > The filename of unit graphics is written lowercase, so case in > source does not matter. gee... and i thought i was on to something there... it was the only thing that i saw that was different in that case... i'm still learnin' though ;) thanks for the correction :)

It only matters when the file on disk has upper and lower case mixed. Then the uses name has to have the exact case.

IE. uses FooBar
searches for FooBar, foobar and FOOBAR, but not FooBAR

In case sensitive filesystems this is a different file

Marc

Reply by email