[Coming soon] GLBasic WinApi menu... Wow... :)

Previous topic - Next topic

Schranz0r

Simple and short:

Screenshot:



Code:
Code (glbasic) Select

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]
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Schranz0r

#1
If i can yes...
But i have some trouble with SHOWSCREEN it dispatch all my events...

This code works fine:

Code (glbasic) Select
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 :)
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Quentin

hehe coole Sache das, Schranzor  :good:

Hast den Petzold als Hilfe?

Schon mal mit ShowWindow() und UpdateWindow() probiert anstatt SHOWSCREEN?

Schranz0r

#3
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!
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Kitty Hello

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.

Schranz0r

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?
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Kitty Hello

Korrekt. Der war bei den Keyboard messages drin, damit man beim langen draufbleiben auf einer Taste kein Beeeeeeeep h?rt.

Schranz0r

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!
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

FutureCow

Schranz0r - looking forward to this!
Can you post some English updates?

Schranz0r

I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Hemlos

Sweet, Looking forward to this stuff, goodluck buddy!  :good:
Bing ChatGpt is pretty smart :O

Schranz0r

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


Have fun

P.S.: I need help to wrapp the full GUI ;)



[attachment deleted by admin]
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Kitty Hello

Schranz0r, with the new IMPORT, it should be possible to wrap the API w/o the headers even.

Schranz0r

No, i need all datatypes to wrapp all the stuff.
Now i can simply include windows.h, and i use it ;)
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Hemlos

I unpacked the headers into the compiler directory,
but i still cant get it to compile, it says file not found in editor.
Bing ChatGpt is pretty smart :O