wedgesan wrote:
I'm using a custom class to deal with database management, and in order to handle errors i'm calling a method that opens a dialog box.
Class DDBBManagement
sub MyMethodToCallDialogBox (<several parameters here>)
code to open a DialogBox
I've also coded a custom dialog box. It does nothing fancy, just a little prettier than the standard dialog box.
In order to use it with my custom database class, I've subclassed it, and overrided the dialog method:
Class DDBBManagementEnhanced subclass of DDBBManagement
sub MyMethodToCallDialogBox (<several parameters here>)
code to open my Custom dialog box
It works, but I wonder if there's a more elegant way to achieve this. Any ideas?
Thank you very much. Best regards.
In the RSDS Library (Download) I believe there are 6-7 custom dialogs...load the software, choose "snippet" for category, enter "dialog" in the search field, and press enter
Here is a copy paste example from the library...
1. make a global method called MessageDialog in your APP class
2. Call it anywhere you like in your app
App.MessageDialog(App.ExecutableFile.Name,"Error: Testing Msg....","Msg Tested",1,"","", False)
Sub MessageDialog(Title As String, Message As String , Explanation As String , GraphicIcon As Integer , ActionCaption As String ="OK" , CancelCaption As String ="Cancel", CancelButton As Boolean)
'0 - GraphicNote (The application icon on Mac OS X)
'1 - GraphicCaution triangle (On Mac OS X, the application icon superimposed on the caution triangle)
'2 - GraphicStop (On Mac OS X 10.3 and above, the application icon)
'3 - GraphicQuestion icon (On Mac OS X 10.3 and above, it is the same as 0)
Dim d as New MessageDialog
Dim b as MessageDialogButton
d.icon= GraphicIcon
d.Title = Title
d.ActionButton.Caption = ActionCaption
d.CancelButton.Caption= CancelCaption
d.CancelButton.Visible = CancelButton
d.Message=Message
d.Explanation=Explanation
b=d.ShowModal
'You can use the return type as a boolean or a string to see what the user pressed
Select Case b
Case d.ActionButton
Speak "You Pressed OK"
Case d.CancelButton
Speak "You Pressed Cancel"
End Select
End Sub