From e02617665edc4942e2f766ebde3ec00abf5b6efb Mon Sep 17 00:00:00 2001 From: rafaelhlima Date: Wed, 10 Aug 2022 14:53:57 -0300 Subject: [PATCH] Make the OK button the deafault when Enter is pressed --- Source/RemoveBlankCells/RBDlg_Impl.xba | 7 +++++-- Source/RemoveBlankCells/RBL10n.xba | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/RemoveBlankCells/RBDlg_Impl.xba b/Source/RemoveBlankCells/RBDlg_Impl.xba index d003686..934a391 100644 --- a/Source/RemoveBlankCells/RBDlg_Impl.xba +++ b/Source/RemoveBlankCells/RBDlg_Impl.xba @@ -54,6 +54,9 @@ Sub RBDlg_Show oDlgModel.getByName("opRemoveColumnsByRow").Enabled = False oDlgModel.getByName("labAdvanced").Enabled = False End If + 'Sets the OK button as the default button + oDlgModel.getByName("btnOK").DefaultButton = True + oDlgModel.getByName("btnOK").PushButtonType = com.sun.star.awt.PushButtonType.STANDARD 'Centers de dialog RBMain.CenterDialog(oRBDlg) 'Show the dialog @@ -142,7 +145,7 @@ Sub RBDlg_OK_Click End If 'Warn user that this operation may remove existing data bProcede = MsgBox(glb_L10N._("WarningDeleteRows") & Chr(13) & glb_L10N._("WarningProceed"), _ - MB_YESNO + MB_ICONEXCLAMATION, Title := glb_L10N._("Warning") + MB_YESNO + MB_ICONEXCLAMATION, Title := glb_L10N._("Warning")) If bProcede = IDNO Then Exit Sub 'Check which mode to run (fast/normal) If bCheckFastMode Then @@ -168,7 +171,7 @@ Sub RBDlg_OK_Click End If 'Warn user that this operation may remove existing data bProcede = MsgBox(glb_L10N._("WarningDeleteColumns") & Chr(13) & glb_L10N._("WarningProceed"), _ - MB_YESNO + MB_ICONEXCLAMATION, Title := glb_L10N._("Warning") + MB_YESNO + MB_ICONEXCLAMATION, Title := glb_L10N._("Warning")) If bProcede = IDNO Then Exit Sub 'Check which mode to run (fast/normal) If bCheckFastMode Then diff --git a/Source/RemoveBlankCells/RBL10n.xba b/Source/RemoveBlankCells/RBL10n.xba index 9889ced..bd3108c 100644 --- a/Source/RemoveBlankCells/RBL10n.xba +++ b/Source/RemoveBlankCells/RBL10n.xba @@ -159,4 +159,4 @@ Sub ShowPathToPO() MsgBox pathToPO End Sub - + \ No newline at end of file