Author Topic: [Coming soon] GLBasic WinApi menu... Wow... :)  (Read 11168 times)

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4971
  • O Rly?
    • View Profile
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]
« Last Edit: 2009-May-27 by Schranz0r »
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4971
  • O Rly?
    • View Profile
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&#39;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 :)
« Last Edit: 2009-May-27 by Schranz0r »
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Quentin

  • Prof. Inline
  • *****
  • Posts: 899
    • View Profile
hehe coole Sache das, Schranzor  :good:

Hast den Petzold als Hilfe?

Schon mal mit ShowWindow() und UpdateWindow() probiert anstatt SHOWSCREEN?
« Last Edit: 2009-May-27 by Quentin »

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4971
  • O Rly?
    • View Profile
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!
« Last Edit: 2009-May-28 by Schranz0r »
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10661
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
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.

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4971
  • O Rly?
    • View Profile
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 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10661
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Korrekt. Der war bei den Keyboard messages drin, damit man beim langen draufbleiben auf einer Taste kein Beeeeeeeep h?rt.

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4971
  • O Rly?
    • View Profile
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 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline FutureCow

  • HelpEditor
  • Prof. Inline
  • ******
  • Posts: 680
    • View Profile
Schranz0r - looking forward to this!
Can you post some English updates?

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4971
  • O Rly?
    • View Profile
If it work, yes ;)
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1579
  • Particle Hawk
    • View Profile
Re: [Coming soon] GLBasic WinApi menu... Wow... :)
« Reply #10 on: 2009-May-30 »
Sweet, Looking forward to this stuff, goodluck buddy!  :good:
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4971
  • O Rly?
    • View Profile
Re: [Coming soon] GLBasic WinApi menu... Wow... :)
« Reply #11 on: 2009-Aug-07 »
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 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10661
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: [Coming soon] GLBasic WinApi menu... Wow... :)
« Reply #12 on: 2009-Aug-07 »
Schranz0r, with the new IMPORT, it should be possible to wrap the API w/o the headers even.

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4971
  • O Rly?
    • View Profile
Re: [Coming soon] GLBasic WinApi menu... Wow... :)
« Reply #13 on: 2009-Aug-07 »
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 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1579
  • Particle Hawk
    • View Profile
Re: [Coming soon] GLBasic WinApi menu... Wow... :)
« Reply #14 on: 2009-Aug-09 »
I unpacked the headers into the compiler directory,
but i still cant get it to compile, it says file not found in editor.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)