diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-11-08 08:40:00 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-11-08 08:40:00 +0000 |
commit | 08de118bcf5f120f1e4eeaa8b1b6c28c4dca494d (patch) | |
tree | 91c23249007fbe499ddd3098cdac01e9c5d6ffd7 | |
parent | e1c4e17ab85fdc8ce5d79c1c42acadfdb5372249 (diff) | |
download | fpGUI-08de118bcf5f120f1e4eeaa8b1b6c28c4dca494d.tar.xz |
* X11: Setting a window title via netlayer does not work for the
IceWM. I had to add the old XSetWMName back into the code.
* GUI: Renamed the ComboCalendar's Value property to DateValue.
* GUI: Minor change in Gauges property visibility.
* UIDesigner: Added the ComboCalendar and Gauge components to the palette.
-rw-r--r-- | examples/apps/uidesigner/icons.inc | 105 | ||||
-rw-r--r-- | examples/apps/uidesigner/images/dateedit.bmp | bin | 0 -> 1710 bytes | |||
-rw-r--r-- | examples/apps/uidesigner/newformdesigner.pas | 18 | ||||
-rw-r--r-- | examples/apps/uidesigner/vfdfile.pas | 2 | ||||
-rw-r--r-- | examples/apps/uidesigner/vfdwidgets.pas | 45 | ||||
-rw-r--r-- | src/corelib/x11/gfx_x11.pas | 19 | ||||
-rw-r--r-- | src/gui/gui_gauge.pas | 2 | ||||
-rw-r--r-- | src/gui/gui_popupcalendar.pas | 6 |
8 files changed, 159 insertions, 38 deletions
diff --git a/examples/apps/uidesigner/icons.inc b/examples/apps/uidesigner/icons.inc index 96a1ebfd..cc4f2d98 100644 --- a/examples/apps/uidesigner/icons.inc +++ b/examples/apps/uidesigner/icons.inc @@ -1874,3 +1874,108 @@ Const 255, 0,255,255, 0,255); + +Const + stdimg_vfd_dateedit : Array[0..1709] of byte = ( + 66, 77,174, 6, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, + 0, 23, 0, 0, 0, 23, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, + 120, 6, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,128,128,128,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,128,128,128,192,192, + 192,192,192,192, 0, 0, 0,128, 0, 0, 0, 0, 0,128, 0, 0, 0, + 0, 0,128, 0, 0,128, 0, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 0, 0,192,192,192, 0, 0, 0, 0, 0, 0,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,128, + 128,128,192,192,192,192,192,192,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,192,192,192, 0, 0, 0, 0, + 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,128,128,128,192,192,192,192,192,192,255,255,255,255,255, + 255, 0, 0,128, 0, 0,128, 0, 0,128,255,255,255, 0, 0,128, 0, + 0,128, 0, 0,128,192,192,192,255,255,255,255,255,255,192,192,192, + 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,128,128,128,192,192,192,192,192,192,255, + 255,255,255,255,255,255,255,255, 0, 0,128,255,255,255,255,255,255, + 192,192,192,255,255,255,192,192,192, 0, 0,128,255,255,255,255,255, + 255,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,128,128,128,192,192,192, + 192,192,192,255,255,255,255,255,255,255,255,255, 0, 0,128,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0,128,255, + 255,255,255,255,255,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,128,128, + 128,192,192,192,192,192,192,255,255,255,255,255,255,255,255,255, 0, + 0,128,255,255,255,255,255,255, 0, 0,128, 0, 0,128, 0, 0,128, + 192,192,192,255,255,255,255,255,255,192,192,192, 0, 0, 0, 0, 0, + 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,128,128,128,192,192,192,192,192,192,255,255,255,255,255,255, + 0, 0,128, 0, 0,128,255,255,255,255,255,255, 0, 0,128,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,192,192,192, 0, + 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,128,128,128,192,192,192,192,192,192,255,255, + 255,255,255,255,255,255,255, 0, 0,128,255,255,255,255,255,255, 0, + 0,128, 0, 0,128, 0, 0,128, 0, 0,128,255,255,255,255,255,255, + 192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,128,128,128,192,192,192,192, + 192,192,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,192,192,192, 0, 0, 0, 0, 0, 0,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,128,128,128, + 192,192,192,192,192,192,255,255,255,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,255,255,255,192,192,192, 0, 0, 0, 0, 0, 0, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,128,128,128,192,192,192,192,192,192, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,192,192, 0, 0, + 0, 0, 0, 0,255, 0,255,128,128,128,255,255,255,255,255,255,255, + 255,255,255,255,255,128,128,128,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, + 192,192, 0, 0, 0, 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0, + 192,192,192,192,192,192,192,192,192, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0,255,128,128, + 128, 0, 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, + 255,255, 0, 0, 0,255, 0, 0,255, 0, 0,255, 0, 0,255, 0, 0, + 255, 0, 0,255, 0, 0,255, 0, 0,255, 0, 0,255, 0, 0,255, 0, + 0,255, 0, 0, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255, + 0,255,128,128,128, 0, 0, 0,255,255,255,255,255,255,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,192,192,192,255,255,255,192,192,192, + 0, 0, 0, 0, 0, 0,192,192,192,128,128,128,192,192,192,255,255, + 255,255, 0,255, 0, 0, 0,255, 0,255,128,128,128, 0, 0, 0,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,192,192,192,255,255, + 255,192,192,192,192,192,192,192,192,192,192,192,192,128,128,128,192, + 192,192,255,255,255,255, 0,255, 0, 0, 0,255, 0,255,128,128,128, + 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,192, + 192,192,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,192,192,192,255,255,255,255, 0,255, 0, 0, 0,255, 0, + 255,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255, 0,255, 0, + 0, 0,255, 0,255,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, + 255, 0,255, 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, + 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255, + 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0, + 255,255, 0,255,255, 0,255, 0, 0, 0); + diff --git a/examples/apps/uidesigner/images/dateedit.bmp b/examples/apps/uidesigner/images/dateedit.bmp Binary files differnew file mode 100644 index 00000000..7e075c10 --- /dev/null +++ b/examples/apps/uidesigner/images/dateedit.bmp diff --git a/examples/apps/uidesigner/newformdesigner.pas b/examples/apps/uidesigner/newformdesigner.pas index a3193b4e..110a21ec 100644 --- a/examples/apps/uidesigner/newformdesigner.pas +++ b/examples/apps/uidesigner/newformdesigner.pas @@ -275,7 +275,7 @@ var begin {@VFD_BODY_BEGIN: frmMain} Name := 'frmMain'; - SetPosition(84, 123, 635, 87); + SetPosition(84, 123, 695, 87); WindowTitle := 'frmMain'; WindowPosition := wpUser; @@ -283,7 +283,7 @@ begin with MainMenu do begin Name := 'MainMenu'; - SetPosition(0, 0, 635, 24); + SetPosition(0, 0, 696, 24); Anchors := [anLeft,anRight,anTop]; end; @@ -294,11 +294,9 @@ begin SetPosition(4, 28, 25, 24); Text := ''; FontDesc := '#Label1'; + ImageMargin := -1; ImageName := 'vfd.newform'; - ModalResult := 0; - ShowImage := True; Focusable := False; - ImageMargin := -1; OnClick := @(maindsgn.OnNewForm); end; @@ -309,11 +307,9 @@ begin SetPosition(30, 28, 25, 24); Text := ''; FontDesc := '#Label1'; + ImageMargin := -1; ImageName := 'stdimg.open'; - ModalResult := 0; - ShowImage := True; Focusable := False; - ImageMargin := -1; OnClick := @(maindsgn.OnLoadFile); end; @@ -324,11 +320,9 @@ begin SetPosition(56, 28, 25, 24); Text := ''; FontDesc := '#Label1'; + ImageMargin := -1; ImageName := 'stdimg.save'; - ModalResult := 0; - ShowImage := True; Focusable := False; - ImageMargin := -1; OnClick := @(maindsgn.OnSaveFile); end; @@ -336,7 +330,7 @@ begin with wgpalette do begin Name := 'wgpalette'; - SetPosition(116, 28, 519, 28); + SetPosition(116, 28, 580, 28); Anchors := [anLeft,anRight,anTop]; Focusable := False; end; diff --git a/examples/apps/uidesigner/vfdfile.pas b/examples/apps/uidesigner/vfdfile.pas index fbecc9be..7872bbcd 100644 --- a/examples/apps/uidesigner/vfdfile.pas +++ b/examples/apps/uidesigner/vfdfile.pas @@ -356,7 +356,7 @@ begin ' gui_listbox, gui_memo, gui_combobox, gui_grid, ' + LineEnding + ' gui_dialogs, gui_checkbox, gui_tree, gui_trackbar, ' + LineEnding + ' gui_progressbar, gui_radiobutton, gui_tab, gui_menu,' + LineEnding + - ' gui_bevel;' + LineEnding + LineEnding + + ' gui_bevel, gui_popupcalendar, gui_gauge;' + LineEnding + LineEnding + 'type' + LineEnding + LineEnding + '{@VFD_NEWFORM_DECL}' + LineEnding + LineEnding + 'implementation' + LineEnding + LineEnding + diff --git a/examples/apps/uidesigner/vfdwidgets.pas b/examples/apps/uidesigner/vfdwidgets.pas index f799f41b..add41328 100644 --- a/examples/apps/uidesigner/vfdwidgets.pas +++ b/examples/apps/uidesigner/vfdwidgets.pas @@ -59,6 +59,8 @@ uses gui_menu, gui_progressbar, gui_tab, + gui_popupcalendar, + gui_gauge, vfdpropeditgrid; var @@ -193,6 +195,11 @@ begin 'vfd.newform', @stdimg_vfd_newform, sizeof(stdimg_vfd_newform), 0, 0); + + fpgImages.AddMaskedBMP( + 'vfd.combodateedit', @stdimg_vfd_dateedit, + sizeof(stdimg_vfd_dateedit), + 0, 0); end; procedure AddWidgetPosProps(wgc: TVFDWidgetClass); @@ -261,7 +268,6 @@ begin wc.AddProperty('Text', TPropertyString, 'Initial text'); wc.AddProperty('FontDesc', TPropertyString, 'The font used for displaying the text'); wc.AddProperty('Checked', TPropertyBoolean, 'Boolean value'); -// wc.AddProperty('BackgroundColor', TPropertyString, ''); wc.WidgetIconName := 'vfd.checkbox'; RegisterVFDWidget(wc); @@ -272,7 +278,6 @@ begin wc.AddProperty('FontDesc', TPropertyString, 'The font used for displaying the text'); wc.AddProperty('GroupIndex', TPropertyInteger, ''); wc.AddProperty('Checked', TPropertyBoolean, 'Boolean value'); -// wc.AddProperty('BackgroundColor', TPropertyString, ''); wc.WidgetIconName := 'vfd.radiobutton'; RegisterVFDWidget(wc); @@ -284,6 +289,13 @@ begin wc.WidgetIconName := 'vfd.combobox'; RegisterVFDWidget(wc); + // Calendar ComboBox + wc := TVFDWidgetClass.Create(TfpgCalendarCombo); + wc.NameBase := 'calName'; + wc.AddProperty('FontDesc', TPropertyString, 'The font used for displaying the text'); + wc.WidgetIconName := 'vfd.combodateedit'; + RegisterVFDWidget(wc); + // ListBox wc := TVFDWidgetClass.Create(TfpgListBox); wc.NameBase := 'lstName'; @@ -335,23 +347,14 @@ begin wc.WidgetIconName := 'vfd.trackbar'; RegisterVFDWidget(wc); - // ListView - // Currently causes a Access Violation when resized! - wc := TVFDWidgetClass.Create(TfpgListView); wc.NameBase := 'lvName'; - //wc.AddProperty('Columns',TPropertyDBColumns, ''); - //wc.AddProperty('FontDesc',TPropertyString,''); - //wc.AddProperty('HeaderFontDesc',TPropertyString,''); - //wc.AddProperty('Items', TPropertyStringList, ''); - //wc.AddProperty('ItemHeight', TPropertyInteger, ''); wc.AddProperty('MultiSelect', TPropertyBoolean, ''); wc.AddProperty('ShowHeaders', TPropertyBoolean, ''); wc.WidgetIconName := 'vfd.listview'; RegisterVFDWidget(wc); - // Treeview wc := TVFDWidgetClass.Create(TfpgTreeView); wc.NameBase := 'tvName'; @@ -360,7 +363,6 @@ begin wc.AddProperty('ShowColumns',TPropertyBoolean, 'Boolean value'); wc.AddProperty('DefaultColumnWidth',TPropertyInteger, ''); wc.AddProperty('TreeLineStyle', TPropertyEnum, ''); -// wc.AddProperty('TreeLineColor', TPropertyString, ''); wc.AddProperty('ScrollWheelDelta', TPropertyInteger, 'Scroll amount with mouse wheel'); wc.WidgetIconName := 'vfd.treeview'; RegisterVFDWidget(wc); @@ -368,8 +370,6 @@ begin // PageControl wc := TVFDWidgetClass.Create(TfpgPageControl); wc.NameBase := 'pcName'; -// wc.AddProperty('ActivePageIndex', TPropertyInteger, ''); -// wc.AddProperty('BackgroundColor', TPropertyString, ''); wc.AddProperty('FixedTabWidth', TPropertyInteger, ''); wc.AddProperty('SortPages', TPropertyBoolean, 'Boolean value'); wc.AddProperty('Style', TPropertyEnum, ''); @@ -377,12 +377,17 @@ begin wc.WidgetIconName := 'vfd.pagecontrol'; RegisterVFDWidget(wc); - // MenuBar -// wc := TVFDWidgetClass.Create(TfpgMenuBar); -// wc.NameBase := 'mnuMain'; -//// wc.AddProperty('BackgroundColor', TPropertyString, ''); -// wc.WidgetIconName := 'vfd.menubar'; -// RegisterVFDWidget(wc); + // Gauge + wc := TVFDWidgetClass.Create(TfpgGauge); + wc.NameBase := 'gauName'; + wc.AddProperty('Kind', TPropertyEnum, ''); + wc.AddProperty('MinValue', TPropertyInteger, ''); + wc.AddProperty('MaxValue', TPropertyInteger, ''); + wc.AddProperty('Progress', TPropertyInteger, ''); + wc.AddProperty('ShowText', TPropertyBoolean, 'Boolean value'); + wc.WidgetIconName := 'vfd.gauge'; + RegisterVFDWidget(wc); + // Other - do not delete!!! this should be the last... wc := TVFDWidgetClass.Create(TOtherWidget); diff --git a/src/corelib/x11/gfx_x11.pas b/src/corelib/x11/gfx_x11.pas index 6a1531bd..f77b6f8e 100644 --- a/src/corelib/x11/gfx_x11.pas +++ b/src/corelib/x11/gfx_x11.pas @@ -195,7 +195,9 @@ uses gfx_widget, {$Note This dependency to gfx_widget must be removed.} gui_form, // remove this!!!!! cursorfont, - gfx_popupwindow; + gfx_popupwindow, + xatom, // used for XA_WM_NAME + gfx_utf8utils; var xapplication: TfpgApplication; @@ -1220,11 +1222,24 @@ begin XFreeCursor(xapplication.Display, xc); end; -procedure TfpgWindowImpl.DoSetWindowTitle(const atitle: string); +procedure TfpgWindowImpl.DoSetWindowTitle(const ATitle: string); +var + tp: TXTextProperty; begin if FWinHandle <= 0 then Exit; fpgApplication.netlayer.WindowSetName(FWinHandle, PChar(ATitle)); + + // Required for titles to work in IceWM. The above netlayer doesn't do the trick. + 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); end; constructor TfpgWindowImpl.Create(AOwner: TComponent); diff --git a/src/gui/gui_gauge.pas b/src/gui/gui_gauge.pas index 68c4da2e..c998e232 100644 --- a/src/gui/gui_gauge.pas +++ b/src/gui/gui_gauge.pas @@ -79,6 +79,7 @@ type constructor Create(AOwner: TComponent); override; procedure AddProgress(AValue: Longint); property Percentage: Longint read GetPercentage; + property Font: TfpgFont read FFont; published property Align; property Anchors; @@ -87,7 +88,6 @@ type property Color: TfpgColor read FColor write FColor default clButtonFace; property Enabled; property FirstColor: TfpgColor read FFirstColor write SetFirstColor default clBlack; - property Font: TfpgFont read FFont; property Kind: TGaugeKind read FKind write SetGaugeKind default gkHorizontalBar; property MinValue: Longint read FMin write SetMin default 0; property MaxValue: Longint read FMax write SetMax default 100; diff --git a/src/gui/gui_popupcalendar.pas b/src/gui/gui_popupcalendar.pas index 88da838f..9d6431f0 100644 --- a/src/gui/gui_popupcalendar.pas +++ b/src/gui/gui_popupcalendar.pas @@ -106,9 +106,11 @@ type procedure DoDropDown; override; public constructor Create(AOwner: TComponent); override; + property DateValue: TDateTime read FDate write SetDateValue; published - property Value: TDateTime read FDate write SetDateValue; + property BackgroundColor; property DateFormat: string read FDateFormat write SetDateFormat; + property FontDesc; end; {@VFD_NEWFORM_DECL} @@ -529,7 +531,7 @@ end; procedure TfpgCalendarCombo.InternalOnValueSet(Sender: TObject; const ADate: TDateTime); begin - Value := ADate; + DateValue := ADate; {$IFDEF DEBUG} writeln('New value: ', FormatDateTime(FDateFormat, ADate)); {$ENDIF} |