abdd0a0866
* NEW: Start assigning actions to everything. * NEW: Action shortcuts can be configured. * NEW: Project actions are automatically saved in the .action directory. * BUG: Signature of native arrays is correct now. [INTERPRETER] * BUG: GB_LoadFile() does not leak file descriptors anymore. * NEW: Relative paths starting with "../" allows to open files located in the main archive from a component. [ARCHIVER] * NEW: Store the ".action" directory in the archive. [GB.DB] * BUG: Correctly check that table name are not void in Create(), Find(), Edit() and Delete() methods. [GB.FORM] * NEW: A new stock icon named "shortcut". Mmm... Should be named "keyboard". [GB.FORM.MDI] * NEW: Support for automatic configuration of action shortcuts. * NEW: Action.Configure() is a new method that opens a dialog for configuring shortcuts. Shortcut configuration is stored in the application setting files, under the '[gb.form.mdi/Shortcuts]' slot. [GB.QT] * NEW: Action[].Shortcut is a new property for setting or getting the shortcut of an action. * BUG: Correctly opens startup forms again. git-svn-id: svn://localhost/gambas/trunk@1758 867c0c6c-44f3-4631-809d-bfa615b0a4ec
83 lines
1.4 KiB
Plaintext
83 lines
1.4 KiB
Plaintext
' Gambas class file
|
|
|
|
Private $cAction As Collection
|
|
Private $aAction As String[]
|
|
|
|
Public Sub Run(cAction As Collection) As Boolean
|
|
|
|
$cAction = cAction
|
|
Return Not Me.ShowModal()
|
|
|
|
End
|
|
|
|
Public Sub Form_Open()
|
|
|
|
Dim iInd As Integer
|
|
Dim hAction As CAction
|
|
|
|
$aAction = Action.List
|
|
|
|
gvwShortcut.Rows.Count = $aAction.Count
|
|
gvwShortcut.Columns.Count = 2
|
|
gvwShortcut.Columns[0].Text = ("Action")
|
|
gvwShortcut.Columns[1].Text = ("Shortcut")
|
|
|
|
For iInd = 0 To $aAction.Max
|
|
|
|
hAction = $cAction[$aAction[iInd]]
|
|
|
|
gvwShortcut[iInd, 0].Text = hAction.Text
|
|
gvwShortcut[iInd, 0].Padding = 2
|
|
gvwShortcut[iInd, 0].Picture = hAction.Icon
|
|
gvwShortcut[iInd, 1].Text = hAction.Shortcut
|
|
gvwShortcut[iInd, 1].Padding = 2
|
|
|
|
Next
|
|
|
|
gvwShortcut.Columns[0].Width = -1
|
|
gvwShortcut.Rows.Height = -1
|
|
gvwShortcut.Rows.Height += 4
|
|
|
|
End
|
|
|
|
Public Sub btnCancel_Click()
|
|
|
|
Me.Close
|
|
|
|
End
|
|
|
|
Public Sub btnOK_Click()
|
|
|
|
SaveShortcut
|
|
Me.Close(True)
|
|
|
|
End
|
|
|
|
Public Sub btnChange_Click()
|
|
|
|
gvwShortcut_Activate
|
|
|
|
End
|
|
|
|
Public Sub gvwShortcut_Activate()
|
|
|
|
Dim sAction As String = $aAction[gvwShortcut.Row]
|
|
|
|
If FShortcutEdit.Run($cAction, sAction) Then Return
|
|
|
|
gvwShortcut[gvwShortcut.Row, 1].Text = $cAction[sAction].Shortcut
|
|
|
|
End
|
|
|
|
Private Sub SaveShortcut()
|
|
|
|
Dim hAction As CAction
|
|
Dim sKey As String
|
|
|
|
For Each hAction In $cAction
|
|
hAction.Save
|
|
Next
|
|
Settings.Save
|
|
|
|
End
|