diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-09-10 11:36:44 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-09-10 11:36:44 +0000 |
commit | a62206f31a587efadcc40c877f5e45130c807844 (patch) | |
tree | 3904823cfbb9cea1a7892a619c7bc90ad80026cd /uidesigner | |
parent | 3a887b21167a036cca541304800f582bcd6c27a4 (diff) | |
download | fpGUI-a62206f31a587efadcc40c877f5e45130c807844.tar.xz |
* Published ShowHint and ParentShowHint for all gui components.
* UI Designer: Updated the designer to support ShowHint and ParentShowHint properties.
* Updated the ShowHint property in TfpgWidget to use the stored property specifier.
Diffstat (limited to 'uidesigner')
-rw-r--r-- | uidesigner/vfddesigner.pas | 83 | ||||
-rw-r--r-- | uidesigner/vfdprops.pas | 19 | ||||
-rw-r--r-- | uidesigner/vfdwidgets.pas | 37 |
3 files changed, 68 insertions, 71 deletions
diff --git a/uidesigner/vfddesigner.pas b/uidesigner/vfddesigner.pas index f8bb23af..ee1c4477 100644 --- a/uidesigner/vfddesigner.pas +++ b/uidesigner/vfddesigner.pas @@ -892,68 +892,6 @@ begin btnAnRight.Down := anRight in wg.Anchors; btnAnBottom.Down := anBottom in wg.Anchors; end; - - Exit; - { - with PropertyForm do - begin - if wg is TOtherWidget then lbClass.Text8 := TOtherWidget(wg).wgClassName - else lbClass.Text8 := wg.ClassName; - - edName.Text8 := wg.Name; - - lbLeft.Text8 := IntToStr(wg.Left); - lbTop.Text8 := IntToStr(wg.Top); - lbWidth.Text8 := IntToStr(wg.Width); - lbHeight.Text8 := IntToStr(wg.Height); - - cbAL.Checked := anLeft in wg.Anchors; - cbAT.Checked := anTop in wg.Anchors; - cbAR.Checked := anRight in wg.Anchors; - cbAB.Checked := anBottom in wg.Anchors; - - btxt := true; - bedit := false; - lbText.Text := u8('Text:'); - - if wg is TGfxForm then edText.Text := TGfxForm(wg).WindowTitle - else if wg is TwgLabel then edText.Text := TwgLabel(wg).Text - else if wg is TwgEdit then edText.Text := TwgEdit(wg).Text - else if wg is TwgButton then edText.Text := TwgButton(wg).Text - else if wg is TwgCheckBox then edText.Text := TwgCheckBox(wg).Text - else btxt := false; - - if not btxt and ((wg is TwgMemo) or (wg is TwgChoiceList) or (wg is TwgTextListBox)) - then - begin - bedit := true; - lbText.Text := u8('Items:'); - btnEdit.Text := u8('Edit items...'); - end - else if (wg is TwgDBGrid) then - begin - bedit := true; - //lbText.Text := u8('Items:'); - btnEdit.Text := u8('Edit columns...'); - end; - - if scd <> nil then - begin - edOther.Text := str8to16(scd.other.Text); - end - else - begin - edOther.Text := str8to16(FFormOther); - end; - - edText.Visible := btxt; - lbText.Visible := btxt; - btnEdit.Visible := bedit; - edName.Visible := (wgcnt < 2); - edOther.Visible := (wgcnt < 2); - - end; // with PropertyForm -} end; procedure TFormDesigner.OnPropTextChange(Sender: TObject); @@ -1228,12 +1166,16 @@ end; function TFormDesigner.GetFormSourceImpl: string; var - s: string; + s: TfpgString; sl: TStringList; n: integer; wd: TWidgetDesigner; wg: TfpgWidget; wgclass, pwgname: string; + + t: TfpgString; + i: integer; + PropInfo: PPropInfo; begin s := ''; @@ -1267,6 +1209,21 @@ begin } s := s + ' WindowTitle := ' + QuotedStr(FForm.WindowTitle) + ';' + LineEnding; + // ShowHint property - This is ugly, Form's properties or not handled well!! + PropInfo := GetPropInfo(FForm.ClassType, 'ShowHint'); + i := GetOrdProp(FForm, 'ShowHint'); + if IsStoredProp(FForm, PropInfo) then + begin + if PropInfo^.Default <> i then + begin + if i = 1 then + t := 'True' + else + t := 'False'; + s := s + ' ShowHint := ' + t + ';' + LineEnding; + end; + end; + //adding other form properties, idented sl := TStringList.Create; sl.Text := FFormOther; diff --git a/uidesigner/vfdprops.pas b/uidesigner/vfdprops.pas index a46b73c5..0b701c8d 100644 --- a/uidesigner/vfdprops.pas +++ b/uidesigner/vfdprops.pas @@ -488,16 +488,19 @@ var begin PropInfo := GetPropInfo(wg.ClassType, Name); i := GetOrdProp(wg, Name); - if PropInfo^.Default <> i then + if IsStoredProp(wg, PropInfo) then begin - if i = 1 then - s := 'True' + if PropInfo^.Default <> i then + begin + if i = 1 then + s := 'True' + else + s := 'False'; + Result := ident + Name + ' := ' + s + ';' + LineEnding; + end else - s := 'False'; - Result := ident + Name + ' := ' + s + ';' + LineEnding; - end - else - Result := ''; + Result := ''; + end; end; function TPropertyBoolean.GetValueText(wg: TfpgWidget): string; diff --git a/uidesigner/vfdwidgets.pas b/uidesigner/vfdwidgets.pas index c002b6b9..4f338151 100644 --- a/uidesigner/vfdwidgets.pas +++ b/uidesigner/vfdwidgets.pas @@ -227,6 +227,7 @@ begin wc.NameBase := 'frm'; wc.AddProperty('WindowTitle', TPropertyString, ''); // wc.AddProperty('WindowPosition', TPropertyEnum, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); FVFDFormWidget := wc; // Label @@ -236,6 +237,8 @@ begin wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the label text'); wc.AddProperty('Hint', TPropertyString, ''); wc.AddProperty('Layout', TPropertyEnum, 'Vertical text layout'); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('Text', TPropertyString, 'Label text'); wc.AddProperty('WrapText', TPropertyBoolean, 'If True text will wrap when it doesn''t fit the width'); wc.WidgetIconName := 'vfd.label'; @@ -248,6 +251,8 @@ begin wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.AddProperty('Text', TPropertyString, 'Initial text'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.WidgetIconName := 'vfd.edit'; RegisterVFDWidget(wc); @@ -256,6 +261,8 @@ begin wc.NameBase := 'memName'; wc.AddProperty('Lines', TPropertyStringList, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.WidgetIconName := 'vfd.memo'; RegisterVFDWidget(wc); @@ -275,6 +282,8 @@ begin wc.AddProperty('ImageName', TPropertyString, ''); wc.AddProperty('ImageSpacing', TPropertyInteger, 'Space between image and text, -1 centers text'); wc.AddProperty('ModalResult', TPropertyInteger, ''); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowImage', TPropertyBoolean, 'Boolean value'); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.WidgetIconName := 'vfd.button'; @@ -285,6 +294,8 @@ begin wc.NameBase := 'cbName'; wc.AddProperty('Checked', TPropertyBoolean, 'Boolean value'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.AddProperty('Text', TPropertyString, 'Initial text'); wc.WidgetIconName := 'vfd.checkbox'; @@ -296,6 +307,8 @@ begin wc.AddProperty('Checked', TPropertyBoolean, 'Boolean value'); wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('GroupIndex', TPropertyInteger, ''); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.AddProperty('Text', TPropertyString, 'Initial text'); wc.WidgetIconName := 'vfd.radiobutton'; @@ -306,6 +319,8 @@ begin wc.NameBase := 'cbName'; wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('Items', TPropertyStringList, ''); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.WidgetIconName := 'vfd.combobox'; RegisterVFDWidget(wc); @@ -314,6 +329,8 @@ begin wc := TVFDWidgetClass.Create(TfpgCalendarCombo); wc.NameBase := 'calName'; wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.WidgetIconName := 'vfd.combodateedit'; RegisterVFDWidget(wc); @@ -324,7 +341,9 @@ begin wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text'); wc.AddProperty('HotTrack', TPropertyBoolean, ''); wc.AddProperty('Items', TPropertyStringList, ''); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('PopupFrame', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.WidgetIconName := 'vfd.listbox'; RegisterVFDWidget(wc); @@ -335,9 +354,11 @@ begin wc.AddProperty('Columns', TPropertyDBColumns, ''); wc.AddProperty('FontDesc', TPropertyFontDesc, ''); wc.AddProperty('HeaderFontDesc', TPropertyFontDesc, ''); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('RowCount', TPropertyInteger, ''); wc.AddProperty('RowSelect', TPropertyBoolean, ''); wc.AddProperty('ShowHeader', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowGrid', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.WidgetIconName := 'vfd.stringgrid'; @@ -347,8 +368,10 @@ begin wc := TVFDWidgetClass.Create(TfpgBevel); wc.NameBase := 'bvlName'; wc.AddProperty('BorderStyle', TPropertyEnum, 'Single or Double'); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('Style', TPropertyEnum, 'Raised or Lower look'); wc.AddProperty('Shape', TPropertyEnum, 'Box, Frame, TopLine, Spacer etc..'); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.WidgetIconName := 'vfd.bevel'; wc.Container := True; RegisterVFDWidget(wc); @@ -360,6 +383,8 @@ begin wc.AddProperty('Layout', TPropertyEnum, 'Layout of the caption'); wc.AddProperty('LineSpace', TPropertyInteger, 'Line spacing between wrapped caption'); wc.AddProperty('Margin', TPropertyInteger, 'Margin of text'); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('Style', TPropertyEnum, ''); wc.AddProperty('Text', TPropertyString, 'The panel caption'); wc.AddProperty('WrapText', TPropertyBoolean, 'Should the panel text be wrapped'); @@ -372,8 +397,10 @@ begin wc.NameBase := 'pbName'; wc.AddProperty('Min', TPropertyInteger, ''); wc.AddProperty('Max', TPropertyInteger, ''); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('Position', TPropertyInteger, ''); wc.AddProperty('ShowCaption', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.WidgetIconName := 'vfd.progressbar'; RegisterVFDWidget(wc); @@ -383,6 +410,8 @@ begin wc.AddProperty('Max', TPropertyInteger, ''); wc.AddProperty('Min', TPropertyInteger, ''); wc.AddProperty('Orientation', TPropertyEnum, ''); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('Position', TPropertyInteger, ''); wc.AddProperty('ShowPosition', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); @@ -393,7 +422,9 @@ begin wc := TVFDWidgetClass.Create(TfpgListView); wc.NameBase := 'lvName'; wc.AddProperty('MultiSelect', TPropertyBoolean, ''); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowHeaders', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.WidgetIconName := 'vfd.listview'; RegisterVFDWidget(wc); @@ -403,8 +434,10 @@ begin wc.NameBase := 'tvName'; wc.AddProperty('DefaultColumnWidth',TPropertyInteger, ''); wc.AddProperty('FontDesc',TPropertyFontDesc, ''); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('ScrollWheelDelta', TPropertyInteger, 'Scroll amount with mouse wheel'); wc.AddProperty('ShowColumns',TPropertyBoolean, 'Boolean value'); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowImages',TPropertyBoolean, 'Boolean value'); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); wc.AddProperty('TreeLineStyle', TPropertyEnum, ''); @@ -415,6 +448,8 @@ begin wc := TVFDWidgetClass.Create(TfpgPageControl); wc.NameBase := 'pcName'; wc.AddProperty('FixedTabWidth', TPropertyInteger, ''); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('SortPages', TPropertyBoolean, 'Boolean value'); wc.AddProperty('Style', TPropertyEnum, ''); wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order'); @@ -428,7 +463,9 @@ begin wc.AddProperty('Kind', TPropertyEnum, ''); wc.AddProperty('MinValue', TPropertyInteger, ''); wc.AddProperty('MaxValue', TPropertyInteger, ''); + wc.AddProperty('ParentShowHint', TPropertyBoolean, ''); wc.AddProperty('Progress', TPropertyInteger, ''); + wc.AddProperty('ShowHint', TPropertyBoolean, ''); wc.AddProperty('ShowText', TPropertyBoolean, 'Boolean value'); wc.WidgetIconName := 'vfd.gauge'; RegisterVFDWidget(wc); |