diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-08-26 16:47:53 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-08-26 16:47:53 +0000 |
commit | 483eda5909cf21a06f3011857a12f47ae676ffef (patch) | |
tree | eb8bf9cc2e6a6a02e7ea79db1540a7c48d7dc827 /uidesigner/vfdutils.pas | |
parent | a88f8e00c7094d32411871d3993654f326563e3b (diff) | |
download | fpGUI-483eda5909cf21a06f3011857a12f47ae676ffef.tar.xz |
* Moved the UI Designer from the examples/apps directory to the root directory.
* Updated some build scripts
Diffstat (limited to 'uidesigner/vfdutils.pas')
-rw-r--r-- | uidesigner/vfdutils.pas | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/uidesigner/vfdutils.pas b/uidesigner/vfdutils.pas new file mode 100644 index 00000000..90b99841 --- /dev/null +++ b/uidesigner/vfdutils.pas @@ -0,0 +1,82 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + Some utility functions. +} + +unit vfdutils; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, + SysUtils, + gfx_widget, + gui_form, + gui_label, + gui_edit, + gui_button, + gui_memo, + gui_checkbox; + + +procedure SetWidgetText(wg: TfpgWidget; txt: string); +function GetWidgetText(wg: TfpgWidget; out txt: string): boolean; + + +implementation + +procedure SetWidgetText(wg: TfpgWidget; txt: string); +begin + if wg is TfpgForm then + TfpgForm(wg).WindowTitle := txt + else if wg is TfpgLabel then + TfpgLabel(wg).Text := txt + else if wg is TfpgEdit then + TfpgEdit(wg).Text := txt + else if wg is TfpgMemo then + TfpgMemo(wg).Text := txt + else if wg is TfpgButton then + TfpgButton(wg).Text := txt + else if wg is TfpgCheckBox then + TfpgCheckBox(wg).Text := txt; +end; + +function GetWidgetText(wg: TfpgWidget; out txt: string): boolean; +begin + Result := True; + if wg is TfpgForm then + txt := TfpgForm(wg).WindowTitle + else if wg is TfpgLabel then + txt := TfpgLabel(wg).Text + else if wg is TfpgEdit then + txt := TfpgEdit(wg).Text + else if wg is TfpgMemo then + txt := TfpgMemo(wg).Text + else if wg is TfpgButton then + txt := TfpgButton(wg).Text + else if wg is TfpgCheckBox then + txt := TfpgCheckBox(wg).Text + else + begin + Result := False; + txt := ''; + end; +end; + + +end. + |