Help drawing a custom gadget

BlitzMax Forums/MaxGUI Module/Help drawing a custom gadget

SLotman(Posted 2012) [#1]
This goes out to the MaxGUI guru's...

I'm making a animation editor with MaxGUI, so I thought about doing something like 3D Max's interface:



The numbers and 'lines' on this will vary, according to the number of frames set in the animation properties. The darker cursor is where the current frame is, and it should have other markers to show where 'keyframes' are.

How can I go about doing that on MaxGUI?

The only thing I saw searching the forum was some MaxGui 'extra' controls - and one of them was a progress bar, with lines below it. Those lines were 'labels' created alongside the bar.

Should I also create more labels for the numbers? And how would I make the "current animation" and the "keyframes" indicators?

Does anyone have some tips for me?


Kryzon(Posted 2012) [#2]
It's not an easy task, as it requires some low-level access to the drawing methods of the API.

Does it need to be MaxGUI? I don't think it allows you to create native custom controls out of the box.
Native controls are those unique pieces of GUI we see in professional software such as 3DS, Photoshop, etc. that use the OS's API so you get the same theme and behavior.

Now, if you were to use Brucey's wxMax...
At a quick glance, wxMax allows "direct GDI access". You'll be able to draw primitives such as lines, rects and ovals to create almost any kind of control (like the dashes representing the frames on that Timeline).
It also interfaces with Max2D, so you'll be able to draw images in a canvas gadget or even hook up with MiniB3D with some work - the OpenGL canvas can serve as the 'active view' for whatever kind of animation you'll be working with (particles, meshes etc.).

It will require a lot of study so you know how to work with wxMax\wxWidgets and how to deal with GDI drawing, but all the low-level work is done.

Resources:
WxMax home
Custom-control sample for wxMax (this is important.)
wxShapeFramework (which is probably what you'll use to draw on top of your controls).

WxWidgets article on Custom Controls
Another article on wxWidgets Custom Controls

EDIT: Try also sending an e-mail to user 'jsp', maker of LogicGUI.

Last edited 2012


Derron(Posted 2012) [#3]
wxMax is getting aged... and does not work that properly for more current OS.

MaxGUI is also not working on all platforms as expected (FLTKGui binding instead of GTK or QT - which makes it looking odd).


If you want to do custom gui components, do like some (including me) do since years:

Imagine you do not have direct access to source code like win32maxgui.bmx in the maxgui.mod directory.
Imagine you know there are events you can hook to.
- Now just extend an empty gui (like a TPanel) and override/extend the Paint-Event.

In your case it is: WM_PAINT

Your advantage: you have the sourcecode and are able to use the commands the guiwidgets use.



As you did not post in the beginners forum I think you can fiddle out the rest by yourself.


bye
Ron

PS: this is also a valid way to draw something on buttons (like splitbuttons etc), or add calltip-hovertooltips to editor windows. Another way would be extending the objects, and then in the "draw function" do:

function draw(myparams...)
'my special draw bla
'drawXYZ

parent::draw(myparams...)
end function


skn3(Posted 2012) [#4]
Psst it pays to do a forum search :D

http://www.blitzbasic.com/Community/posts.php?topic=98957


Kryzon(Posted 2012) [#5]
QTMax by Brucey; not officially released: http://code.google.com/p/qtmax/

Seems abandoned; uses 2009's QT.
Has examples\tutorials included, so it must be in an usable form.

There's no standalone package to download this module, so you'll need to use SVN.


Derron(Posted 2012) [#6]
QT is qt and therefor like "GTK" not the best when it comes to cross platform "native look".


bye
Ron