summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/html/gui.cnt37
-rw-r--r--prototypes/fpgui2/tests/edittest.lpi9
-rw-r--r--src/corelib/gfx_widget.pas14
-rw-r--r--src/gui/gui_form.pas13
-rw-r--r--src/gui/gui_label.pas4
-rw-r--r--src/gui/gui_tab.pas16
-rw-r--r--src/gui/gui_tree.pas6
7 files changed, 68 insertions, 31 deletions
diff --git a/docs/html/gui.cnt b/docs/html/gui.cnt
index 855e3418..89b697d6 100644
--- a/docs/html/gui.cnt
+++ b/docs/html/gui.cnt
@@ -248,6 +248,7 @@
Close gui_form/tfpgform.close.html
Sizeable gui_form/tfpgform.sizeable.html
ModalResult gui_form/tfpgform.modalresult.html
+ BackgroundColor gui_form/tfpgform.backgroundcolor.html
WindowPosition gui_form/tfpgform.windowposition.html
WindowTitle gui_form/tfpgform.windowtitle.html
OnActivate gui_form/tfpgform.onactivate.html
@@ -256,6 +257,7 @@
OnDeactivate gui_form/tfpgform.ondeactivate.html
OnDestroy gui_form/tfpgform.ondestroy.html
OnHide gui_form/tfpgform.onhide.html
+ OnPaint gui_form/tfpgform.onpaint.html
OnShow gui_form/tfpgform.onshow.html
WidgetParentForm gui_form/widgetparentform.html
gui_grid gui_grid/index.html
@@ -395,6 +397,7 @@
Font gui_listbox/tfpgbaselistbox.font.html
OnChange gui_listbox/tfpgbaselistbox.onchange.html
OnSelect gui_listbox/tfpgbaselistbox.onselect.html
+ OnScroll gui_listbox/tfpgbaselistbox.onscroll.html
TfpgTextListBox gui_listbox/tfpgtextlistbox.html
FItems gui_listbox/tfpgtextlistbox.fitems.html
FInternalItems gui_listbox/tfpgtextlistbox.finternalitems.html
@@ -1164,6 +1167,7 @@
1VFOnDestroy
1VFOnHide
1VFOnShow
+1MSetBackgroundColor
2VFPrevModalForm
2VFModalResult
2VFParentForm
@@ -1192,6 +1196,7 @@
3MClose
3PSizeable rw
3PModalResult rw
+4PBackgroundColor rw
4PWindowPosition rw
4PWindowTitle rw
4POnActivate rw
@@ -1200,6 +1205,7 @@
4POnDeactivate rw
4POnDestroy rw
4POnHide rw
+4POnPaint
4POnShow rw
#GUI.gui_grid.TFileEntry TObject
1VFAttributes
@@ -1330,6 +1336,7 @@
#GUI.gui_listbox.TfpgBaseListBox #CoreLib.gfx_widget.TfpgWidget
1VFHotTrack
1VFOnChange
+1VFOnScroll
1VFOnSelect
1VFPopupFrame
1MGetFontDesc
@@ -1373,6 +1380,7 @@
3PFont r
3POnChange rw
3POnSelect rw
+3POnScroll rw
#GUI.gui_listbox.TfpgTextListBox #GUI.gui_listbox.TfpgBaseListBox
2VFItems
2VFInternalItems
@@ -1551,19 +1559,19 @@
3MEndUpdate
3MMakeItemVisible
3MItemAdd
-3PColumns r
-3PItems rw
-3PSelectionFollowsFocus rw
-3PShowHeaders rw
-3PMultiSelect rw
-3PVScrollBar r
-3PHScrollBar r
-3PItemHeight r
-3PItemIndex rw
-3POnColumnClick rw
-3POnPaintColumn rw
-3POnPaintItem rw
-3POnSelectionChanged rw
+4PColumns r
+4PItems rw
+4PSelectionFollowsFocus rw
+4PShowHeaders rw
+4PMultiSelect rw
+4PVScrollBar r
+4PHScrollBar r
+4PItemHeight r
+4PItemIndex rw
+4POnColumnClick rw
+4POnPaintColumn rw
+4POnPaintItem rw
+4POnSelectionChanged rw
#GUI.gui_memo.TfpgMemo #CoreLib.gfx_widget.TfpgWidget
1VFLines
1VFMaxLength
@@ -1788,6 +1796,9 @@
4PGroupIndex rw
4POnChange rw
#GUI.gui_scrollbar.TfpgScrollBar #CoreLib.gfx_widget.TfpgWidget
+1VFLargeChange
+1VPrevAreaPressed
+1VNextAreaPressed
1MSetMax
1MSetMin
1MSetPosition
diff --git a/prototypes/fpgui2/tests/edittest.lpi b/prototypes/fpgui2/tests/edittest.lpi
index 9392cdcb..25f76da3 100644
--- a/prototypes/fpgui2/tests/edittest.lpi
+++ b/prototypes/fpgui2/tests/edittest.lpi
@@ -1,15 +1,15 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
- <PathDelim Value="\"/>
- <Version Value="5"/>
+ <PathDelim Value="/"/>
+ <Version Value="6"/>
<General>
<Flags>
<SaveOnlyProjectUnits Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
- <IconPath Value=".\"/>
+ <IconPath Value="./"/>
<TargetFileExt Value=""/>
</General>
<VersionInfo>
@@ -23,7 +23,7 @@
<RunParams>
<local>
<FormatVersion Value="1"/>
- <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
+ <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
@@ -47,7 +47,6 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
- <PathDelim Value="\"/>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas
index 728be6b3..f6eeba24 100644
--- a/src/corelib/gfx_widget.pas
+++ b/src/corelib/gfx_widget.pas
@@ -149,7 +149,7 @@ end;
procedure TfpgWidget.SetEnabled(const AValue: boolean);
begin
if FEnabled = AValue then
- Exit;
+ Exit; //==>
FEnabled := AValue;
RePaint;
end;
@@ -158,7 +158,8 @@ procedure TfpgWidget.SetActiveWidget(const AValue: TfpgWidget);
begin
if FActiveWidget = AValue then
Exit; //==>
- if FFormDesigner <> nil then Exit;
+ if FFormDesigner <> nil then
+ Exit; //==>
if FActiveWidget <> nil then
FActiveWidget.HandleKillFocus;
@@ -169,6 +170,7 @@ end;
procedure TfpgWidget.SetVisible(const AValue: boolean);
begin
+// Writeln(Classname, ' TfpgWidget.SetVisible AValue = ', AValue);
if FVisible = AValue then
Exit; //==>
FVisible := AValue;
@@ -220,8 +222,10 @@ begin
// This is for components that are create at runtime, after it's
// parent has already been shown.
if (Parent <> nil) and (Parent.HasHandle) then
+ begin
+// writeln('about to call InternalHandleShow');
InternalHandleShow;
-// HandleShow;
+ end;
Exclude(ComponentState, csLoading);
end;
@@ -466,6 +470,8 @@ var
c: TComponent;
begin
FOnScreen := True;
+ FVisible := True;
+// writeln(Classname, ' TfpgWidget.HandleShow - FVisible = ', FVisible);
if FVisible then
begin
AllocateWindowHandle;
@@ -766,9 +772,11 @@ end;
procedure TfpgWidget.MsgPaint(var msg: TfpgMessageRec);
begin
+ Canvas.BeginDraw;
HandlePaint;
if Assigned(FOnPaint) then
FOnPaint(Self);
+ Canvas.EndDraw;
end;
procedure TfpgWidget.MsgResize(var msg: TfpgMessageRec);
diff --git a/src/gui/gui_form.pas b/src/gui/gui_form.pas
index 448e1c8e..0efac32b 100644
--- a/src/gui/gui_form.pas
+++ b/src/gui/gui_form.pas
@@ -41,6 +41,7 @@ type
FOnDestroy: TNotifyEvent;
FOnHide: TNotifyEvent;
FOnShow: TNotifyEvent;
+ procedure SetBackgroundColor(const AValue: TfpgColor);
protected
FPrevModalForm: TfpgWindowBase;
FModalResult: integer;
@@ -73,6 +74,7 @@ type
property ModalResult: integer read FModalResult write FModalResult;
published
{$Note Refactor this to a TfpgCustomForm and only surface it here }
+ property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor;
property WindowPosition: TWindowPosition read FWindowPosition write FWindowPosition;
property WindowTitle: string read FWindowTitle write SetWindowTitle;
property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
@@ -81,6 +83,7 @@ type
property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
property OnHide: TNotifyEvent read FOnHide write FOnHide;
+ property OnPaint;
property OnShow: TNotifyEvent read FOnShow write FOnShow;
end;
@@ -162,6 +165,14 @@ begin
Canvas.EndDraw(0, 0, FWidth, FHeight);
end;
+procedure TfpgForm.SetBackgroundColor(const AValue: TfpgColor);
+begin
+ if FBackgroundColor = AValue then
+ Exit; //==>
+ FBackgroundColor := AValue;
+ RePaint;
+end;
+
procedure TfpgForm.AdjustWindowStyle;
begin
if fpgApplication.MainForm = nil then
@@ -212,7 +223,7 @@ end;
procedure TfpgForm.Show;
begin
- Visible := True;
+ FVisible := True;
HandleShow;
end;
diff --git a/src/gui/gui_label.pas b/src/gui/gui_label.pas
index 4f877792..85caadda 100644
--- a/src/gui/gui_label.pas
+++ b/src/gui/gui_label.pas
@@ -104,7 +104,7 @@ end;
procedure TfpgLabel.SetBackgroundColor(const AValue: TfpgColor);
begin
if FBackgroundColor = AValue then
- Exit;
+ Exit; //==>
FBackgroundColor := AValue;
RePaint;
end;
@@ -121,7 +121,7 @@ end;
procedure TfpgLabel.SetText(const AValue: string);
begin
if FText = AValue then
- Exit;
+ Exit; //==>
FText := AValue;
if FAutoSize then
ResizeLabel;
diff --git a/src/gui/gui_tab.pas b/src/gui/gui_tab.pas
index e85cebb8..5351ae46 100644
--- a/src/gui/gui_tab.pas
+++ b/src/gui/gui_tab.pas
@@ -89,7 +89,7 @@ type
FStyle: TfpgTabStyle;
FTabPosition: TfpgTabPosition;
function GetActivePageIndex: integer;
- function GetPage(AIndex: integer): TfpgTabSheet;
+ function GetPage(AIndex: integer): TfpgTabSheet;
function GetPageCount: Integer;
procedure InsertPage(const APage: TfpgTabSheet);
procedure RemovePage(const APage: TfpgTabSheet);
@@ -258,8 +258,13 @@ begin
FPages.Remove(APage);
{$Note This still needs to be fixed.}
if APage = FActivePage then
+ begin
// FActivePage := FindNextPage(APage, True);
- ActivePage := TfpgTabSheet(FPages.First);
+// if FPages.Count > 0 then
+ ActivePage := TfpgTabSheet(FPages.First);
+// else
+// ActivePage := nil;
+ end;
end;
procedure TfpgPageControl.SetActivePageIndex(const AValue: integer);
@@ -454,6 +459,8 @@ begin
Exit; //==>
h := TfpgTabSheet(FPages.First);
+ if h = nil then
+ Exit;
Canvas.BeginDraw;
Canvas.SetTextColor(clText1);
@@ -712,6 +719,9 @@ destructor TfpgPageControl.Destroy;
var
ts: TfpgTabSheet;
begin
+ FOnChange := nil;
+ FActivePage := TfpgTabSheet(FPages[0]);
+ ActiveWidget := nil;
while FPages.Count > 0 do
begin
ts := TfpgTabSheet(FPages.Last);
@@ -719,9 +729,7 @@ begin
ts.Free;
end;
FPages.Free;
-
FFirstTabButton := nil;
- FOnChange := nil;
inherited Destroy;
end;
diff --git a/src/gui/gui_tree.pas b/src/gui/gui_tree.pas
index ea00b59c..defe179d 100644
--- a/src/gui/gui_tree.pas
+++ b/src/gui/gui_tree.pas
@@ -24,10 +24,10 @@ unit gui_tree;
* Lots!!
* Columns need to be reworked. We don't want coluns per node levels. Instead
we want a main column covering the tree. Then extra columns for user
- text and data.gui_tree
+ text and data.
* Implement event handlers the user can hook into and do custom drawing.
- WARNING: This is still under heavy development! Do NOT use.
+ WARNING: This is still under heavy development! Do NOT use yet.
}
{.$Define Debug}
@@ -105,7 +105,7 @@ type
property Parent: TfpgTreeNode read FParent write SetParent;
property FirstSubNode: TfpgTreeNode read FFirstSubNode;
property LastSubNode: TfpgTreeNode read FLastSubNode;
- property ImageIndex : integer read FImageIndex write FImageIndex;
+ property ImageIndex: integer read FImageIndex write FImageIndex;
// color settings
property TextColor: TfpgColor read FTextColor write SetTextColor;
property SelColor: TfpgColor read FSelColor write SetSelColor;