Simple and short:
Screenshot:
(http://www.glbasic.com/forum/index.php?action=dlattach;topic=3059.0;attach=556;image)
Code:
LOCAL WM_LBUTTONDOWN = 0x0201
LOCAL WM_RBUTTONDOWN = 0x0204
LOCAL WM_COMMAND = 0x0111
// Create a Mainmenu and Submenus(popupmenus)
MainMenu = Menu_CreateMenu() // Mainmenu
FileMenu = Menu_CreateMenu() // Popupmenu "FileMenu"
OpenMenu = Menu_CreateMenu() // Popupmenu "OpenMenu"
// Menu ID's ... you can make what you want ;)
ID_Menu = 100
ID_Save = 110
ID_Open = 120
ID_LoadFile = 121
ID_OpenProj = 122
ID_Exit = 101
Menu_InsertMenu(MainMenu,ID_Menu,FileMenu,"File") // Set Mainmenu and insert a popup filemenu
Menu_AppendMenu(FileMenu,ID_Save,"Save") // Add "save" to filemenu
Menu_AppendSeperator(FileMenu) // create a seperrator(filemenu)
Menu_InsertMenu(FileMenu,ID_Open,OpenMenu,"Open") // insert popup openmenu
Menu_AppendMenu(OpenMenu,ID_LoadFile,"Load file") // Add "Load file" to openmenu
Menu_AppendMenu(OpenMenu,ID_OpenProj,"Load project") // Add "Load project" to openmenu
Menu_AppendSeperator(FileMenu) // create a seperrator(filemenu)
Menu_AppendMenu(FileMenu,ID_Exit,"Exit") // Add "Exit" to filemenu
Menu_SetMenu(MainMenu) // Set Menu "Mainmenu" to GLBasic
WHILE TRUE
// Other stuff coming soon!
SHOWSCREEN
WEND
END
[attachment deleted by admin]
If i can yes...
But i have some trouble with SHOWSCREEN it dispatch all my events...
This code works fine:
LOCAL WM_LBUTTONDOWN = 0x0201
LOCAL WM_RBUTTONDOWN = 0x0204
LOCAL WM_COMMAND = 0x0111
// Create a Mainmenu and Submenus(popupmenus)
MainMenu = Menu_CreateMenu() // Mainmenu
FileMenu = Menu_CreateMenu() // Popupmenu "FileMenu"
OpenMenu = Menu_CreateMenu() // Popupmenu "OpenMenu"
// Menu ID's ... you can make what you want ;)
ID_Menu = 100
ID_Save = 110
ID_Open = 120
ID_LoadFile = 121
ID_OpenProj = 122
ID_Exit = 101
Menu_InsertMenu(MainMenu,ID_Menu,FileMenu,"File") // Set Mainmenu and insert a popup filemenu
Menu_AppendMenu(FileMenu,ID_Save,"Save") // Add "save" to filemenu
Menu_AppendSeperator(FileMenu) // create a seperrator(filemenu)
Menu_InsertMenu(FileMenu,ID_Open,OpenMenu,"Open") // insert popup openmenu
Menu_AppendMenu(OpenMenu,ID_LoadFile,"Load file") // Add "Load file" to openmenu
Menu_AppendMenu(OpenMenu,ID_OpenProj,"Load project") // Add "Load project" to openmenu
Menu_AppendSeperator(FileMenu) // create a seperrator(filemenu)
Menu_AppendMenu(FileMenu,ID_Exit,"Exit") // Add "Exit" to filemenu
Menu_SetMenu(MainMenu) // Set Menu "Mainmenu" to GLBasic
WHILE TRUE
WHILE Peekmessage()
GLBmsg = ReciveMessage()
SELECT GLBmsg
CASE WM_COMMAND
SELECT GetWParam()
CASE ID_Exit
END
ENDSELECT
DEFAULT
DispatchMessage()
ENDSELECT
WEND
//SHOWSCREEN
WEND
END
I can move the window, navigate on the menu and can close the window with the menuentry "Exit"
But the GLBasicstuff freeze :/ ( no SHOWSCREEEN)
If i place SHOWSCREEN, then SHOWSCREEN dispatch all my messages... it sucks :)
hehe coole Sache das, Schranzor :good:
Hast den Petzold als Hilfe?
Schon mal mit ShowWindow() und UpdateWindow() probiert anstatt SHOWSCREEN?
Quote from: Quentin on 2009-May-27
hehe coole Sache das, Schranzor :good:
Hast den Petzold als Hilfe?
Schon mal mit ShowWindow() und UpdateWindow() probiert anstatt SHOWSCREEN?
Das wird nix bringen, weil der das ja alles "updatet" bis auf den GLB-Buffer
Wer oder was ist Petzold? :D
Alles von mir selber zusammen gesucht :)
@ Ocean:
Ja da schau ich mal, geb dan R?ckmeldung :D
EDIT:
Ney, geht nicht... Schade!
Oh! Shranzor, ich hab's gefunden. Meine Tastaturabfrage hat PeekMessage f?r alle Fenster gemacht. In Version 7 wird's gel?st sein. Ich schick dir zum Wochenende eine Beta.
Hey Gernot :)
Mir kommts so vor, als w?r irgendwo ein while(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {...} w?r?!
Also das der alle Messages pl?ttet... kann das sein?
Korrekt. Der war bei den Keyboard messages drin, damit man beim langen draufbleiben auf einer Taste kein Beeeeeeeep h?rt.
Kannst doch "nur" WM_KEYDOWN oder WM_INPUT abfragen? :D
Oder unter was l?uft das?
Ach, dann hat mein "bis jetzt nur" Menu ja auch was gutes :)
Jetzt kann man dann ordentlich mit PeekMessage arbeiten :P
Danke f?rs nachgucken Gernot!
Schranz0r - looking forward to this!
Can you post some English updates?
If it work, yes ;)
Sweet, Looking forward to this stuff, goodluck buddy! :good:
it work now :) (with the RC2 of GLBasic!)
Without a DLL :P
You need the Headerpack from the mainpage: http://www.glbasic.com/files/headers.rar
Unpack to: ...GLBasic\Compiler\
Now you need that project: PROJECT (http://www.glbasic.com/forum/index.php?action=dlattach;topic=3059.0;attach=698)
Have fun
P.S.: I need help to wrapp the full GUI ;)
[attachment deleted by admin]
Schranz0r, with the new IMPORT, it should be possible to wrap the API w/o the headers even.
No, i need all datatypes to wrapp all the stuff.
Now i can simply include windows.h, and i use it ;)
I unpacked the headers into the compiler directory,
but i still cant get it to compile, it says file not found in editor.
headers.rar is unpacked in E:\Program Files\GLBasic\Compiler
What else needs to be done?
K i had to redownload the headers...first round didnt work for some reason.
Schranz0r, here is a help messgae popup box...the popupflag=32 is the help icon type.
If you roll the flag number and post it to the screen, you can see all the different types of popup menus.
The flags can make also the kind that says "ignore" "continue" etc with the red x icon blah blah..
popupflag=32
IMPORT "C" int __stdcall MessageBoxA(int hwnd, const char* text, char* caption, int flags)
MessageBoxA(0, " This is another line.\n this is another line\n ", "Help",popupflag)
Yeah i know that :)
Hey i found a bug with this..
In a windowed mode program, the mousestate and systempointer are not aligned.
This is what i have to do to correct the difference:
MOUSESTATE MX,MY,MB1,MB2
MY=MY+20
In fullscreen, there is no menu.
Also in fullscreen, the mouse is correct.
Any idea how to fix this?
hmmm :S
In fullscreen, no menu, but the mouse is aligned properly.
Its not a big deal, ill just shift everything down.
Would be nice to use this in fullscreen mode though.
dosent work on fullscreen!
Its a Window-Feature ;)