diff options
Diffstat (limited to 'docview/src/frm_main.pas')
-rw-r--r-- | docview/src/frm_main.pas | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 802c3600..00a192ea 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -2,9 +2,16 @@ unit frm_main; {$mode objfpc}{$H+} +{$IFDEF WINDOWS} + {$define ABOUT_SYSMENU} +{$ENDIF} + interface uses + {$IFDEF ABOUT_SYSMENU} + Windows, // Used for HMENU to add a new menu to the window System Menu. This feature is just for fun. + {$ENDIF} SysUtils, Classes, fpg_base, fpg_main, fpg_form, fpg_panel, fpg_tab, fpg_tree, fpg_splitter, fpg_menu, fpg_button, fpg_listbox, fpg_label, fpg_edit, fpg_radiobutton, fpg_progressbar, fpg_imagelist, @@ -202,6 +209,7 @@ type // Used in loading contents procedure AddChildNodes(AHelpFile: THelpFile; AParentNode: TfpgTreeNode; ALevel: longint; var ATopicIndex: longint ); procedure ClearIndexComponents; + procedure ProcessAboutMsg(var Msg: TfpgMessageRec); message FPGM_ABOUT; // Note manipulations -------------------------------- // make sure that note insert positions are not in @@ -634,6 +642,11 @@ end; procedure TMainForm.MainFormShow(Sender: TObject); var lFilename: TfpgString; + {$IFDEF ABOUT_SYSMENU} + hSysMenu: HMENU; +const + ID_ABOUT = 200001; // Must match the definition in fpg_gdi.pas + {$ENDIF} begin bvlBody.Realign; @@ -660,6 +673,12 @@ begin OpenFile(lFilename, '', true); end; end; + // This is just for fun! ;-) + {$IFDEF ABOUT_SYSMENU} + hSysMenu := GetSystemMenu(self.WinHandle, false); + AppendMenu(hSysMenu, MF_SEPARATOR, 0, nil); + AppendMenu(hSysMenu, MF_STRING, ID_ABOUT, PChar('&About fpGUI Toolkit...')); + {$ENDIF} end; procedure TMainForm.MainFormDestroy(Sender: TObject); @@ -889,7 +908,7 @@ end; procedure TMainForm.miToolsShowEnvVariablesClicked(Sender: TObject); function LGetEnvVarValue(const AVariable: string): string; begin - Result := Format('%s = ''%s''', [AVariable, GetEnvironmentVariable(AVariable)]); + Result := Format('%s = ''%s''', [AVariable, SysUtils.GetEnvironmentVariable(AVariable)]); end; begin RichView.Clear; @@ -2223,6 +2242,11 @@ begin IndexLoaded := False; end; +procedure TMainForm.ProcessAboutMsg(var Msg: TfpgMessageRec); +begin + TfpgMessageDialog.AboutFPGui; +end; + procedure TMainForm.CorrectNotesPositions(Topic: TTopic; AText: pchar); var NoteIndex: longint; @@ -2724,7 +2748,6 @@ begin img := CreateImage_BMP(@dv_missing, sizeof(dv_missing)); FImages.AddImage(img); - // load toolbar images fpgImages.AddMaskedBMP( 'dv.arrowleft', @usr_arrow_left, |