[Lazarus] Files have wrong owner, root... making build lazarus impossible.
Peter E Williams
foss.game.pascal.developer at iinet.net.au
Sun Aug 29 23:36:14 CEST 2010
Hi All,
I have a new component called Tarraybutton which is meant to display a
grid-like array of tbuttons (actually TGridButtons -- but you could
change it to tbutton for debugging). It compiles fine but when I use it
at design time and change the number of RowCount and ColCount these do
NOT affect the displayed number of rows and columns. This is supposed to
work like a TStringGrid, except with Buttons.
I think that I have forgotten to include the code which tells it how to
display the component. Can someone please help me to debug this
component???
Best Regards,
PEW
Hobart, Tasmania, Australia
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
DelphiProgramming at yahoogroups.com.
This code is freeware and is placed into the Public Domain by Peter E.
Williams
( foss.game.pascal.developer at iinet.net.au ).
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.
interface
uses
{Windows,}{ Messages,} SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
{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 TArrayButton.SetRowCount(r: integer);
begin
if r>-1 then
FRowCount:= r;
end;
{------------------------------------------------------------}
procedure TArrayButton.SetColCount(c: integer);
begin
if c>-1 then
FColCount:= c;
end;
{------------------------------------------------------------}
--
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: arraybutton.pas
Type: text/x-pascal
Size: 9410 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20100829/e8e6a745/attachment-0002.pas>
More information about the Lazarus
mailing list