MaxGUI Updates & Enhancements

BlitzMax Forums/MaxGUI Module/MaxGUI Updates & Enhancements

SebHoll(Posted 2008) [#1]
IMPORTANT NOTE: Please keep posts on topic. If you are having problems with the BlitzMax Community IDE, please post in the correct thread. In addition, this thread is not the right place to discuss your view on whether you think BRL is right in distributing development modules via SVN. Please only post here if you want to make a comment on/report a bug in the new MaxGUI module implementations.

To all fellow MaxGUI users,

There are a few things which I'd like to announce regarding MaxGUI on behalf of all the MaxGUI developers that have helped out in the last few weeks.

In addition to Mr Sibly and Mr Armstrong special thanks goes to (in no particular order):

Mark Tiffany, Brucey (Cocoa & GTK) and Grisu (Windows Testing)

---

1) MaxGUI.MaxGUI and MaxGUI.Win32MaxGUIEx (previously known as Axe.Win32MaxGUI)

As many of you will be aware, I have been helping Skid with a new Windows implementation for MaxGUI which is now stable enough to replace the old module. As there are quite a few things to talk about, I have written a short document explaining a few things, which you can view here: MaxGUI Modules. In addition, we've also managed to get the MaxGUI Bug Reports forum down to less than a page of bugs (which is quite an achievement in itself).

Important Note: The new version of MaxGUI.Win32MaxGUIEx has been written to be used with Unicode strings and as such, may not be supported on the older ANSI Windows 9X/Me platforms.


2) SetGadgetPixmap()

A new function has been added to the latest version of MaxGUI that is a more generic form of SetPanelPixmap(), except that it now has two additional flags:

GADGETPIXMAP_ICON - Sets a button/menu's icon. For menus, the recommended icon size is 12×12 otherwise they may be cropped before being set.
GADGETPIXMAP_NOTEXT - To be used in conjunction with GADGETPIXMAP_ICON to remove text from a button when an image is shown.

After setting icons for a menu, it is recommended that you call UpdateWindowMenu() to ensure the icons are visible.



To help with loading and setting large volumes of icons, another new function has been added to MaxGUI, aptly named PixmapFromIconStrip(), which, surprisingly, allows you to extract a specific icon from a previously loaded icon-strip.

To remove icons from a button/menu, you should be able to pass Null as the pixmap when calling the function.


3) SetGadgetTooltip()

This function should set a non item-based gadget tooltip, e.g. on labels, buttons, text-fields.


4) SetMaxWindowSize()

Guess what this should do? :P


5) New PANELPIXMAP_FIT2 Style

Another panel pixmap stretch mode which is similar to PANELPIXMAP_FIT except it isn't afraid of clipping to get the best fit.


6) Cocoa Bug Fixes

The following bugs should hopefully be fixed in this latest release:

> Gadget font support for Buttons, Listboxes, Treeviews and Comboboxes (Thanks Brucey)
> Koriolis's fix for read-only text-areas crash.
> Textless popup menus fix.
> Better support for GadgetDisabled()
> Added hack to push buttons so that they can be taller/smaller.

Edit:
> Added the finishing touches to Brucey's tool-window code.
> Fixed tabbers not sending item extra object with events.
> Swapped out tabber icon code (so that it now works).
> Fixed GadgetText() for buttons, menus and tree-nodes.



---

Currently test implementations have been coded for both MaxGUI.Win32MaxGUIEx and MaxGUI.CocoaMaxGUI and hopefully we'll be able to get Brucey's BaH.GTKMaxGUI module to work with the new functions too. These functions will fail silently if they haven't been implemented, so there should be little risk in using these in your cross-platform application.

So, if you want to get a hold of the latest MaxGUI modules and help test them out, direct your SVN clients to...

http://blitzbasic.com:81/svn/maxgui/dev/maxgui.mod


Note: If you need help with downloading the new MaxGUI development modules from SVN, check out this thread *click*.

---

Any constructive feedback would be greatly appreciated. Depending on feedback, we're considering improving MaxGUI further and are appealing for any Objective-C/FLTK/GTK programmers to get in touch if they want to help out.

Enjoy!


