summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Laurence Emerson <dle3ab@angelbase.com>2013-05-27 23:04:56 -0700
committerDavid Laurence Emerson <dle3ab@angelbase.com>2013-05-27 23:04:56 -0700
commitec68e3ec7ea545a2165644a3ec08ca9e36be2402 (patch)
tree131fe96875f9c26e6b444b6add4ad712ec6f4a18 /src/gui
parent486f4f48ff250ce64ab532a302b6bbd6c05c4050 (diff)
parentc45010b6370b50f8e6192ddb7dc3d7762c8c29f7 (diff)
downloadfpGUI-ec68e3ec7ea545a2165644a3ec08ca9e36be2402.tar.xz
Merge branch 'master' into scroll-frame
Conflicts: src/corelib/x11/fpgui_toolkit.lpk
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/fpg_button.pas12
-rw-r--r--src/gui/fpg_menu.pas6
-rw-r--r--src/gui/fpg_tree.pas111
3 files changed, 72 insertions, 57 deletions
diff --git a/src/gui/fpg_button.pas b/src/gui/fpg_button.pas
index 28db95d6..3bc026de 100644
--- a/src/gui/fpg_button.pas
+++ b/src/gui/fpg_button.pas
@@ -550,6 +550,12 @@ begin
Include(lBtnFlags, btfHover)
else if FFlat then
Include(lBtnFlags, btfFlat);
+
+ if (not FFlat) and (not FDown) and fpgStyle.HasButtonHoverEffect then
+ begin
+ if FState = 1 then
+ Include(lBtnFlags, btfHover);
+ end;
end
else
begin
@@ -558,7 +564,7 @@ begin
Include(lBtnFlags, btfHover);
end;
- if not FFlat and FDefault then
+ if (not FFlat) and FDefault then
Include(lBtnFlags, btfIsDefault);
if FBackgroundColor <> clButtonFace then
@@ -747,7 +753,7 @@ begin
FDown := False;
Repaint;
end
- else if FFlat then
+ else if FFlat or fpgStyle.HasButtonHoverEffect then
begin
if Enabled then
Repaint;
@@ -766,7 +772,7 @@ begin
FDown := True;
Repaint;
end
- else if FFlat then
+ else if FFlat or fpgStyle.HasButtonHoverEffect then
begin
if Enabled then
Repaint;
diff --git a/src/gui/fpg_menu.pas b/src/gui/fpg_menu.pas
index 8da9302f..91db5992 100644
--- a/src/gui/fpg_menu.pas
+++ b/src/gui/fpg_menu.pas
@@ -135,6 +135,7 @@ type
destructor Destroy; override;
procedure Close; override;
function AddMenuItem(const AMenuName: TfpgString; const hotkeydef: string; OnClickProc: TNotifyEvent): TfpgMenuItem;
+ procedure AddSeparator;
function MenuItemByName(const AMenuName: TfpgString): TfpgMenuItem;
function MenuItem(const AMenuPos: integer): TfpgMenuItem; // added to allow for localization
property BeforeShow: TNotifyEvent read FBeforeShow write FBeforeShow;
@@ -1406,6 +1407,11 @@ begin
end;
end;
+procedure TfpgPopupMenu.AddSeparator;
+begin
+ AddMenuitem('-', '', nil);
+end;
+
function TfpgPopupMenu.MenuItemByName(const AMenuName: TfpgString): TfpgMenuItem;
var
i: integer;
diff --git a/src/gui/fpg_tree.pas b/src/gui/fpg_tree.pas
index 4a4316ac..8935ec36 100644
--- a/src/gui/fpg_tree.pas
+++ b/src/gui/fpg_tree.pas
@@ -1868,74 +1868,77 @@ var
OldSelection: TfpgTreeNode;
begin
OldSelection := Selection;
- case KeyCode of
- keyRight:
- begin
- Consumed := True;
- Selection.Expand;
- DoExpand(Selection);
- ResetScrollbar;
- RePaint;
- end;
+ if ShiftState = [] then
+ begin
+ case KeyCode of
+ keyRight:
+ begin
+ Consumed := True;
+ Selection.Expand;
+ DoExpand(Selection);
+ ResetScrollbar;
+ RePaint;
+ end;
- keyLeft:
- begin
- Consumed := True;
- Selection.Collapsed := true;
- ResetScrollbar;
- RePaint;
- end;
+ keyLeft:
+ begin
+ Consumed := True;
+ Selection.Collapsed := true;
+ ResetScrollbar;
+ RePaint;
+ end;
- keyUp:
- begin
- if Selection = nil then
- Selection := RootNode.FirstSubNode
- else
- if Selection <> RootNode then
+ keyUp:
+ begin
+ if Selection = nil then
+ Selection := RootNode.FirstSubNode
+ else
+ if Selection <> RootNode then
+ begin
+ if NodeIsVisible(selection) then
+ begin
+ h := PrevVisualNode(Selection);
+ if (h <> RootNode) and (h <> nil) then
+ Selection := h;
+ end
+ else
+ begin
+ Selection := RootNode.FirstSubNode;
+ end;
+ end;
+ Consumed := True;
+ end;
+
+ keyDown:
+ begin
+ Consumed := True;
+ if Selection = nil then
+ Selection := RootNode.FirstSubNode
+ else
begin
if NodeIsVisible(selection) then
begin
- h := PrevVisualNode(Selection);
- if (h <> RootNode) and (h <> nil) then
+ h := NextVisualNode(Selection);
+ if (h <> nil) then
Selection := h;
end
else
- begin
Selection := RootNode.FirstSubNode;
- end;
end;
- Consumed := True;
- end;
+ end;
- keyDown:
- begin
- Consumed := True;
- if Selection = nil then
- Selection := RootNode.FirstSubNode
- else
+ keyPageUp:
begin
- if NodeIsVisible(selection) then
- begin
- h := NextVisualNode(Selection);
- if (h <> nil) then
- Selection := h;
- end
- else
- Selection := RootNode.FirstSubNode;
+ FVScrollbar.PageUp;
end;
- end;
-
- keyPageUp:
- begin
- FVScrollbar.PageUp;
- end;
- keyPageDown:
- begin
- FVScrollbar.PageDown;
- end;
- else
- Consumed := False;
+ keyPageDown:
+ begin
+ FVScrollbar.PageDown;
+ end;
+ else
+ Consumed := False;
+ end;
end;
if Selection <> OldSelection then