diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/gfx_command_intf.pas | 27 | ||||
-rw-r--r-- | src/corelib/x11/fpgfx_package.lpk | 6 | ||||
-rw-r--r-- | src/corelib/x11/fpgfx_package.pas | 3 | ||||
-rw-r--r-- | src/gui/gui_basegrid.pas | 2 | ||||
-rw-r--r-- | src/gui/gui_button.pas | 18 | ||||
-rw-r--r-- | src/gui/gui_listview.pas | 4 |
6 files changed, 53 insertions, 7 deletions
diff --git a/src/corelib/gfx_command_intf.pas b/src/corelib/gfx_command_intf.pas new file mode 100644 index 00000000..1313b45e --- /dev/null +++ b/src/corelib/gfx_command_intf.pas @@ -0,0 +1,27 @@ +unit gfx_command_intf; + +{$mode objfpc}{$H+} +{$INTERFACES CORBA} + +interface + + +type + ICommand = interface(IInterface) + ['{28D72102-D883-41A1-9585-D86B24D9C628}'] + procedure Execute; + end; + + + ICommandHolder = interface(IInterface) + ['{695BA6E1-1120-42D4-A2C3-54F98D5CDA46}'] + function GetCommand: ICommand; + procedure SetCommand(ACommand: ICommand); + end; + + +implementation + + +end. + diff --git a/src/corelib/x11/fpgfx_package.lpk b/src/corelib/x11/fpgfx_package.lpk index c5aaf68a..538d4545 100644 --- a/src/corelib/x11/fpgfx_package.lpk +++ b/src/corelib/x11/fpgfx_package.lpk @@ -24,7 +24,7 @@ <License Value="Modified LGPL "/> <Version Minor="5" Release="1"/> - <Files Count="16"> + <Files Count="17"> <Item1> <Filename Value="x11_xft.pas"/> <UnitName Value="x11_xft"/> @@ -89,6 +89,10 @@ <Filename Value="../gfx_strings.pas"/> <UnitName Value="gfx_strings"/> </Item16> + <Item17> + <Filename Value="../gfx_command_intf.pas"/> + <UnitName Value="gfx_command_intf"/> + </Item17> </Files> <RequiredPkgs Count="1"> <Item1> diff --git a/src/corelib/x11/fpgfx_package.pas b/src/corelib/x11/fpgfx_package.pas index 58a3fcac..d3ec9058 100644 --- a/src/corelib/x11/fpgfx_package.pas +++ b/src/corelib/x11/fpgfx_package.pas @@ -9,7 +9,8 @@ interface uses x11_xft, x11_keyconv, gfxbase, gfx_x11, fpgfx, gfx_stdimages, gfx_imgfmt_bmp, gfx_widget, gfx_UTF8utils, gfx_extinterpolation, gfx_cmdlineparams, - gfx_clipboard, gfx_utils, gfx_popupwindow, gfx_impl, gfx_strings; + gfx_clipboard, gfx_utils, gfx_popupwindow, gfx_impl, gfx_strings, + gfx_command_intf; implementation diff --git a/src/gui/gui_basegrid.pas b/src/gui/gui_basegrid.pas index b375fd74..19d0a032 100644 --- a/src/gui/gui_basegrid.pas +++ b/src/gui/gui_basegrid.pas @@ -22,7 +22,7 @@ unit gui_basegrid; { TODO: * Selecting the last fully visible row, scrolls the grid. Selection - is corruct, but because of the scroll it is confusing. + is correct, but because of the scroll it is confusing. } {.$Define DEBUG} diff --git a/src/gui/gui_button.pas b/src/gui/gui_button.pas index 52f608ed..ee7e835d 100644 --- a/src/gui/gui_button.pas +++ b/src/gui/gui_button.pas @@ -26,12 +26,14 @@ uses SysUtils, gfxbase, fpgfx, - gfx_widget; + gfx_widget, + gfx_command_intf; type - TfpgButton = class(TfpgWidget) + TfpgButton = class(TfpgWidget, ICommandHolder) private + FCommand: ICommand; FImageName: string; FClicked: Boolean; FShowImage: Boolean; @@ -75,6 +77,8 @@ type procedure DoPush; procedure DoRelease; procedure Click; + function GetCommand: ICommand; // ICommandHolder interface + procedure SetCommand(ACommand: ICommand); // ICommandHolder interface property Down: Boolean read FDown write SetDown; property Font: TfpgFont read FFont; property AllowDown: Boolean read GetAllowDown write SetAllowDown; @@ -441,6 +445,16 @@ begin OnClick(self); end; +function TfpgButton.GetCommand: ICommand; +begin + Result := FCommand; +end; + +procedure TfpgButton.SetCommand(ACommand: ICommand); +begin + FCommand := ACommand; +end; + procedure TfpgButton.SetImageMargin(const Value: integer); begin FImageMargin := Value; diff --git a/src/gui/gui_listview.pas b/src/gui/gui_listview.pas index 183ac8bf..a3eaba43 100644 --- a/src/gui/gui_listview.pas +++ b/src/gui/gui_listview.pas @@ -183,7 +183,7 @@ type FSelected: TList; FOldSelected: TList; FUpdateCount: Integer; - FVScrollBar, + FVScrollBar: TfpgScrollBar; FHScrollBar: TfpgScrollBar; FColumns: TfpgLVColumns; FItems: TfpgLVItems; @@ -1199,7 +1199,7 @@ begin UpdateScrollBarPositions; - fpgStyle.DrawControlFrame(Canvas, 0,0,Width,Height); + fpgStyle.DrawControlFrame(Canvas, 0, 0, Width, Height); ClipRect.Top := 2; ClipRect.Left := 2; |