skidracer(Posted 2008) [#2]
Subversion is replacing syncmods and the maxgui repository is private to MaxGUI registered users so no, zip based updates for MaxGUI are not going to happen unless there is significant demand.


GaryV(Posted 2008) [#3]
Thank you for the update.


GaryV(Posted 2008) [#4]
The developers in posts above have made it clear it is SVN only from now on. If you don't want to use MaxGUI, that is up to you. But you are missing out on something good.


tonyg(Posted 2008) [#5]
Personally I don't need/want access to the latest development modules. I hardly get a bug nowadays. I'm also hoping the new MaxGUI isn't going to disrupt LogicGUI.
However, the FAQ in the SVN README.txt states that binaries will still be distributed (woohoo) but it doesn't explain what will happen with MaxGUI which has always been a syncmods install rather than normal download.


Mark Tiffany(Posted 2008) [#6]
However, the FAQ in the SVN README.txt states that binaries will still be distributed (woohoo) but it doesn't explain what will happen with MaxGUI which has always been a syncmods install rather than normal download.

Precisely. A simple means of getting hold of major releases (like this one) for MaxGUI without SVN is needed, even if I personally don't think SVN is anything like the big deal some people think it is.

In any case, back to the topic at hand : Seb's excellent work on MaxGUI...


degac(Posted 2008) [#7]
Thanks for the updates!!!
Great things the icon & tooltips support!

EDIT:

to Skidmarks (and everyone in the project): just a 'simple marketing hint'. I think you should change the MaxGUI product page to reflect the latest changes - Icons in tabs and menu are a touch of professionality. The images are old.
And of course something in the main page that says 'eh! Look at me! I'm the gui module!'....


SebHoll(Posted 2008) [#8]
Update for OS X MaxGUI users:

Another new version of MaxGUI.CocoaMaxGUI has been committed today (v1.36) which should address the following issues:

> Added the finishing touches to Brucey's tool-window code.
> Fixed tabbers not sending item extra object with events.
> Swapped out tabber icon code (so that it now works).

Tool windows on OS X are looking really good, and now float like they should do (thanks Brucey) - see the second screenshot in the first post to get a sneak peek!


SebHoll(Posted 2008) [#9]
Menu icons don't show up in Windows XP (don't know about Vista) and calling SetGadgetPixmap() on a button crashes on bbSetPanelPixmap().

Are you sure you are using the SVN versions of the modules? Once you have checked all the MaxGUI.XXXXX modules out of the repository into BlitzMax\mod\maxgui.mod, delete (or move to a safe place) the old MaxGUI modules in BlitzMax\brl.mod (brl.maxgui, brl.cocoamaxgui, brl.win32maxgui and brl.fltkmaxgui). Then, rebuild modules, and replace any current MaxGUI imports with:

Import MaxGUI.Drivers
Once you've done all this, you should be up and running with the new module and start benefiting from the new features.


JoshK(Posted 2008) [#10]
No, I am not sure because no one thinks it is important to explain how to use this SVN crap. I had someone send me the package. I can run my program using maxgui.maxgui and maxgui.win32maxgui, and everything appears normal.

Edit: Okay, I used Tortoise SVN and downloaded the module, then rebuilt maxgui.maxgui, maxgui.win32maxgui, maxgui.win32maxguiex, and maxgui.drivers.

I imported maxgui.maxgui and maxgui.win32maxgui.

I used this code (and checked to make sure the pixmap was being loaded):
SetGadgetPixmap Gadget_TerrainLayerTextureButton,LoadPixmap("gfx/folder.bmp"),GADGETPIXMAP_ICON|GADGETPIXMAP_NOTEXT
Same result as above. Has this been tested on Windows XP or just Vista?


SebHoll(Posted 2008) [#11]
No, I am not sure because no one thinks it is important to explain how to use this SVN crap. I had someone send me the package.

Leadwerks, I know you are having difficulties with SVN, but you really need to stop taking your anger out on members of the BRL community.

Seb's 10 Step Guide for MaxGUI SVN'ing on Windows:
Moved to the first post in this topic!

Hope this helps!

I imported maxgui.maxgui and maxgui.win32maxgui.

Edit: OK, you need to import just MaxGUI.Drivers or MaxGUI.Win32MaxGUIEx instead of MaxGUI.Win32MaxGUI.


JoshK(Posted 2008) [#12]
Sorry, that one was my fault.

In the old BRL.maxgui you could add treeview nodes straight to the treeview gadget, not just the root.

Disabled toolbar items look MUCH better now...instead of just solid gray blocks they turn grayscale. That is a nice touch.

Transparency seems to work in button and menu images. That is something I never got working before, very nice.

What size should menu icons be? 12x12?

Is there a way to indent menu items a little? I think I ran across this a long time ago, but never got the menu icons themselves appearing.

Very good work!


Mark Tiffany(Posted 2008) [#13]
12x12 seems to be the best "standard", but it's not even standard on windows. There is a win32 API call that you can use to find out, and I think it returned 13x13 on XP, and 14x14 on Vista! I believe that in the case of menu icons, whatever you pass will be scaled to the right size anyway by the os.

So I decided to go with passing in a 16x16 image (from famfamicons which you also found!), and it seems to look about right on most platforms...


SebHoll(Posted 2008) [#14]
Is there a way to indent menu items a little?

Not sure what you mean... Do you mean indent the text so that more spacing between the menu text and the icon? If that's what you mean, I don't think there is. I suppose you might be able to trick it by putting a few spaces before your menu labels, but haven't tried it myself.

Transparency seems to work in button and menu images. That is something I never got working before, very nice.

Very good work!

Disabled toolbar items look MUCH better now...instead of just solid gray blocks they turn grayscale. That is a nice touch.

I definitely prefer the happy Leadwerks... :-)


JoshK(Posted 2008) [#15]
Here's a shot using the Silk GUI icons and the new MaxGUI. There are menu icons, although they are not shown here. The gadget tips are nice to have. I notice tabbers and panels have a lighter color now, which looks more modern. Tabbers don't get painted, by the way, but it isn't a big deal to fill them in with a panel:



JaviCervera(Posted 2008) [#16]
Thx for your work dude! Will try it as soon as I arrive back home (I'm on the US this week).


SebHoll(Posted 2008) [#17]
Fixes have been committed to SVN concerning...

MaxGUI.CocoaMaxGUI

> Added missing quote to ModuleInfo declarations in cocoamaxgui.bmx.
> Added a hack to at least stop MaxGUI apps crashing when calling GadgetDisabled() or GadgetHidden() on textareas.


MaxGUI.Win32MaxGUIEx

> Fix for tabber client redraw problem on Windows XP.



SebHoll(Posted 2008) [#18]
Just to let everyone know that Mark's just committed some more updates for me:

MaxGUI.Win32MaxGUIEx

> Plugged Mark T's treeview memory leak.
> GADGETPIXMAP_ICONNOTEXT on Windows XP should now work.
> Separators should now be a suitable separator thickness (4 pixels) and can be either horizontal or vertical.
> Added toggle item support.
> Events are suppressed that are not generated directly by the user.
> Fixed GadgetText() on non-editable combo-boxes.
> More patches to fix certain controls' allergic reaction to WS_EX_COMPOSITED (double-buffered drawing).

Thanks to jsp and Mark T for the bug reports!

I would like to emphasize that MaxGUI.Win32MaxGUIEx is designed/tested to be used with Windows XP+ and with a manifest file, so choosing to remove the manifest file may cause undesired effects.

Enjoy! Now let's clear this thread up a bit!


SebHoll(Posted 2008) [#19]
Hi Everyone,

Just announcing a few more tweaks/improvements to the MaxGUI modules that have just been committed to SVN:

---

1. New SetGadgetSensitivity()/GadgetSensitivity() Functions

This new function should allow you to sensitize almost any positionable MaxGUI gadget to mouse/key events similar to active panels.

Supported drivers:
MaxGUI.Win32MaxGUI, MaxGUI.Win32MaxGUIEx, MaxGUI.CocoaMaxGUI



2. New CHECK_INDETERMINATE State for Checkboxes

Checkboxes are now able to have an indeterminate check, useful for showing when a checkbox state isn't the same for all values concerned. It looks a bit like this:



Note, this state can only be set programatically. When clicked, the checkbox will resume to having two states again.

Supported drivers:
MaxGUI.Win32MaxGUI, MaxGUI.Win32MaxGUIEx, MaxGUI.CocoaMaxGUI



3. New Proxy Gadgets Module

This new module is designed to house any future composite gadgets that wrap around the standard MaxGUI controls, providing additional functionality out of the box. At the moment, there is only a hyperlink gadget, but even so, I'd imagine this should be useful to a fair few people.

To access these gadgets, you will have to add...

Import MaxGUI.ProxyGadgets
...to the top of your source files in addition to the MaxGUI.Drivers module.


4. Added WINDOW_CENTER Hack to CreateWindow()

Added an additional flag that ignores the x,y parameters when calling CreateWindow(), and attempts to position the gadget in the center of the screen. I'd be interested to see if this works as expected on multi-monitor set-ups, so please let me know.


5. More Bug Fixes

In addition to the above enhancements, there have been a few bug fixes:

MaxGUI.CocoaMaxGUI:
> Fixed Push, OK and Cancel buttons returning alternate values from ButtonState() - now returns 0.
> Disabled text-areas should no longer allow you to select text.
> Fixed limited tabstops in textareas (now uses the setDefaultTabInterval selector).
> Added label, button and text-field text colors.
> Added button, text-field and window background colors.

MaxGUI.FLTKMaxGUI:
> Removed pixmap field from TFLTKIconStrip to avoid errors when calling ExtractPixmapFromIconStrip().

MaxGUI.Win32MaxGUI:
> Added support for the PANELPIXMAP_FIT2 constant.

MaxGUI.Win32MaxGUIEx:
> Fixed button tooltips disappearing on Windows XP.
> Fixed the changing of gadget tooltips using SetGadgetTooltip.

---

There have also been a few tweaks to the docs (nothing major) and to the source of MaxIDE, Docmods and MakeDocs.

Enjoy!


degac(Posted 2008) [#20]
Ohhhh! it's Christmas! Thank you very much!!!


SebHoll(Posted 2008) [#21]
As per Grisu's suggestion, I've moved all anouncements to a separate MaxGUI worklog, and have started a new dedicated MaxGUI Updates Discussion thread so that it is a bit more organized.

Any further comments please post there:

MaxGUI Updates Discussion Thread