diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-20 09:09:05 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-20 09:09:05 +0000 |
commit | 0672d8aaee4efb258cc284913a13aaae1540597b (patch) | |
tree | d7f7795d3d841e7d240d981f748aa894d749c684 /prototypes | |
parent | 38345eb48fc78daa323cebe28507dd222724e5ff (diff) | |
download | fpGUI-0672d8aaee4efb258cc284913a13aaae1540597b.tar.xz |
X11: WindowTitle under Linux now uses the NetLayer unit to enable window titles with UTF-8 characters.
Diffstat (limited to 'prototypes')
-rw-r--r-- | prototypes/fpgui2/source/core/x11/gfx_x11.pas | 46 | ||||
-rw-r--r-- | prototypes/fpgui2/source/gui/gui_button.pas | 2 | ||||
-rw-r--r-- | prototypes/fpgui2/tests/edittest.dpr | 3 | ||||
-rw-r--r-- | prototypes/fpgui2/tests/edittest.lpi | 7 | ||||
-rw-r--r-- | prototypes/fpgui2/tests/themetest.lpi | 7 |
5 files changed, 30 insertions, 35 deletions
diff --git a/prototypes/fpgui2/source/core/x11/gfx_x11.pas b/prototypes/fpgui2/source/core/x11/gfx_x11.pas index 8554272e..99411c18 100644 --- a/prototypes/fpgui2/source/core/x11/gfx_x11.pas +++ b/prototypes/fpgui2/source/core/x11/gfx_x11.pas @@ -183,7 +183,10 @@ uses baseunix, fpgfx, gfx_widget, {$Note This dependency to gfx_widget must be removed.} - gui_form; // remove this!!!!! + gui_form, // remove this!!!!! + xatom, + gfx_utf8utils, + _netlayer; var xapplication: TfpgApplication; @@ -1027,36 +1030,29 @@ end; procedure TfpgWindowImpl.DoSetWindowTitle(const atitle: string); var - s: string; - p: PByte; + //s: string; + //p: PByte; + netlayer: TNETWindowLayer; begin if FWinHandle <= 0 then Exit; - s := atitle; + //s := atitle; - if length(s) > 0 then - p := @s[1] - else - p := nil; - XChangeProperty(xapplication.display, FWinHandle, 39, 31, 8, 0, p, length(s)); - XChangeProperty(xapplication.display, FWinHandle, 37, 31, 8, 0, p, length(s)); - - { -var - tp: TXTextProperty; -begin - tp.value := PCUChar(ATitle); - tp.encoding := XA_WM_NAME; - tp.format := 8; - tp.nitems := UTF8Length(ATitle); - - XSetWMName(xapplication.display, FWinHandle, @tp); - XStoreName(xapplication.display, FWinHandle, PChar(ATitle)); - XSetIconName(xapplication.display, FWinHandle, PChar(ATitle)); - XSetWMIconName(xapplication.display, FWinHandle, @tp); + //if length(s) > 0 then + //p := @s[1] + //else + //p := nil; -} + netlayer := TNETWindowLayer.Create(xapplication.display); + try + netlayer.WindowSetName(FWinHandle, PChar(ATitle)); + finally + netlayer.Free; + end; + +// XChangeProperty(xapplication.display, FWinHandle, 39, 31, 8, 0, p, length(s)); +// XChangeProperty(xapplication.display, FWinHandle, 37, 31, 8, 0, p, length(s)); end; constructor TfpgWindowImpl.Create(AOwner: TComponent); diff --git a/prototypes/fpgui2/source/gui/gui_button.pas b/prototypes/fpgui2/source/gui/gui_button.pas index 719600c4..6acc7a28 100644 --- a/prototypes/fpgui2/source/gui/gui_button.pas +++ b/prototypes/fpgui2/source/gui/gui_button.pas @@ -187,7 +187,7 @@ var lBtnFlags: TFButtonFlags; begin Canvas.BeginDraw; - inherited HandlePaint; +// inherited HandlePaint; Canvas.Clear(clButtonFace); Canvas.ClearClipRect; diff --git a/prototypes/fpgui2/tests/edittest.dpr b/prototypes/fpgui2/tests/edittest.dpr index 8999fd86..31a85587 100644 --- a/prototypes/fpgui2/tests/edittest.dpr +++ b/prototypes/fpgui2/tests/edittest.dpr @@ -291,7 +291,8 @@ end; bmp: TfpgImage; begin SetPosition(200, 200, 500, 350); - WindowTitle := 'fpGUI Widget Test'; +// WindowTitle := 'fpGUI Widget Test'; + WindowTitle := 'Test Russian text -> Òåñò'; label1 := CreateLabel(self, 5, 5, 'Hello world!'); label2 := CreateLabel(self, 5, 20, 'Hello world in Bold!'); diff --git a/prototypes/fpgui2/tests/edittest.lpi b/prototypes/fpgui2/tests/edittest.lpi index 269ce784..3e9244a7 100644 --- a/prototypes/fpgui2/tests/edittest.lpi +++ b/prototypes/fpgui2/tests/edittest.lpi @@ -1,7 +1,7 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="\"/> + <PathDelim Value="/"/> <Version Value="5"/> <General> <Flags> @@ -9,7 +9,7 @@ </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"> @@ -46,7 +46,6 @@ </ProjectOptions> <CompilerOptions> <Version Value="5"/> - <PathDelim Value="\"/> <CodeGeneration> <Generate Value="Faster"/> </CodeGeneration> diff --git a/prototypes/fpgui2/tests/themetest.lpi b/prototypes/fpgui2/tests/themetest.lpi index d787ecbf..7ec6778f 100644 --- a/prototypes/fpgui2/tests/themetest.lpi +++ b/prototypes/fpgui2/tests/themetest.lpi @@ -1,7 +1,7 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="\"/> + <PathDelim Value="/"/> <Version Value="5"/> <General> <Flags> @@ -9,7 +9,7 @@ </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"> @@ -41,7 +41,6 @@ </ProjectOptions> <CompilerOptions> <Version Value="5"/> - <PathDelim Value="\"/> <CodeGeneration> <Generate Value="Faster"/> </CodeGeneration> |