Impressions of the GUI module

BlitzMax Forums/BlitzMax Programming/Impressions of the GUI module

JoshK(Posted 2005) [#1]
Good:
-I was glad to see that trackbar controls made it in, as a variation of a "slider".
-Comboboxes have an "editable" style, which is a big plus.
-Windows have a "hidden" flag, another good improvement.
-Much better menu commands thatn BlitzPlus.
-Having a GadgetPaint() event is very good.

Needs work:
-No toggle button. Ouch.
-No image button.
-Combobox drop-down heights still can't be altered, nor can the control height (which is easy to do with Windows API).
-Listboxes don't have a FullRowSelect flag, and can't have columns or checkboxes.
-No StatusBar fields. (sounds like this has been fixed already)
-Bug in toolbar routine spaces toolbar buttons further and further each time a separator is encountered. This can even be seen in the IDE.

The GUI module is moving in the right direction, and makes several major improvements to the BlitzPlus GUI. Hopefully it will continue to develop. I'm not getting BlitzMax yet, but am keeping an eye on it to see how it develops in the near future.


EOF(Posted 2005) [#2]
+ I much prefer the OOP nature which is on offer now.
So, instead of:
mygadget=CreateGadget(blah)
..
FreeGadget mygadget

I can do:
mygadget:TGadget=CreateGadget(blah)
..
mygadget.Free


+ I also like the much easier to remember official constants such as EVENT_WINDOWCLOSE. Beats $4000 or whatever it was.

+ Another biggie is tabbing between gadgets which is now in place. No more beeps like what happened in BlitzPlus.

- I agree with your comments about 'no toggle buttons' and 'no statusbar fields'. I hope to see them added in later.


The greatest achievement though, is the fact that you can drop your BlitzPlus code straight into max (with minor modifications).


Beaker(Posted 2005) [#3]
Image button (and toggle button) code:



JoshK(Posted 2005) [#4]
That's not a button.


Wiebo(Posted 2005) [#5]
There isn't even a button appearing when i run it :\


Beaker(Posted 2005) [#6]
You might need some images.


JoshK(Posted 2005) [#7]
It still isn't a button, it's just an image being switched around.


Mark Tiffany(Posted 2005) [#8]
Like these naff ones that I used in tweaking Beaker's code...



Note that this is probably best viewed as a demo of how you can roll your own gadgets, not as a full blown web style image button thing to abuse like any other built in gadget.


JoshK(Posted 2005) [#9]
Thanks. I wasn't aware it was possible to draw an image on the screen. Your contribution to this discussion of windows controls has been relevant and helpful. Whereas I pointed out that a certain type of control is not supported, you responded by posting a bunch of garbage about drawing images.


Mark Tiffany(Posted 2005) [#10]
Oh yes. All the power of Max2d in yer window.


Beaker(Posted 2005) [#11]
halo - why the bad attitude? You complain about our contribution, and yet I fail to see how "relevant", "helpful", or productive yours is.

Being rude, will get you far.


CS_TBL(Posted 2005) [#12]
I fail to see the difference between an image of a button and a real button. When it works it works. I use buttons and other custom gadgets like that nearly as long as I have B+ ..


rdodson41(Posted 2005) [#13]
I personally like the GUI module, though it does still have some bugs to be worked out.


Leiden(Posted 2005) [#14]
I think its pretty neat, It has a few bugs but I mean' its a first release, so theres bound to be a few overlooked things about it. Good work BRL!


Picklesworth(Posted 2005) [#15]
I fail to see the difference between an image of a button and a real button.

The advantage to using the real OS's built-in GUI as opposed to a custom GUI is that you don't need to worry about all those little GUI standards and useful features.
Windows, for instance, will automatically handle caps lock, Insert, Home, End, Page up, Page down, arrow keys, text highlighting, copy/cut and paste, shift+arrow to highlight, Ctrl+arrow key, accessing window menus by pressing Alt and the first letter of their title, using window menus and other GUI objects with the keyboard, and more.
On top of that, the user's theme/colour settings are dealt with, so that your program can look however the user wants it to look (in conjunction with the rest of the operating system).

And really, when you think about how hard it would be to research and add all those features to a custom GUI that some users will expect, it is actually easier to use the real thing.

Sorry if I misinerpreted your post, by the way :)


CS_TBL(Posted 2005) [#16]
The user-inteference (layoutwise) is also something I fear.. what if I create a normal/standard 32x24 button with a word on it.. the word really fits my button well. Now someone with a lame-ass blurry monitor wants to have a big font... yep.. the word doesn't fit the button anymore. If you do your own GUI you have at least the guanrantee that things will appear the best way.

However, I ofcourse understand your point. It'd still be nice to make own gadgets that are really native in some way. Something I like of my own buttonsystem for B+ is that it supports rightclicking on it. In my case it returns the name of the button, if the button-name is 'Save' then leftclick returns the string "Lsave" and rightclick returns "Rsave".

It's nonetheless an interesting discussion whether a GUI should be 'unique' or 'adapted from the OS'. In the latter case you have to assume that the OS is actually good.., and I do have some remarks on the windows layout now and then. :P

Look at those Photoshop buttons in that movable bar with drawoptions.. clickable images they are .. does anyone care about that?


ImaginaryHuman(Posted 2005) [#17]
What really is the difference between an image button and a flipped image? An image is an image. Unless you mean, some kind of native button `surround` with image fill?

I tried the GUI demo, it seems pretty good so far.


JoshK(Posted 2005) [#18]
An image button is a button control with a bitmap drawn in the center. It's easy to send a message to windows to add a bitmap, but then you break cross-platform compatibility. I use them for color dialogs by setting the button with a solid color bitmap.


Hotcakes(Posted 2005) [#19]
No StatusBar fields

Owners of BlitzMax (so not Halo:) should check out birdie.maxguiex.

halo - why the bad attitude?

Lol! You're kidding, right?

If you do your own GUI you have at least the guanrantee that things will appear the best way.

Except on lame ass blurry monitors, where you wouldn't be able to see @#!*.


skidracer(Posted 2005) [#20]
Presenting the user with an image instead of a button seems like an ambiguity to me, unless it's in a toolbar...


JoshK(Posted 2005) [#21]
I use them for color dialogs. When the user presses the button, a color dialog is opened. The button is then set to a solid color image of the selected color.

I also use them with an arrow image sometimes, like to move terrain layers up and down in the stack.

Here's some code to do it:





Kuron(Posted 2005) [#22]
oops


JoshK(Posted 2005) [#23]
All I see are regular buttons, checkboxes, and radio buttons. A toggle button is a regular button that stays pushed when you hit it.

Here is code to set the height of a combobox control. I don't know how to set the height of the dropdown list:
SendMessage hwnd,339,-1,height



Kuron(Posted 2005) [#24]
oops


JoshK(Posted 2005) [#25]
SetButtonState only works on a checkbox.

I don't see any demo by "James" anywhere. Can you tell me exactly where this demo is? The docs contain a button example, but it only shows a push button, checkbox, and radio button.


Kuron(Posted 2005) [#26]
apologies, it keeps it "selected" not "depressed", without the XP skinning on my old clunker it was looking "depressed". With XP skinning, it is clearly only "selected" :c(


skn3(Posted 2005) [#27]
Stupidly, the gadget paint event only gets triggered for a canvas.

That is my first impression after playing around.


JoshK(Posted 2005) [#28]
I always use a panel to create an OpenGL context. Then I set the window callback function to a PureBasic routine that catches any WM_PAINT events. Maybe you can set the window callback to your own function in BMAX?


skn3(Posted 2005) [#29]
Yeah it is possible to do that, I wrote a max win32 module myself (unfinished) and it was entirely possible to do it. Just seems stupid to build a layer ontop of the Os, and then not give access to the inner workings allowing people to extend the official module with PROPER custom gadgets (opengl draw gadgets are a massive waste of system resources).

Anyway of course I need to look into it more, but that was my first reaction. I was thinking of making a GDI painting module to sit next to MaxGUI, allowing you to paint any gadget (win32 only). So sorta needed a user friendly way to intercept the painting on all gadgets.

ANYWAY AGAIN, lol will look more when get more time.


Shagwana(Posted 2005) [#30]
Maybe you can set the window callback to your own function in BMAX?
Yes you can. Here is another one too.


skn3(Posted 2005) [#31]
Shagwana, unfortunatly that isnt actualy hooking the window proc. It only lets you hook into events that bltizmax has been predetermined to tell you.

See here:
http://www.blitzbasic.com/Community/posts.php?topic=53212


JoshK(Posted 2006) [#32]
After working with the GUI module for a while, I'm very impressed and happy with it. So far it has been able to do everything I have wanted it to. I'm very pleased.


Hotcakes(Posted 2006) [#33]
The best thing about MaxGUI as opposed to B+ is that MaxGUI is still being improved. B+ didn't see too much of that really.