diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-07-12 20:48:25 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-07-12 20:48:25 +0200 |
commit | 0a465fccd946b2632336af4f27adc1fe9437176a (patch) | |
tree | 8e786628b1519d6203443c8a00f484bce62560a9 | |
parent | bf484450bf675e209c78dbbaef9d81503530e9a4 (diff) | |
download | fpGUI-0a465fccd946b2632336af4f27adc1fe9437176a.tar.xz |
uidesigner: extra checks and minor code improvements
-rw-r--r-- | uidesigner/newformdesigner.pas | 1 | ||||
-rw-r--r-- | uidesigner/vfdmain.pas | 12 |
2 files changed, 8 insertions, 5 deletions
diff --git a/uidesigner/newformdesigner.pas b/uidesigner/newformdesigner.pas index 7b3365be..cf6485df 100644 --- a/uidesigner/newformdesigner.pas +++ b/uidesigner/newformdesigner.pas @@ -452,6 +452,7 @@ begin {@VFD_BODY_END: frmMain} {%endregion} + { Build component palette } x := 0; y := 0; for n := 0 to VFDWidgetCount-1 do diff --git a/uidesigner/vfdmain.pas b/uidesigner/vfdmain.pas index 38af725a..a246db55 100644 --- a/uidesigner/vfdmain.pas +++ b/uidesigner/vfdmain.pas @@ -179,9 +179,8 @@ var begin fname := EditedFileName; - if ((Sender as TComponent).Tag = 10) - and (EditedFileName <> '') then - fname := EditedFileName + if ((Sender as TComponent).Tag = 10) and (EditedFileName <> '') then + fname := EditedFileName else begin afiledialog := TfpgFileDialog.Create(nil); @@ -196,7 +195,7 @@ begin EditedFileName := fname; end else - fname := ''; + fname := ''; aFileDialog.Free; end; @@ -212,7 +211,7 @@ begin end else begin - uname := ExtractFileName(fname); + uname := fpgExtractFileName(fname); i := pos('.pas', LowerCase(uname)); if i > 0 then uname := copy(uname, 1, i - 1); @@ -221,7 +220,10 @@ begin for n := 0 to DesignerCount-1 do begin + fd := nil; fd := Designer(n); + if fd = nil then + raise Exception.Create('Failed to find Designer Form'); FFile.SetFormData(fd.Form.Name, fd.GetFormSourceDecl, fd.GetFormSourceImpl); end; |