diff options
-rw-r--r-- | examples/apps/uidesigner/newformdesigner.pas | 3 | ||||
-rw-r--r-- | examples/apps/uidesigner/vfddesigner.pas | 6 | ||||
-rw-r--r-- | examples/apps/uidesigner/vfdfile.pas | 2 | ||||
-rw-r--r-- | examples/apps/uidesigner/vfdpropeditgrid.pas | 12 | ||||
-rw-r--r-- | examples/apps/uidesigner/vfdwidgetclass.pas | 8 | ||||
-rw-r--r-- | examples/gui/gridtest/gridtest.lpr | 8 | ||||
-rw-r--r-- | src/corelib/gfx_utf8utils.pas | 6 | ||||
-rw-r--r-- | src/corelib/gfx_widget.pas | 2 | ||||
-rw-r--r-- | src/corelib/gfxbase.pas | 2 | ||||
-rw-r--r-- | src/gui/gui_basegrid.pas | 141 | ||||
-rw-r--r-- | src/gui/gui_combobox.pas | 1 | ||||
-rw-r--r-- | src/gui/gui_customgrid.pas | 52 | ||||
-rw-r--r-- | src/gui/gui_dialogs.pas | 4 | ||||
-rw-r--r-- | src/gui/gui_edit.pas | 3 | ||||
-rw-r--r-- | src/gui/gui_editcombo.pas | 1 | ||||
-rw-r--r-- | src/gui/gui_gauge.pas | 8 | ||||
-rw-r--r-- | src/gui/gui_grid.pas | 74 | ||||
-rw-r--r-- | src/gui/gui_memo.pas | 4 |
18 files changed, 171 insertions, 166 deletions
diff --git a/examples/apps/uidesigner/newformdesigner.pas b/examples/apps/uidesigner/newformdesigner.pas index b39ba067..59f854ba 100644 --- a/examples/apps/uidesigner/newformdesigner.pas +++ b/examples/apps/uidesigner/newformdesigner.pas @@ -238,7 +238,8 @@ begin Text := 'http://opensoft.homeip.net/fpgui/'; URL := 'http://opensoft.homeip.net/fpgui/'; FontDesc := 'Arial-9:underline'; - HotTrackColor := clRoyalBlue; + TextColor := clRoyalBlue; + HotTrackColor := clBlue; HotTrackFont := 'Arial-9:underline'; end; diff --git a/examples/apps/uidesigner/vfddesigner.pas b/examples/apps/uidesigner/vfddesigner.pas index 8e107ddf..1ab14a5d 100644 --- a/examples/apps/uidesigner/vfddesigner.pas +++ b/examples/apps/uidesigner/vfddesigner.pas @@ -145,6 +145,10 @@ implementation uses vfdmain, TypInfo; +type + // used to get to SetDesigning() in Form Designer + TComponentFriendClass = class(TComponent); + { TWidgetDesigner } procedure TWidgetDesigner.SetSelected(const AValue: boolean); @@ -1641,7 +1645,7 @@ begin WindowPosition := wpUser; WindowTitle := 'New Form'; SetPosition(300, 150, 300, 250); - Include(ComponentState, csDesigning); +// TComponentFriendClass(self).SetDesigning(True); end; diff --git a/examples/apps/uidesigner/vfdfile.pas b/examples/apps/uidesigner/vfdfile.pas index f01fbf4f..9162d3b0 100644 --- a/examples/apps/uidesigner/vfdfile.pas +++ b/examples/apps/uidesigner/vfdfile.pas @@ -86,7 +86,7 @@ begin ' public' + LineEnding + ' {@VFD_HEAD_BEGIN: ' + formname + '}' + LineEnding + formheadblock + - ' {@VFD_HEAD_END: ' + formname + '}' + LineEnding + LineEnding + + ' {@VFD_HEAD_END: ' + formname + '}' + LineEnding + ' procedure AfterCreate; override;' + LineEnding + ' end;' + LineEnding + LineEnding; NewFormsDecl := NewFormsDecl + s; diff --git a/examples/apps/uidesigner/vfdpropeditgrid.pas b/examples/apps/uidesigner/vfdpropeditgrid.pas index 1ded9366..b14cb590 100644 --- a/examples/apps/uidesigner/vfdpropeditgrid.pas +++ b/examples/apps/uidesigner/vfdpropeditgrid.pas @@ -55,8 +55,8 @@ type TColumnsGrid = class(TfpgCustomGrid) protected - function GetRowCount: integer; override; - procedure DrawCell(ARow, ACol: integer; ARect: TfpgRect; AFlags: integer); override; + function GetRowCount: Longword; override; + procedure DrawCell(ARow, ACol: Longword; ARect: TfpgRect; AFlags: integer); override; public dbgrid: TfpgStringGrid; constructor Create(AOwner: TComponent); override; @@ -65,7 +65,7 @@ type TColumnEditForm = class(TfpgForm) private - procedure GridRowChange(Sender: TObject; row: integer); + procedure GridRowChange(Sender: TObject; row: Longword); procedure EditChange(Sender: TObject); procedure NewButtonClick(Sender: TObject); procedure DeleteButtonClick(Sender: TObject); @@ -283,7 +283,7 @@ begin {@VFD_BODY_END: ColumnEditForm} end; -procedure TColumnEditForm.GridRowChange(Sender: TObject; row: integer); +procedure TColumnEditForm.GridRowChange(Sender: TObject; row: Longword); var i: integer; c: TfpgStringColumn; @@ -376,7 +376,7 @@ end; { TColumnsGrid } -function TColumnsGrid.GetRowCount: integer; +function TColumnsGrid.GetRowCount: Longword; begin try Result := dbgrid.ColumnCount; @@ -385,7 +385,7 @@ begin end; end; -procedure TColumnsGrid.DrawCell(ARow, ACol: integer; ARect: TfpgRect; AFlags: integer); +procedure TColumnsGrid.DrawCell(ARow, ACol: Longword; ARect: TfpgRect; AFlags: integer); var s: string; x: integer; diff --git a/examples/apps/uidesigner/vfdwidgetclass.pas b/examples/apps/uidesigner/vfdwidgetclass.pas index b1c7eee0..e1b57f50 100644 --- a/examples/apps/uidesigner/vfdwidgetclass.pas +++ b/examples/apps/uidesigner/vfdwidgetclass.pas @@ -89,6 +89,12 @@ implementation uses TypInfo; + + +type + // used to get to SetDesigning() in Form Designer + TComponentFriendClass = class(TComponent); + { TVFDWidgetClass } @@ -112,7 +118,7 @@ end; function TVFDWidgetClass.CreateWidget(AOwner: TComponent): TfpgWidget; begin Result := WidgetClass.Create(AOwner); - Include(Result.ComponentState, csDesigning); + TComponentFriendClass(Result).SetDesigning(True); end; destructor TVFDWidgetClass.Destroy; diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr index 2b6c891e..79ad595d 100644 --- a/examples/gui/gridtest/gridtest.lpr +++ b/examples/gui/gridtest/gridtest.lpr @@ -38,7 +38,7 @@ type procedure chkShowHeaderChange(Sender: TObject); procedure chkShowGridChange(Sender: TObject); procedure btnQuitClick(Sender: TObject); - procedure stringgridDrawCell(Sender: TObject; const ARow, ACol: integer; + procedure stringgridDrawCell(Sender: TObject; const ARow, ACol: Longword; const ARect: TfpgRect; AFlags: integer; var ADefaultDrawing: boolean); protected procedure HandleShow; override; @@ -78,7 +78,7 @@ begin end; procedure TMainForm.stringgridDrawCell(Sender: TObject; const ARow, - ACol: integer; const ARect: TfpgRect; AFlags: integer; + ACol: Longword; const ARect: TfpgRect; AFlags: integer; var ADefaultDrawing: boolean); begin if (ACol = 1) and (ARow = 3) then @@ -152,12 +152,12 @@ begin // override default colors stringgrid.BackgroundColor:= clKhaki; - stringgrid.ColumnBackgroundColor[2] := clLightGrey; + stringgrid.ColumnBackgroundColor[2] := clLightGray; stringgrid.TextColor:= clBlue; stringgrid.ColumnTextColor[1] := clRed; // Add custom painting - stringgrid.OnDrawCell:=@stringgridDrawCell; + stringgrid.OnDrawCell := @stringgridDrawCell; pagecontrol.ActivePageIndex := 0; diff --git a/src/corelib/gfx_utf8utils.pas b/src/corelib/gfx_utf8utils.pas index 5d1661e4..6ce45891 100644 --- a/src/corelib/gfx_utf8utils.pas +++ b/src/corelib/gfx_utf8utils.pas @@ -9,7 +9,7 @@ unit gfx_UTF8utils; interface uses - Classes, SysUtils; + Classes, SysUtils, gfxbase; function UTF8CharacterLength(p: PChar): integer; @@ -21,7 +21,7 @@ function UTF8Length(p: PChar; ByteCount: integer): integer; function UTF8Pos(const SearchForText, SearchInText: string): integer; procedure UTF8Delete(var S: string; Index, Size: integer); procedure UTF8Insert(const Source: string; var S: string; Index: integer); -function UTF8CharAtByte(const s: string; BytePos: integer; var aChar: string): integer; +function UTF8CharAtByte(const s: string; BytePos: integer; var aChar: TfpgChar): integer; implementation @@ -219,7 +219,7 @@ begin end; function UTF8CharAtByte(const s: string; BytePos: integer; - var aChar: string): integer; + var aChar: TfpgChar): integer; var CharLen: Integer; begin diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas index 09faaaf0..74a9ff6d 100644 --- a/src/corelib/gfx_widget.pas +++ b/src/corelib/gfx_widget.pas @@ -258,7 +258,7 @@ begin if Parent <> nil then FWindowType := wtChild; - inherited; + inherited Create(AOwner); // This is for components that are create at runtime, after it's // parent has already been shown. diff --git a/src/corelib/gfxbase.pas b/src/corelib/gfxbase.pas index bc602db0..89080565 100644 --- a/src/corelib/gfxbase.pas +++ b/src/corelib/gfxbase.pas @@ -936,7 +936,7 @@ begin inherited AfterConstruction; { Here is a neater way by using RTTI to set default property values all automatically. No need to duplicate the efforts and manually set the - property default values in the constructor. This code is no the same for + property default values in the constructor. This code is now the same for each TfpgWindowBase descendant (which includes GUI widgets) } // SetDefaults(self); end; diff --git a/src/gui/gui_basegrid.pas b/src/gui/gui_basegrid.pas index 3ff8a6ea..39b9067a 100644 --- a/src/gui/gui_basegrid.pas +++ b/src/gui/gui_basegrid.pas @@ -33,10 +33,10 @@ uses type - TfpgFocusChangeNotify = procedure(Sender: TObject; ARow, ACol: integer) of object; - TfpgRowChangeNotify = procedure(Sender: TObject; ARow: integer) of object; - TfpgCanSelectCellEvent = procedure(Sender: TObject; const ARow, ACol: integer; var ACanSelect: boolean) of object; - TfpgDrawCellEvent = procedure(Sender: TObject; const ARow, ACol: integer; const ARect: TfpgRect; AFlags: integer; var ADefaultDrawing: boolean) of object; + TfpgFocusChangeNotify = procedure(Sender: TObject; ARow, ACol: Longword) of object; + TfpgRowChangeNotify = procedure(Sender: TObject; ARow: Longword) of object; + TfpgCanSelectCellEvent = procedure(Sender: TObject; const ARow, ACol: Longword; var ACanSelect: boolean) of object; + TfpgDrawCellEvent = procedure(Sender: TObject; const ARow, ACol: Longword; const ARect: TfpgRect; AFlags: integer; var ADefaultDrawing: boolean) of object; // Column 2 is special just for testing purposes. Descendant classes will // override that special behavior anyway. @@ -51,16 +51,16 @@ type FResizedCol: integer; // used for column resizing FDefaultColWidth: integer; FDefaultRowHeight: integer; - FFocusCol: integer; - FFocusRow: integer; + FFocusCol: Longword; + FFocusRow: Longword; FHeaderHeight: integer; FOnCanSelectCell: TfpgCanSelectCellEvent; FOnFocusChange: TfpgFocusChangeNotify; FOnRowChange: TfpgRowChangeNotify; - FPrevCol: integer; - FPrevRow: integer; - FFirstRow: integer; - FFirstCol: integer; + FPrevCol: Longword; + FPrevRow: Longword; + FFirstRow: Longword; + FFirstCol: Longword; FMargin: integer; FFont: TfpgFont; FHeaderFont: TfpgFont; @@ -82,32 +82,32 @@ type procedure VScrollBarMove(Sender: TObject; position: integer); procedure SetDefaultColWidth(const AValue: integer); procedure SetDefaultRowHeight(const AValue: integer); - procedure SetFocusCol(const AValue: integer); - procedure SetFocusRow(const AValue: integer); + procedure SetFocusCol(const AValue: Longword); + procedure SetFocusRow(const AValue: Longword); procedure CheckFocusChange; procedure SetShowGrid(const AValue: boolean); procedure SetShowHeader(const AValue: boolean); - function VisibleLines: integer; + function VisibleLines: Longword; function VisibleWidth: integer; function VisibleHeight: integer; - procedure SetFirstRow(const AValue: integer); + procedure SetFirstRow(const AValue: Longword); protected procedure UpdateScrollBars; virtual; - function GetHeaderText(ACol: integer): string; virtual; - function GetColumnWidth(ACol: integer): integer; virtual; - procedure SetColumnWidth(ACol: integer; const AValue: integer); virtual; - function GetColumnBackgroundColor(ACol: integer): TfpgColor; virtual; - procedure SetColumnBackgroundColor(ACol: integer; const AValue: TfpgColor); virtual; - function GetColumnTextColor(ACol: integer): TfpgColor; virtual; - procedure SetColumnTextColor(ACol: integer; const AValue: TfpgColor); virtual; - function GetColumnCount: integer; virtual; - function GetRowCount: integer; virtual; - function CanSelectCell(const ARow, ACol: integer): boolean; - function DoDrawCellEvent(ARow, ACol: integer; ARect: TfpgRect; AFlags: integer): boolean; virtual; + function GetHeaderText(ACol: Longword): string; virtual; + function GetColumnWidth(ACol: Longword): integer; virtual; + procedure SetColumnWidth(ACol: Longword; const AValue: integer); virtual; + function GetColumnBackgroundColor(ACol: Longword): TfpgColor; virtual; + procedure SetColumnBackgroundColor(ACol: Longword; const AValue: TfpgColor); virtual; + function GetColumnTextColor(ACol: Longword): TfpgColor; virtual; + procedure SetColumnTextColor(ACol: Longword; const AValue: TfpgColor); virtual; + function GetColumnCount: Longword; virtual; + function GetRowCount: Longword; virtual; + function CanSelectCell(const ARow, ACol: Longword): boolean; + function DoDrawCellEvent(ARow, ACol: Longword; ARect: TfpgRect; AFlags: integer): boolean; virtual; procedure DoCanSelectCell(const ARow, ACol: integer; var ACanSelect: boolean); - procedure DrawCell(ARow, ACol: integer; ARect: TfpgRect; AFlags: integer); virtual; - procedure DrawHeader(ACol: integer; ARect: TfpgRect; AFlags: integer); virtual; - procedure DrawGrid(ARow, ACol: integer; ARect: TfpgRect; AFlags: integer); virtual; + procedure DrawCell(ARow, ACol: Longword; ARect: TfpgRect; AFlags: integer); virtual; + procedure DrawHeader(ACol: Longword; ARect: TfpgRect; AFlags: integer); virtual; + procedure DrawGrid(ARow, ACol: Longword; ARect: TfpgRect; AFlags: integer); virtual; procedure HandlePaint; override; procedure HandleShow; override; procedure HandleResize(awidth, aheight: TfpgCoord); override; @@ -123,20 +123,20 @@ type property FontDesc: string read GetFontDesc write SetFontDesc; property HeaderFont: TfpgFont read FHeaderFont; property HeaderFontDesc: string read GetHeaderFontDesc write SetHeaderFontDesc; - property FocusCol: integer read FFocusCol write SetFocusCol; - property FocusRow: integer read FFocusRow write SetFocusRow; + property FocusCol: Longword read FFocusCol write SetFocusCol; + property FocusRow: Longword read FFocusRow write SetFocusRow; property RowSelect: boolean read FRowSelect write SetRowSelect; - property ColumnCount: integer read GetColumnCount; - property RowCount: integer read GetRowCount; + property ColumnCount: Longword read GetColumnCount; + property RowCount: Longword read GetRowCount; property ShowHeader: boolean read FShowHeader write SetShowHeader default True; property ShowGrid: boolean read FShowGrid write SetShowGrid default True; property ScrollBarStyle: TfpgScrollStyle read FScrollBarStyle write SetScrollBarStyle default ssAutoBoth; property HeaderHeight: integer read FHeaderHeight; // property ColResizing: boolean read FColResizing write FColResizing; - property ColumnWidth[ACol: integer]: integer read GetColumnWidth write SetColumnWidth; - property ColumnBackgroundColor[ACol: integer]: TfpgColor read GetColumnBackgroundColor write SetColumnBackgroundColor; - property ColumnTextColor[ACol: integer]: TfpgColor read GetColumnTextColor write SetColumnTextColor; - property TopRow: integer read FFirstRow write SetFirstRow; + property ColumnWidth[ACol: Longword]: integer read GetColumnWidth write SetColumnWidth; + property ColumnBackgroundColor[ACol: Longword]: TfpgColor read GetColumnBackgroundColor write SetColumnBackgroundColor; + property ColumnTextColor[ACol: Longword]: TfpgColor read GetColumnTextColor write SetColumnTextColor; + property TopRow: Longword read FFirstRow write SetFirstRow; property OnDrawCell: TfpgDrawCellEvent read FOnDrawCell write FOnDrawCell; property OnFocusChange: TfpgFocusChangeNotify read FOnFocusChange write FOnFocusChange; property OnRowChange: TfpgRowChangeNotify read FOnRowChange write FOnRowChange; @@ -155,7 +155,7 @@ implementation procedure TfpgBaseGrid.HScrollBarMove(Sender: TObject; position: integer); begin - if FFirstCol <> position then + if FFirstCol <> Longword(position) then begin if Position < 1 then Position := 1; @@ -209,7 +209,7 @@ end; procedure TfpgBaseGrid.VScrollBarMove(Sender: TObject; position: integer); begin - if FFirstRow <> position then + if FFirstRow <> LongWord(position) then begin FFirstRow := position; RePaint; @@ -232,17 +232,12 @@ begin RePaint; end; -function TfpgBaseGrid.GetColumnWidth(ACol: integer): integer; +function TfpgBaseGrid.GetColumnWidth(ACol: Longword): integer; begin - // GetColumnWidth and SetColumnWidth will be overriden in decendant! - // Column 2 is special just for testing purposes - if ACol = 2 then - Result := FTemp - else - Result := FDefaultColWidth+(ACol*16); + Result := 50; end; -procedure TfpgBaseGrid.SetColumnWidth(ACol: integer; const AValue: integer); +procedure TfpgBaseGrid.SetColumnWidth(ACol: Longword; const AValue: integer); begin // GetColumnWidth and SetColumnWidth will be overriden in decendant! // Column 2 is special just for testing purposes @@ -254,44 +249,44 @@ begin end; end; -function TfpgBaseGrid.GetColumnBackgroundColor(ACol: integer): TfpgColor; +function TfpgBaseGrid.GetColumnBackgroundColor(ACol: Longword): TfpgColor; begin // implemented in descendant end; -procedure TfpgBaseGrid.SetColumnBackgroundColor(ACol: integer; const AValue: TfpgColor); +procedure TfpgBaseGrid.SetColumnBackgroundColor(ACol: Longword; const AValue: TfpgColor); begin // implemented in descendant end; -function TfpgBaseGrid.GetColumnTextColor(ACol: integer): TfpgColor; +function TfpgBaseGrid.GetColumnTextColor(ACol: Longword): TfpgColor; begin // implemented in descendant end; -procedure TfpgBaseGrid.SetColumnTextColor(ACol: integer; const AValue: TfpgColor); +procedure TfpgBaseGrid.SetColumnTextColor(ACol: Longword; const AValue: TfpgColor); begin // implemented in descendant end; -function TfpgBaseGrid.GetColumnCount: integer; +function TfpgBaseGrid.GetColumnCount: Longword; begin Result := 7; end; -function TfpgBaseGrid.GetRowCount: integer; +function TfpgBaseGrid.GetRowCount: Longword; begin Result := 24; end; -function TfpgBaseGrid.CanSelectCell(const ARow, ACol: integer): boolean; +function TfpgBaseGrid.CanSelectCell(const ARow, ACol: Longword): boolean; begin Result := (ARow > 0) and (ACol > 0) and (ARow <= RowCount) and (ACol <= ColumnCount); if Result then DoCanSelectCell(ARow, ACol, Result); end; -function TfpgBaseGrid.DoDrawCellEvent(ARow, ACol: integer; ARect: TfpgRect; +function TfpgBaseGrid.DoDrawCellEvent(ARow, ACol: Longword; ARect: TfpgRect; AFlags: integer): boolean; begin Result := True; @@ -306,7 +301,7 @@ begin FOnCanSelectCell(self, ARow, ACol, ACanSelect); end; -procedure TfpgBaseGrid.DrawCell(ARow, ACol: integer; ARect: TfpgRect; AFlags: integer); +procedure TfpgBaseGrid.DrawCell(ARow, ACol: Longword; ARect: TfpgRect; AFlags: integer); var s: string; begin @@ -318,7 +313,7 @@ begin Canvas.DrawString(ARect.Left+1, ARect.Top+1, s); end; -procedure TfpgBaseGrid.DrawHeader(ACol: integer; ARect: TfpgRect; AFlags: integer); +procedure TfpgBaseGrid.DrawHeader(ACol: Longword; ARect: TfpgRect; AFlags: integer); var s: string; r: TfpgRect; @@ -350,7 +345,7 @@ begin fpgStyle.DrawString(Canvas, x, ARect.Top+1, s, Enabled); end; -procedure TfpgBaseGrid.DrawGrid(ARow, ACol: integer; ARect: TfpgRect; +procedure TfpgBaseGrid.DrawGrid(ARow, ACol: Longword; ARect: TfpgRect; AFlags: integer); begin // default is inside bottom/right edge or cell @@ -359,7 +354,7 @@ begin Canvas.DrawLine(ARect.Right, ARect.Bottom, ARect.Right, ARect.Top-1); // cell right end; -procedure TfpgBaseGrid.SetFocusCol(const AValue: integer); +procedure TfpgBaseGrid.SetFocusCol(const AValue: Longword); begin if FFocusCol = AValue then Exit; //==> @@ -375,7 +370,7 @@ begin CheckFocusChange; end; -procedure TfpgBaseGrid.SetFocusRow(const AValue: integer); +procedure TfpgBaseGrid.SetFocusRow(const AValue: Longword); begin if FFocusRow = AValue then Exit; //==> @@ -422,7 +417,7 @@ begin RePaint; end; -function TfpgBaseGrid.VisibleLines: integer; +function TfpgBaseGrid.VisibleLines: Longword; var hh: integer; begin @@ -432,7 +427,7 @@ begin hh := 0; if ShowHeader then hh := hh + FHeaderHeight+1; - Result := (Height - 2*FMargin - hh) div (FDefaultRowHeight+1) + Result := (Height - (2*FMargin) - hh) div (FDefaultRowHeight+1) end; function TfpgBaseGrid.VisibleWidth: integer; @@ -457,7 +452,7 @@ begin Result := Height - (FMargin*2) - sw; end; -procedure TfpgBaseGrid.SetFirstRow(const AValue: integer); +procedure TfpgBaseGrid.SetFirstRow(const AValue: Longword); begin if FFirstRow = AValue then Exit; @@ -536,7 +531,7 @@ begin FHScrollBar.UpdateWindowPosition; end; -function TfpgBaseGrid.GetHeaderText(ACol: integer): string; +function TfpgBaseGrid.GetHeaderText(ACol: Longword): string; begin Result := 'Head ' + IntToStr(ACol); end; @@ -545,8 +540,8 @@ procedure TfpgBaseGrid.HandlePaint; var r: TfpgRect; r2: TfpgRect; - col: integer; - row: integer; + col: Longword; + row: Longword; clipr: TfpgRect; // clip rectangle begin Canvas.BeginDraw; @@ -693,7 +688,7 @@ procedure TfpgBaseGrid.HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); var w: integer; - r: integer; + r: Longword; begin consumed := True; case keycode of @@ -830,8 +825,8 @@ end; procedure TfpgBaseGrid.HandleMouseScroll(x, y: integer; shiftstate: TShiftState; delta: smallint); var - lRow: integer; - lCol: integer; + lRow: Longword; + lCol: Longword; begin inherited HandleMouseScroll(x, y, shiftstate, delta); @@ -945,11 +940,11 @@ end; procedure TfpgBaseGrid.HandleLMouseDown(x, y: integer; shiftstate: TShiftState); var hh: integer; - n: integer; + n: Longword; cw: integer; nw: integer; - prow: integer; - pcol: integer; + prow: Longword; + pcol: Longword; begin inherited HandleLMouseDown(x, y, shiftstate); @@ -997,7 +992,7 @@ begin end else begin // Selecting a Cell via mouse - FFocusRow := FFirstRow + ((y - FMargin - hh) div FDefaultRowHeight); + FFocusRow := FFirstRow + Longword((y - FMargin - hh) div FDefaultRowHeight); if FFocusRow > RowCount then FFocusRow := RowCount; cw := 0; @@ -1033,7 +1028,7 @@ end; procedure TfpgBaseGrid.FollowFocus; var - n: integer; + n: Longword; w: TfpgCoord; begin if (RowCount > 0) and (FFocusRow < 1) then diff --git a/src/gui/gui_combobox.pas b/src/gui/gui_combobox.pas index c08b31a8..105f162e 100644 --- a/src/gui/gui_combobox.pas +++ b/src/gui/gui_combobox.pas @@ -52,7 +52,6 @@ uses SysUtils, gfx_widget, gfxbase, - gui_button, fpgfx, gfx_popupwindow; diff --git a/src/gui/gui_customgrid.pas b/src/gui/gui_customgrid.pas index 5cdf6fc0..3f0af996 100644 --- a/src/gui/gui_customgrid.pas +++ b/src/gui/gui_customgrid.pas @@ -60,26 +60,26 @@ type TfpgCustomGrid = class(TfpgBaseGrid) protected - FRowCount: integer; + FRowCount: Longword; FColumns: TList; procedure SetTextColor(const AValue: TfpgColor); override; function GetColumns(AIndex: integer): TfpgGridColumn; virtual; procedure DoDeleteColumn(ACol: integer); virtual; procedure DoSetRowCount(AValue: integer); virtual; function DoCreateColumnClass: TfpgGridColumn; virtual; - function GetColumnCount: integer; override; - procedure SetColumnCount(const AValue: integer); virtual; - function GetRowCount: integer; override; - procedure SetRowCount(const AValue: integer); virtual; - function GetColumnWidth(ACol: integer): integer; override; - procedure SetColumnWidth(ACol: integer; const AValue: integer); override; - function GetColumnBackgroundColor(ACol: integer): TfpgColor; override; - procedure SetColumnBackgroundColor(ACol: integer; const AValue: TfpgColor); override; - function GetColumnTextColor(ACol: integer): TfpgColor; override; - procedure SetColumnTextColor(ACol: integer; const AValue: TfpgColor); override; - function GetHeaderText(ACol: integer): string; override; - property RowCount: integer read GetRowCount write SetRowCount; - property ColumnCount: integer read GetColumnCount write SetColumnCount; + function GetColumnCount: Longword; override; + procedure SetColumnCount(const AValue: Longword); virtual; + function GetRowCount: Longword; override; + procedure SetRowCount(const AValue: LongWord); virtual; + function GetColumnWidth(ACol: Longword): integer; override; + procedure SetColumnWidth(ACol: Longword; const AValue: integer); override; + function GetColumnBackgroundColor(ACol: Longword): TfpgColor; override; + procedure SetColumnBackgroundColor(ACol: Longword; const AValue: TfpgColor); override; + function GetColumnTextColor(ACol: Longword): TfpgColor; override; + procedure SetColumnTextColor(ACol: Longword; const AValue: TfpgColor); override; + function GetHeaderText(ACol: Longword): string; override; + property RowCount: Longword read GetRowCount write SetRowCount; + property ColumnCount: Longword read GetColumnCount write SetColumnCount; { Columns AIndex is 1-based. } property Columns[AIndex: integer]: TfpgGridColumn read GetColumns; // property AlternateColor: TColor read FAlternateColor write SetAlternateColor stored IsAltColorStored; @@ -106,7 +106,7 @@ end; { TfpgCustomGrid } -function TfpgCustomGrid.GetRowCount: integer; +function TfpgCustomGrid.GetRowCount: Longword; begin Result := FRowCount; end; @@ -147,14 +147,14 @@ begin Result := TfpgGridColumn.Create; end; -function TfpgCustomGrid.GetColumnCount: integer; +function TfpgCustomGrid.GetColumnCount: Longword; begin Result := FColumns.Count; end; -procedure TfpgCustomGrid.SetColumnCount(const AValue: integer); +procedure TfpgCustomGrid.SetColumnCount(const AValue: Longword); var - n: integer; + n: Longword; begin n := FColumns.Count; if (n = AValue) or (AValue < 0) then @@ -181,7 +181,7 @@ begin RePaint; end; -procedure TfpgCustomGrid.SetRowCount(const AValue: integer); +procedure TfpgCustomGrid.SetRowCount(const AValue: Longword); begin if FRowCount = AValue then Exit; //==> @@ -195,7 +195,7 @@ begin RePaint; end; -function TfpgCustomGrid.GetColumnWidth(ACol: integer): integer; +function TfpgCustomGrid.GetColumnWidth(ACol: Longword): integer; begin if (ACol > 0) and (ACol <= ColumnCount) then Result := TfpgGridColumn(FColumns[ACol-1]).Width @@ -203,7 +203,7 @@ begin result := DefaultColWidth; end; -procedure TfpgCustomGrid.SetColumnWidth(ACol: integer; const AValue: integer); +procedure TfpgCustomGrid.SetColumnWidth(ACol: Longword; const AValue: integer); var lCol: TfpgGridColumn; begin @@ -220,7 +220,7 @@ begin end; end; -function TfpgCustomGrid.GetColumnBackgroundColor(ACol: integer): TfpgColor; +function TfpgCustomGrid.GetColumnBackgroundColor(ACol: Longword): TfpgColor; begin if (ACol > 0) and (ACol <= ColumnCount) then Result := TfpgGridColumn(FColumns[ACol-1]).FBackgroundColor @@ -228,7 +228,7 @@ begin result := BackgroundColor; end; -procedure TfpgCustomGrid.SetColumnBackgroundColor(ACol: integer; const AValue: TfpgColor); +procedure TfpgCustomGrid.SetColumnBackgroundColor(ACol: Longword; const AValue: TfpgColor); var lCol: TfpgGridColumn; begin @@ -242,7 +242,7 @@ begin end; end; -function TfpgCustomGrid.GetColumnTextColor(ACol: integer): TfpgColor; +function TfpgCustomGrid.GetColumnTextColor(ACol: Longword): TfpgColor; begin if (ACol > 0) and (ACol <= ColumnCount) then Result := TfpgGridColumn(FColumns[ACol-1]).FTextColor @@ -250,7 +250,7 @@ begin result := TextColor; end; -procedure TfpgCustomGrid.SetColumnTextColor(ACol: integer; const AValue: TfpgColor); +procedure TfpgCustomGrid.SetColumnTextColor(ACol: Longword; const AValue: TfpgColor); var lCol: TfpgGridColumn; begin @@ -264,7 +264,7 @@ begin end; end; -function TfpgCustomGrid.GetHeaderText(ACol: integer): string; +function TfpgCustomGrid.GetHeaderText(ACol: Longword): string; begin Result := TfpgGridColumn(FColumns[ACol-1]).Title; end; diff --git a/src/gui/gui_dialogs.pas b/src/gui/gui_dialogs.pas index e2a12448..e3b8d913 100644 --- a/src/gui/gui_dialogs.pas +++ b/src/gui/gui_dialogs.pas @@ -159,7 +159,7 @@ type procedure SetFilter(const Value: string); function GetShowHidden: boolean; procedure SetShowHidden(const Value: boolean); - procedure ListChanged(Sender: TObject; ARow: integer); + procedure ListChanged(Sender: TObject; ARow: Longword); procedure GridDblClicked(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); procedure InitializeComponents; procedure ProcessFilterString; @@ -879,7 +879,7 @@ end; { TfpgFileDialog } -procedure TfpgFileDialog.ListChanged(Sender: TObject; ARow: integer); +procedure TfpgFileDialog.ListChanged(Sender: TObject; ARow: Longword); var s: string; begin diff --git a/src/gui/gui_edit.pas b/src/gui/gui_edit.pas index 70b30ea7..0821872c 100644 --- a/src/gui/gui_edit.pas +++ b/src/gui/gui_edit.pas @@ -213,9 +213,10 @@ var dtext: string; tw, dpos: integer; // tc: Cardinal; - ch: string; + ch: TfpgChar; begin // searching the appropriate character position + ch := ''; dtext := GetDrawText; cpx := FFont.TextWidth(UTF8Copy(dtext, 1, FCursorPos)) - FDrawOffset + FSideMargin; Result := FCursorPos; diff --git a/src/gui/gui_editcombo.pas b/src/gui/gui_editcombo.pas index ccd2ec27..7d5df0bf 100644 --- a/src/gui/gui_editcombo.pas +++ b/src/gui/gui_editcombo.pas @@ -140,7 +140,6 @@ implementation uses gui_listbox, - gui_form, gfx_UTF8utils, math; diff --git a/src/gui/gui_gauge.pas b/src/gui/gui_gauge.pas index 156ba872..62569bce 100644 --- a/src/gui/gui_gauge.pas +++ b/src/gui/gui_gauge.pas @@ -54,10 +54,10 @@ type FFirstColor: TfpgColor; // Text and Needle color FSecondColor: TfpgColor; // Bar, Pie etc. main color { TODO: Currently unused. Implement Low Watermark and High Watermark } - FLWMColor: TfpgColor; // Low Watermark Color - FLWMValue: Longint; // Low Watermark Value - FHWMColor: TfpgColor; // High Watermark Color - FHWMValue: Longint; // High Watermark Color +// FLWMColor: TfpgColor; // Low Watermark Color +// FLWMValue: Longint; // Low Watermark Value +// FHWMColor: TfpgColor; // High Watermark Color +// FHWMValue: Longint; // High Watermark Color procedure BackgroundDraw; procedure TextDraw; procedure BarDraw; diff --git a/src/gui/gui_grid.pas b/src/gui/gui_grid.pas index 40b1c83a..5fed12e9 100644 --- a/src/gui/gui_grid.pas +++ b/src/gui/gui_grid.pas @@ -35,7 +35,6 @@ uses SysUtils, gfxbase, fpgfx, - gui_basegrid, gui_customgrid; type @@ -74,8 +73,8 @@ type FFileList: TfpgFileList; FFixedFont: TfpgFont; protected - function GetRowCount: integer; override; - procedure DrawCell(ARow, ACol: integer; ARect: TfpgRect; AFlags: integer); override; + function GetRowCount: Longword; override; + procedure DrawCell(ARow, ACol: Longword; ARect: TfpgRect; AFlags: integer); override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -111,33 +110,33 @@ type TfpgCustomStringGrid = class(TfpgCustomGrid) private - function GetCell(ACol, ARow: LongWord): string; - function GetColumnTitle(ACol: integer): string; - function GetObjects(ACol, ARow: LongWord): TObject; - procedure SetCell(ACol, ARow: LongWord; const AValue: string); - procedure SetColumnTitle(ACol: integer; const AValue: string); - procedure SetObjects(ACol, ARow: LongWord; const AValue: TObject); + function GetCell(ACol, ARow: Longword): string; + function GetColumnTitle(ACol: Longword): string; + function GetObjects(ACol, ARow: Longword): TObject; + procedure SetCell(ACol, ARow: Longword; const AValue: string); + procedure SetColumnTitle(ACol: Longword; const AValue: string); + procedure SetObjects(ACol, ARow: Longword; const AValue: TObject); protected - function GetColumnWidth(ACol: integer): integer; override; - procedure SetColumnWidth(ACol: integer; const AValue: integer); override; - function GetColumns(AIndex: integer): TfpgStringColumn; reintroduce; + function GetColumnWidth(ACol: Longword): integer; override; + procedure SetColumnWidth(ACol: Longword; const AValue: integer); override; + function GetColumns(AIndex: Longword): TfpgStringColumn; reintroduce; procedure DoDeleteColumn(ACol: integer); override; procedure DoSetRowCount(AValue: integer); override; function DoCreateColumnClass: TfpgStringColumn; reintroduce; override; - procedure DrawCell(ARow, ACol: integer; ARect: TfpgRect; AFlags: integer); override; + procedure DrawCell(ARow, ACol: Longword; ARect: TfpgRect; AFlags: integer); override; { AIndex is 1-based. } - property Columns[AIndex: integer]: TfpgStringColumn read GetColumns; + property Columns[AIndex: Longword]: TfpgStringColumn read GetColumns; public constructor Create(AOwner: TComponent); override; function AddColumn(ATitle: string; AWidth: integer; AAlignment: TAlignment = taLeftJustify; - AbackgroundColor: TfpgColor= clDefault; ATextColor: TfpgColor= clDefault): TfpgStringColumn; overload; + AbackgroundColor: TfpgColor = clDefault; ATextColor: TfpgColor = clDefault): TfpgStringColumn; overload; { ACol and ARow is 1-based. } - property Cells[ACol, ARow: LongWord]: string read GetCell write SetCell; - property Objects[ACol, ARow: LongWord]: TObject read GetObjects write SetObjects; - property ColumnTitle[ACol: integer]: string read GetColumnTitle write SetColumnTitle; - property ColumnWidth[ACol: integer]: integer read GetColumnWidth write SetColumnWidth; - property ColumnBackgroundColor[ACol: integer]: TfpgColor read GetColumnBackgroundColor write SetColumnBackgroundColor; - property ColumnTextColor[ACol: integer]: TfpgColor read GetColumnTextColor write SetColumnTextColor; + property Cells[ACol, ARow: Longword]: string read GetCell write SetCell; + property Objects[ACol, ARow: Longword]: TObject read GetObjects write SetObjects; + property ColumnTitle[ACol: Longword]: string read GetColumnTitle write SetColumnTitle; + property ColumnWidth[ACol: Longword]: integer read GetColumnWidth write SetColumnWidth; + property ColumnBackgroundColor[ACol: Longword]: TfpgColor read GetColumnBackgroundColor write SetColumnBackgroundColor; + property ColumnTextColor[ACol: Longword]: TfpgColor read GetColumnTextColor write SetColumnTextColor; // property Cols[index: Integer]: TStrings read GetCols write SetCols; // property Rows[index: Integer]: TStrings read GetRows write SetRows; end; @@ -178,15 +177,14 @@ function CreateStringGrid(AOwner: TComponent; x, y, w, h: TfpgCoord; AColumnCoun implementation uses - gfx_utils - ,gfx_constants + gfx_constants {$IFDEF MSWINDOWS} ,Windows // Graeme: temporary, just to see how the grid looks under Windows. {$ENDIF} {$IFDEF UNIX} // Graeme: temporary. libc is not available for FreeBSD. {$if defined(linux) and defined(cpu386)},libc{$endif} - ,baseunix +// ,baseunix {$ENDIF} ; @@ -240,12 +238,12 @@ end; { TfpgFileGrid } -function TfpgFileGrid.GetRowCount: integer; +function TfpgFileGrid.GetRowCount: Longword; begin Result := FFileList.Count; end; -procedure TfpgFileGrid.DrawCell(ARow, ACol: integer; ARect: TfpgRect; AFlags: integer); +procedure TfpgFileGrid.DrawCell(ARow, ACol: Longword; ARect: TfpgRect; AFlags: integer); const modestring: string[9] = 'xwrxwrxwr'; // must be in reverse order var @@ -406,7 +404,7 @@ end; { TfpgCustomStringGrid } -function TfpgCustomStringGrid.GetCell(ACol, ARow: LongWord): string; +function TfpgCustomStringGrid.GetCell(ACol, ARow: Longword): string; begin if ACol > ColumnCount then Exit; //==> @@ -415,14 +413,14 @@ begin Result := TfpgStringColumn(FColumns.Items[ACol-1]).Cells[ARow-1]; end; -function TfpgCustomStringGrid.GetColumnTitle(ACol: integer): string; +function TfpgCustomStringGrid.GetColumnTitle(ACol: Longword): string; begin if ACol > ColumnCount then Exit; //==> Result := TfpgStringColumn(FColumns.Items[ACol-1]).Title; end; -function TfpgCustomStringGrid.GetObjects(ACol, ARow: LongWord): TObject; +function TfpgCustomStringGrid.GetObjects(ACol, ARow: Longword): TObject; begin if ACol > ColumnCount then Exit; //==> @@ -431,14 +429,14 @@ begin Result := TfpgStringColumn(FColumns.Items[ACol-1]).Cells.Objects[ARow-1]; end; -function TfpgCustomStringGrid.GetColumnWidth(ACol: integer): integer; +function TfpgCustomStringGrid.GetColumnWidth(ACol: Longword): integer; begin if ACol > ColumnCount then Exit; //==> Result := TfpgStringColumn(FColumns.Items[ACol-1]).Width; end; -procedure TfpgCustomStringGrid.SetCell(ACol, ARow: LongWord; +procedure TfpgCustomStringGrid.SetCell(ACol, ARow: Longword; const AValue: string); begin if ACol > ColumnCount then @@ -453,7 +451,7 @@ begin end; end; -procedure TfpgCustomStringGrid.SetColumnTitle(ACol: integer; const AValue: string); +procedure TfpgCustomStringGrid.SetColumnTitle(ACol: Longword; const AValue: string); begin if ACol > ColumnCount then Exit; //==> @@ -462,7 +460,7 @@ begin EndUpdate; end; -procedure TfpgCustomStringGrid.SetObjects(ACol, ARow: LongWord; +procedure TfpgCustomStringGrid.SetObjects(ACol, ARow: Longword; const AValue: TObject); begin if ACol > ColumnCount then @@ -472,7 +470,7 @@ begin TfpgStringColumn(FColumns.Items[ACol-1]).Cells.Objects[ARow-1] := AValue; end; -procedure TfpgCustomStringGrid.SetColumnWidth(ACol: integer; const AValue: integer); +procedure TfpgCustomStringGrid.SetColumnWidth(ACol: Longword; const AValue: integer); begin if ACol > ColumnCount then Exit; //==> @@ -481,7 +479,7 @@ begin EndUpdate; end; -function TfpgCustomStringGrid.GetColumns(AIndex: integer): TfpgStringColumn; +function TfpgCustomStringGrid.GetColumns(AIndex: Longword): TfpgStringColumn; begin if (AIndex < 1) or (AIndex > ColumnCount) then Result := nil @@ -520,7 +518,7 @@ begin Result := TfpgStringColumn.Create; end; -procedure TfpgCustomStringGrid.DrawCell(ARow, ACol: integer; ARect: TfpgRect; +procedure TfpgCustomStringGrid.DrawCell(ARow, ACol: Longword; ARect: TfpgRect; AFlags: integer); var x: TfpgCoord; @@ -564,7 +562,7 @@ function TfpgCustomStringGrid.AddColumn(ATitle: string; AWidth: integer; var r: integer; begin - Include(ComponentState, csUpdating); + Updating; Result := TfpgStringColumn(inherited AddColumn(ATitle, AWidth)); Result.Alignment := AAlignment; @@ -580,7 +578,7 @@ begin for r := 1 to RowCount do Result.Cells.Append(''); - Exclude(ComponentState, csUpdating); + Updated; end; end. diff --git a/src/gui/gui_memo.pas b/src/gui/gui_memo.pas index 6b0a3559..14caa6c3 100644 --- a/src/gui/gui_memo.pas +++ b/src/gui/gui_memo.pas @@ -441,6 +441,7 @@ begin end; procedure TfpgMemo.DoPaste; +{ var s: string; si: string; @@ -449,6 +450,7 @@ var n: integer; l: integer; lcnt: integer; +} begin Exit; (* @@ -1362,8 +1364,8 @@ begin end; end else - Result := ''; } + Result := ''; end; function TfpgMemo.GetText: string; |