October 17, 2018, 10:35:03 PM

Author Topic: Fully Skinnable Windows & Gadgets  (Read 520 times)

Offline chalky

  • Jr. Member
  • **
  • Posts: 33
Fully Skinnable Windows & Gadgets
« on: April 16, 2018, 06:50:33 PM »
I have been using MaxGUI since buying it at the same time as BlitzMax many years ago, and have managed to write some pretty complex desktop applications with it - including the creation of some 'missing' gadgets (date-picker, up-down control and multi-column grid box) of my own.

A system I wrote in 2006 for calculating income tax (invoice/receipt/income/expenditure logging) needs an urgent overhaul, but since it was written in VB6 I am going to have to rewrite it from scratch. I would like to use BlitzMax to do this, but want to make the UI fully skinnable (I really like the dark interfaces of modern applications like HitFilm, Cubase, Wavelab etc.). This should be fairly straightforward (using a borderless window and manual painting/IO monitoring) as I wrote a complete GUI system during my AMOS days. However - for everything to tie in visually - all other gadgets (sliders, buttons, textboxes etc.) would need to adopt the colours/style of the skin.

Is it possible to do the above using MaxGUI and API calls or would I need to create my own version of every gadget (one dialog I'd definitely need to create is a file requester - but I have one I could convert from an old Blitz3D program I wrote) and manage the drawing/IO routines myself?

The latter option seems pretty daunting tbh, so - if it's not possible with MaxGUI - does anyone have any experience at doing skins with other GUI modules such as wxWidgets?

Offline Scaremonger

  • Jr. Member
  • **
  • Posts: 68
    • ITSpeedway - Ramblings of a geek!
Re: Fully Skinnable Windows & Gadgets
« Reply #1 on: April 16, 2018, 08:04:16 PM »
I wrote a stylesheet add-on for MaxGUI that lets you import a Style for all the gadgets. It's in my library:

https://sourceforge.net/projects/maxguistylesheet/

Would be nice to hear what you think about it.
Si...

Follow me at ITSpeedway.net.

Offline Derron

  • Hero Member
  • *****
  • Posts: 1354
Re: Fully Skinnable Windows & Gadgets
« Reply #2 on: April 16, 2018, 08:23:06 PM »
If the underlying widget lib is GTK you could give a custom .rc file describing colors, fontsizes, ... and the likes.
Dunno if you could use GTK on windows with MaxGUI too - it should be possible as eg. the AGK editor does the same (and the same way is used to have the "dark theme" someone here in the forums asked for - and I instructed him how to achieve that).


bye
Ron

Offline chalky

  • Jr. Member
  • **
  • Posts: 33
Re: Fully Skinnable Windows & Gadgets
« Reply #3 on: April 16, 2018, 11:04:34 PM »
I wrote a stylesheet add-on for MaxGUI that lets you import a Style for all the gadgets.

Would be nice to hear what you think about it.
Si...
That's pretty cool - though not really what I'm after (gadget borders are unaffected by the stylesheet - and slider buttons don't seem to be affected at all).

I have a horrible feeling that the only way I'll be able to do what I want is by creating my own gadgets. I'll do some more hunting - someone somewhere must have done this before, albeit probably in another programming language.

If the underlying widget lib is GTK you could give a custom .rc file describing colors, fontsizes, ... and the likes.
I know very little (aka nothing!) about GTK - more research required on my part me thinks...

Offline Henri

  • Full Member
  • ***
  • Posts: 154
Re: Fully Skinnable Windows & Gadgets
« Reply #4 on: April 17, 2018, 01:53:56 PM »
Hi,

both MaxGUI and wxWidgets are native GUI-libraries and use system default controls, which have predefined templates. You can alter colour, font, size and some small amount of border options (although IMO this is enough). You can mimic custom buttons/gadgets by using panels that can have graphics on them. Anything else would require overriding paint events and doing the drawing yourself.

As far as I know, Cubase uses custom graphic library of controls. This is needed if you want to have unity among different platforms. There certainly are those libs too for Blitzmax like IfsoGUI (haven't tried this).

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Offline chalky

  • Jr. Member
  • **
  • Posts: 33
Re: Fully Skinnable Windows & Gadgets
« Reply #5 on: April 17, 2018, 05:13:16 PM »
I did try IfSoGUI a long time ago, but with very few examples and no clues on how the skinning worked I gave up on it. I'm pretty sure it's meant for in-game GUI systems too (i.e. using standard BlitzMax graphics rather than a fully fledged O/S gadget system) though I could be wrong.

Looks like I'll be creating my own from scratch if I choose the skinnable path then. I already have bespoke code for Drop-Down Menu, Slider, Button, Up-Down Control, Date-Picker, Multi-Column Listbox controls - but would face the challenge of creating a working ComboBox, Textbox (in particular!) etc. - both of which are pretty daunting. On the other hand, it might be fun to have a go...

Offline Henri

  • Full Member
  • ***
  • Posts: 154
Re: Fully Skinnable Windows & Gadgets
« Reply #6 on: April 17, 2018, 06:14:22 PM »
Thats the spirit :-)

If I would have to do custom controls, I would look what would be the fastest 2D drawing API for needed environment, create a basic type for widget, with standard functions/methods for I/O ( like GetValue, SetValue, SetColour etc.) There was an old thread about Windows and Mac 2D drawing API by snk3, and If I recall correctly, JoshK used it to create his own custom control set.

-Henri
- Got 01100011 problems, but the bit ain't 00000001