diff options
-rw-r--r-- | examples/gui/widgetdemo/widgetdemo.lpr | 6 | ||||
-rw-r--r-- | examples/gui/widgettest/widgettest.lpi | 7 | ||||
-rw-r--r-- | examples/gui/widgettest/widgettest.pas | 7 | ||||
-rw-r--r-- | gfx/x11/gfx_x11.pas | 23 | ||||
-rw-r--r-- | gui/fpguicombobox.inc | 8 | ||||
-rw-r--r-- | gui/fpguiedit.inc | 4 | ||||
-rw-r--r-- | gui/fpguiform.inc | 1 | ||||
-rw-r--r-- | gui/fpguimenus.inc | 4 | ||||
-rw-r--r-- | gui/fpguiscrollbar.inc | 6 | ||||
-rw-r--r-- | gui/fpguiscrollbox.inc | 4 |
10 files changed, 44 insertions, 26 deletions
diff --git a/examples/gui/widgetdemo/widgetdemo.lpr b/examples/gui/widgetdemo/widgetdemo.lpr index f0d7ef73..60679669 100644 --- a/examples/gui/widgetdemo/widgetdemo.lpr +++ b/examples/gui/widgetdemo/widgetdemo.lpr @@ -302,12 +302,12 @@ begin inherited Create(AOwner); Text := 'Widget Demo'; BorderWidth := 8; -// WindowType := wtWindow; - + topLayout := TFBoxLayout.Create(self); topLayout.Orientation := Vertical; mainLayout := TFGridLayout.Create(self); mainLayout.RowCount := 2; +// mainlayout.RowSpacing := 0; CreateTopMenu; topLayout.InsertChild(MainMenu); @@ -345,7 +345,7 @@ var begin GFApplication.Initialize; - WidgetDemoForm := TWidgetDemoForm.Create(GFApplication); + WidgetDemoForm := TWidgetDemoForm.Create(nil); try WidgetDemoForm.Show; GFApplication.Run; diff --git a/examples/gui/widgettest/widgettest.lpi b/examples/gui/widgettest/widgettest.lpi index 82a0b3e5..6f4700f4 100644 --- a/examples/gui/widgettest/widgettest.lpi +++ b/examples/gui/widgettest/widgettest.lpi @@ -1,7 +1,7 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="\"/> + <PathDelim Value="/"/> <Version Value="5"/> <General> <Flags> @@ -10,7 +10,7 @@ </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value=".\"/> + <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <PublishOptions> @@ -21,7 +21,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"> @@ -40,7 +40,6 @@ </ProjectOptions> <CompilerOptions> <Version Value="5"/> - <PathDelim Value="\"/> <Parsing> <SyntaxOptions> <IncludeAssertionCode Value="True"/> diff --git a/examples/gui/widgettest/widgettest.pas b/examples/gui/widgettest/widgettest.pas index 0705396a..fcfe3b99 100644 --- a/examples/gui/widgettest/widgettest.pas +++ b/examples/gui/widgettest/widgettest.pas @@ -117,6 +117,7 @@ type { TEditForm } TEditForm = class(TTestForm) + published Grid: TFGridLayout; VertBox, HorzBox1, HorzBox2: TFBoxLayout; Label1, Label2, PasswordDisplay: TFLabel; @@ -206,6 +207,7 @@ type Title: TFLabel; p1, p2, p3, p4, p5, p6: TFPanel; MenuBox: TFBoxLayout; + Separator: TSeparator; end; @@ -302,6 +304,9 @@ begin lMenuItem.SubMenu.AddMenu('Tutorials'); lMenuItem.SubMenu.AddMenu('About', '', @AboutMenuClicked); + Separator := TSeparator.Create(self); + BoxLayout.InsertChild(Separator); + Title := TFLabel.Create(self); Title.CanExpandWidth := True; Title.Alignment := taCenter; @@ -666,6 +671,7 @@ end; procedure TEditForm.cbBorderStyleClick(Sender: TObject); begin +// SaveForm(self); if Edit1.BorderStyle = bsNone then begin Edit1.BorderStyle := bsSingle; @@ -688,6 +694,7 @@ constructor TEditForm.Create(AOwner: TComponent); begin inherited Create(AOwner); LoadForm(self); + Edit2.PasswordChar := '*'; end; diff --git a/gfx/x11/gfx_x11.pas b/gfx/x11/gfx_x11.pas index ad50f149..7128c4bf 100644 --- a/gfx/x11/gfx_x11.pas +++ b/gfx/x11/gfx_x11.pas @@ -287,7 +287,7 @@ uses GELImage ,fpGFX {$IFDEF XftSupport} - ,schar16 // Unicode support +// ,schar16 // Unicode support {$ENDIF} ; @@ -652,7 +652,7 @@ procedure TX11Canvas.DoTextOut(const APosition: TPoint; const AText: String); {$IFDEF XftSupport} var fntColor: TXftColor; - s: String16; + WideText: WideString; procedure SetXftColor(c: TGfxPixel; var colxft: TXftColor); begin @@ -672,14 +672,20 @@ begin Exit; //==> {$IFDEF XftSupport} -// fnt := XftFontOpenName(GFApplication.Handle, XDefaultScreen(GFApplication.Handle), PChar('Sans-12')); + WideText := Utf8Decode(AText); + SetXftColor(FCurColor,fntColor); -// s := u8(AText); XftDrawSetClip(FXftDraw, FRegion); - XftDrawString8(FXftDraw, fntColor, FFontStruct.FontData, APosition.x, - Aposition.y + FFontStruct.GetAscent, PChar(AText), Length(AText)); -// XftDrawString16(FXftDraw, fntColor, fnt, APosition.x, Aposition.y * 3, @s[1], Length16(s)); -// XftFontClose(GFApplication.Handle, fnt); +// XftDrawString8(FXftDraw, fntColor, FFontStruct.FontData, APosition.x, +// Aposition.y + FFontStruct.GetAscent, PChar(AText), Length(AText)); + + XftDrawString16(FXftDraw, fntColor, FFontStruct.FontData, APosition.x, + Aposition.y + FFontStruct.GetAscent, PChar(WideText), Length(WideText)); + +// pasgf implementation +// XftDrawString16(FXftDraw, FColorTextXft, FCurFontRes.Handle, x, +// y+FCurFontRes.GetAscent, @txt[1], Length(txt) ) + {$ELSE} XDrawString(GFApplication.Handle, Handle, GC, APosition.x, APosition.y + FFontStruct.GetAscent, PChar(AText), Length(AText)); @@ -1572,6 +1578,7 @@ end; { Makes the window visible and raises it to the top of the stack. } procedure TX11Window.Show; begin + GFApplication.AddWindow(self); XMapRaised(GFApplication.Handle, Handle); end; diff --git a/gui/fpguicombobox.inc b/gui/fpguicombobox.inc index 862f7297..5eef10d8 100644 --- a/gui/fpguicombobox.inc +++ b/gui/fpguicombobox.inc @@ -105,16 +105,16 @@ begin WidgetStyle := WidgetStyle + [wsCaptureMouse, wsClickable, wsOpaque]; BorderWidth := 1; Color := clBlack; - Name := '#ComboBoxPopup'; + Name := '_ComboBoxPopup'; FLayout := TFBoxLayout.Create(self); - FLayout.Name := '#VBoxLayout'; + FLayout.Name := '_VBoxLayout'; FLayout.Orientation := Vertical; FLayout.Spacing := 0; InsertChild(FLayout); FListBox := TFListBox.Create(self); - FListBox.Name := '#Listbox'; + FListBox.Name := '_Listbox'; FListBox.HotTrack := True; FLayout.InsertChild(FListBox); end; @@ -133,7 +133,7 @@ begin FItemIndex := -1; ComboBoxButton := TFArrowButton.Create(Self); - ComboBoxButton.Name := '#ComboBoxButton'; + ComboBoxButton.Name := '_ComboBoxButton'; ComboBoxButton.Embedded := True; ComboBoxButton.CanExpandWidth := False; ComboBoxButton.CanExpandHeight := False; diff --git a/gui/fpguiedit.inc b/gui/fpguiedit.inc index 82ab9edd..8cd3268c 100644 --- a/gui/fpguiedit.inc +++ b/gui/fpguiedit.inc @@ -388,6 +388,10 @@ var lBorders: TRect; lSideMargins: integer; begin + // This is not pretty and needs to change, but if these two tests are not + // here it throws a AV when loading forms + if not Assigned(FindForm) then + Exit; //==> if not Assigned(FindForm.FWnd) then Exit; //==> diff --git a/gui/fpguiform.inc b/gui/fpguiform.inc index 5c3b3c06..2ff0ad37 100644 --- a/gui/fpguiform.inc +++ b/gui/fpguiform.inc @@ -145,6 +145,7 @@ begin LAYOUTTRACE('TFCustomForm.Show for %s:%s', [Name, ClassName]); FVisible := True; +// GFApplication.AddWindow(Wnd); Wnd.Show; end; diff --git a/gui/fpguimenus.inc b/gui/fpguimenus.inc index 7a59f318..94a61e03 100644 --- a/gui/fpguimenus.inc +++ b/gui/fpguimenus.inc @@ -181,10 +181,10 @@ begin WidgetStyle := WidgetStyle + [wsCaptureMouse, wsClickable, wsOpaque]; BorderWidth := 1; Color := clBlack; - Name := '#MenuPopup'; + Name := '_MenuPopup'; FMenu := TFMenuBar.Create(self); - FMenu.Name := '#VBoxMenu'; + FMenu.Name := '_VBoxMenu'; FMenu.Orientation := Vertical; FMenu.Spacing := 0; InsertChild(FMenu); diff --git a/gui/fpguiscrollbar.inc b/gui/fpguiscrollbar.inc index 08e1ecc8..c3dfa195 100644 --- a/gui/fpguiscrollbar.inc +++ b/gui/fpguiscrollbar.inc @@ -439,7 +439,7 @@ begin FSmallChange := 1; ButtonUp := TFScrollBarButton.Create(Self); - ButtonUp.Name := '#ScrollBarButtonUp'; + ButtonUp.Name := '_ScrollBarButtonUp'; TFScrollBarButton(ButtonUp).Direction := arrowLeft; ButtonUp.Embedded := True; ButtonUp.CanExpandWidth := False; @@ -448,11 +448,11 @@ begin ButtonUp.SetEmbeddedParent(Self); Slider := TFScrollBarSlider.Create(Self); - Slider.Name := '#ScrollBarSlider'; + Slider.Name := '_ScrollBarSlider'; Slider.SetEmbeddedParent(Self); ButtonDown := TFScrollBarButton.Create(Self); - ButtonDown.Name := '#ScrollBarButtonDown'; + ButtonDown.Name := '_ScrollBarButtonDown'; TFScrollBarButton(ButtonDown).Direction := arrowRight; ButtonDown.Embedded := True; ButtonDown.CanExpandWidth := False; diff --git a/gui/fpguiscrollbox.inc b/gui/fpguiscrollbox.inc index 81ce48db..d6b22a24 100644 --- a/gui/fpguiscrollbox.inc +++ b/gui/fpguiscrollbox.inc @@ -83,12 +83,12 @@ begin Parent := AParent; FHorzScrollBar := TFScrollBar.Create(Parent); - HorzScrollBar.Name := '#Scrolling_HorzBar'; + HorzScrollBar.Name := '_Scrolling_HorzBar'; HorzScrollBar.Embedded := True; HorzScrollBar.SetEmbeddedParent(Parent); FVerTFScrollBar := TFScrollBar.Create(Parent); - VerTFScrollBar.Name := '#Scrolling_VertBar'; + VerTFScrollBar.Name := '_Scrolling_VertBar'; VerTFScrollBar.Orientation := Vertical; VerTFScrollBar.Embedded := True; VerTFScrollBar.SetEmbeddedParent(Parent); |