Skip to content

Commit

Permalink
Make the OK button the deafault when Enter is pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelhlima committed Aug 10, 2022
1 parent 84955ae commit e026176
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Source/RemoveBlankCells/RBDlg_Impl.xba
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Source/RemoveBlankCells/RBL10n.xba
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ Sub ShowPathToPO()
MsgBox pathToPO
End Sub

</script:module>
</script:module>

0 comments on commit e026176

Please sign in to comment.