Another small plugin that gives you the standard win32 FILE selector, COLOR selector and a FONT selector.
As usual, the .dll file goes into your compiler/plugins-user folder.
And the .ini file goes into your editor/keywords folder.
This plugin took a long time in the creation and had a few bugs to iron out but with the brilliant help from IanM looking over my code and Resourceful for creating the first documentation for it, oh and the kick up the backside to get it working from a few people, I finally got it done.
The docs: (also in the attached download)
Destructions:
flag = W32 FSEL()
String = W32 GETCURRENTDIRECTORY()
\\COMM W32 SETCURRENTDIRECTORY dir$
string = W32 GETRELATIVEFILENAME(currdir$,absfile$)
result = W32 MESSAGEBOX(message$,title$,type)
\\COMM W32 FILEFILTERS filter$
\\COMM W32 FILEFLAGS flags
file$ = W32 GETPATH()
flag = W32 COLORSELECT()
rgb = W32 COLORSELECTRGB()
flag = W32 FONTSELECT()
hgt = W32 FONTHEIGHT()
wgt = W32 FONTWEIGHT()
ita = W32 FONTITALIC()
font$ = W32 FONTNAME()
MESSAGE BOX NOTES:
Flags:
MB_ABORTRETRYIGNORE 0x00000002L
MB_CANCELTRYCONTINUE 0x00000006L
MB_HELP 0x00004000L
MB_OK 0x00000000L
MB_OKCANCEL 0x00000001L
MB_RETRYCANCEL 0x00000005L
MB_YESNO 0x00000004L
MB_YESNOCANCEL 0x00000003L
MB_ICONEXCLAMATION 0x00000030L
MB_ICONWARNING 0x00000030L
MB_ICONINFORMATION 0x00000040L
MB_ICONASTERISK 0x00000040L
MB_ICONQUESTION 0x00000020L
MB_ICONSTOP 0x00000010L
MB_ICONERROR 0x00000010L
MB_ICONHAND 0x00000010L
Return code/value Description
IDABORT 3 The Abort button was selected.
IDCANCEL 2 The Cancel button was selected.
IDCONTINUE 11 The Continue button was selected.
IDIGNORE 5 The Ignore button was selected.
IDNO 7 The No button was selected.
IDOK 1 The OK button was selected.
IDRETRY 4 The Retry button was selected.
IDTRYAGAIN 10 The Try Again button was selected.
IDYES 6 The Yes button was selected
FILE SELECTOR NOTES:
OFN_ENABLESIZING 0x00800000
Enables the Explorer-style dialog box to be resized using either the mouse or the keyboard. By default, the Explorer-style Open and Save As dialog boxes allow the dialog box to be resized regardless of whether this flag is set. This flag is necessary only if you provide a hook procedure or custom template. The old-style dialog box does not permit resizing.
OFN_FILEMUSTEXIST 0x00001000
The user can type only names of existing files in the File Name entry field. If this flag is specified and the user enters an invalid name, the dialog box procedure displays a warning in a message box. If this flag is specified, the OFN_PATHMUSTEXIST flag is also used. This flag can be used in an Open dialog box. It cannot be used with a Save As dialog box.
OFN_NOCHANGEDIR 0x00000008
Restores the current directory to its original value if the user changed the directory while searching for files.
This flag is ineffective for GetOpenFileName.
OFN_NONETWORKBUTTON 0x00020000
Hides and disables the Network button.
OFN_PATHMUSTEXIST 0x00000800
The user can type only valid paths and file names. If this flag is used and the user types an invalid path and file name in the File Name entry field, the dialog box function displays a warning in a message box.
OFN_READONLY 0x00000001
Causes the Read Only check box to be selected initially when the dialog box is created. This flag indicates the state of the Read Only check box when the dialog box is closed.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646839(v=vs.85).aspx
INI FILE:
Destructions:
W32 FSEL==int flag = W32 FSEL()
W32 GETCURRENTDIRECTORY==String dir$ = W32 GETCURRENTDIRECTORY()
W32 SETCURRENTDIRECTORY = W32 SETCURRENTDIRECTORY dir$
W32 GETRELATIVEFILENAME==string = W32 GETRELATIVEFILENAME(currdir$,absfile$)
W32 MESSAGEBOX==result = W32 MESSAGEBOX(message$,title$,type)
W32 FILEFILTERS==W32 FILEFILTERS filter$
W32 FILEFLAGS==W32 FILEFLAGS flags
W32 GETPATH==file$ = W32 GETPATH()
W32 COLORSELECT==flag = W32 COLORSELECT()
W32 COLORSELECTRGB==rgb = W32 COLORSELECTRGB()
W32 FONTSELECT==flag = W32 FONTSELECT()
W32 FONTHEIGHT==hgt = W32 FONTHEIGHT()
W32 FONTWEIGHT==wgt = W32 FONTWEIGHT()
W32 FONTITALIC==ita = W32 FONTITALIC()
W32 FONTNAME==font$ = W32 FONTNAME()
There\'s two things I am aware of that I need to do:
1. Create a Save / Load separate dialogues
2. Work out the formula to convert the fonts height into pixels for DBP to use properly. (fixed)
As again I hope this comes in handy. And I doubt that I will ever get round to working with a GUI system for DBP after the trouble I had with this, but then again, there\'s lots of very good GUI already out there...
Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!