diff options
Diffstat (limited to 'UGnome.pas')
| -rw-r--r-- | UGnome.pas | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -144,7 +144,7 @@ type TGnomeColorButton = class(TGTKButton) -function MessageBoxShowOnce(const Text: string; const DontShowAgainText: string; var DontShowAgainChecked: boolean; +function MessageBoxShowOnce(ParentWindow: PGtkWindow; const Text: string; const DontShowAgainText: string; var DontShowAgainChecked: boolean; Buttons: TMessageButtons = [mbOK]; Style: TMessageStyle = mbInfo; Default: TMessageButton = mbNone; Escape: TMessageButton = mbNone): TMessageButton; @@ -1191,12 +1191,11 @@ begin end; end; -function MessageBoxShowOnce(const Text: string; const DontShowAgainText: string; var DontShowAgainChecked: boolean; +function MessageBoxShowOnce(ParentWindow: PGtkWindow; const Text: string; const DontShowAgainText: string; var DontShowAgainChecked: boolean; Buttons: TMessageButtons = [mbOK]; Style: TMessageStyle = mbInfo; Default: TMessageButton = mbNone; Escape: TMessageButton = mbNone): TMessageButton; const TMessageStyleID : array[0..3] of TGtkMessageType = (GTK_MESSAGE_ERROR, GTK_MESSAGE_INFO, GTK_MESSAGE_QUESTION, GTK_MESSAGE_WARNING); var Dialog: PGtkWidget; - DialogParent: PGtkWindow; CheckBox: PGtkCheckButton; i: integer; begin @@ -1205,10 +1204,7 @@ begin Result := Escape; Exit; end; - if Screen.FormCount > 0 - then DialogParent := PGtkWindow(Screen.Forms[0].FWidget) - else DialogParent := nil; - Dialog := gtk_message_dialog_new(DialogParent, GTK_DIALOG_MODAL or GTK_DIALOG_DESTROY_WITH_PARENT, TMessageStyleID[Integer(Style)], + Dialog := gtk_message_dialog_new(ParentWindow, GTK_DIALOG_MODAL or GTK_DIALOG_DESTROY_WITH_PARENT, TMessageStyleID[Integer(Style)], GTK_BUTTONS_NONE, StringToPgchar(Text)); CheckBox := PGtkCheckButton(gtk_check_button_new_with_mnemonic(StringToPgchar(DontShowAgainText))); gtk_widget_show(PGtkWidget(CheckBox)); |
