customizing gui controls

Discussion in 'Effects and the DSP' started by stylus02, Jan 9, 2012.

  1. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    Last edited: Jan 9, 2012
  2. Tyrsonswood

    Tyrsonswood HH's curmudgeon

    Joined:
    Mar 7, 2008
    Messages:
    13,763
    Likes Received:
    1,536
    Trophy Points:
    138
    So, what are you looking for? Opinions?

    If so, the one on the right
     
  3. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    the right one is what i want to have. (it's a not working sketch) now i searched the web how to make the standard windows controls look like this. the kx "kcombo" gives only basic (design) functionality. there are some (extended) attributes to override controls: style, colors, images. maybe someone has experience with it.
     
  4. Tyrsonswood

    Tyrsonswood HH's curmudgeon

    Joined:
    Mar 7, 2008
    Messages:
    13,763
    Likes Received:
    1,536
    Trophy Points:
    138
    Ahh.... Okay. I've no experience with such work. Looks great though, Good luck.
     
  5. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    The kX controls do not always offer/expose all of the functionality of the MFC controls. In such cases just use the MFC control itself. However, recoloring a combobox can get quite complicated. You will have to subclass the CComboBox control. Setting the text color and background color is not too bad, but then you are probably going to want to change the highlighting colors, etc, in which case you will have to do owner drawing. Additionally, if you want to change the arrow, you will have to handle WM_PAINT and draw the borders and arrow, etc yourself. It can get complicated (a pain in the you know what). If at all possible you might want to get rid of the comboboxes and use something else instead.

    e.g.
    If it was just drawing the combobox stuff in WM_PAINT (including the thumb, etc) it would not be too bad, but you do that, and then the colors do not match that listbox part, so you do owner drawing and draw the listbox stuff. Later you see that drawing is being done somewhere else too (e.g. a white selection box is drawn around the text when selected). You decide you will live with that, but then you populate the combobox with multiple strings and now get scrollbars in the listbox part, and it does not match the rest of the custom painting... etc.
     
    Last edited: Jan 12, 2012
  6. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    alternative..

    1. the control could be a spintype button (kButton channel_up, channel_down) with selecting and displaying a listitem (midi channel). maybe a kStatic display_channel.

    2. in an older forum topic i found, that there is a kTextButton, which is use for the card- selection in the dsp window (preset selection too?) this thing can have different colors, fonts, sizes. http://www.hardwareheaven.com/effects-dsp/24959-lemurys-new-dsp-mixer-kx-plugins-sx-2.html (eugene's entries)

    btw: i had no luck with displaying a simple text in my plugin window using standard expressions like this:
    // after create_dialog..

    CClientDC dc(this); CFont font; VERIFY(font.CreatePointFont(120, "Arial", &dc)); // Do something with the font just created... CFont* def_font = dc.SelectObject(&font); dc.TextOut(5, 5, "Hello", 5); dc.SelectObject(def_font); // Done with the font. Delete the font object. font.DeleteObject();



     
    Last edited: Jan 10, 2012
  7. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    BTW: The kCombo version does not look bad... And again, it is not too hard to change the text color and background color... It really only gets complicated if you want to change the dropdown arrow thing, or the highlighting, etc.

    I am not familiar with the kTextButton...
    You could do similar using a CStatic control and maybe create a pop-up menu (or listbox) when it is clicked to use for selection, etc. (That is probably what kTextButton is, and how presets, etc are done).

    Yeah, that would not work... Any drawing that you try to do there is just going to get erased by WM_PAINT.
     
  8. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    the standard combobox works perfectly, but you know, it -could- look more realistic in terms of a hardware look. such a displaytext- popupmenu- button would be useful in any other case too. i've found a ttf font "ds-digital" (the font in the sketches) and had it in a dialog with cleartype (antialiasing) option and it looked great. no need to draw 3d borders or that arrow. simply place a colored text object on a prerendered backdrop.

    color variation: (graphic sketch)
    https://sites.google.com/site/kxmodular/customized_combo_01.bmp?attredirects=0

    beside that: i downloaded the vstgui library and overlook it.
    http://sourceforge.net/projects/vstgui/files/latest/download
     
    Last edited: Jan 11, 2012
  9. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    after hours trying to understand sdk classes of type "kclass" i realised that there only a few corresponding functions are working / documented (e.g. create_ (kxplugingui.h)). is it possible to define new functions using all sdk classes or are they linked to external libraries or whatever?
    CStatic stuff is used in "dynamic" or "mx6" (no kStatic?) i think i can grab some stuff from it for my purposes.
    anyway, i found a really nice looking dot matrix display code. maybe we could implement such a thing in future? :)
    Digital Display CStatic control - CodeProject®
     
    Last edited: Jan 13, 2012
  10. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Well there is more functionality than just the create stuff. If you look in the header files for each type of control and the base classes you can find more stuff. But yeah, some of the kX controls are a bit limited, and you cannot really extend their functionality much.

    In any case, again, you do not have to use the kX classes, you can use MFC controls (which you can subclass and extend/modify functionality, etc), or create your own derived from CWnd (e.g. like I did with the dot matrix display in FxRouter), etc, or use something you find at places like CodeProject, etc.
     
  11. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    i had not yet a closer to your fx- router plugin. times ago i noticed a graphical user interface with dot matrix display (and a drag&drop routine) that is a bit to "biggy". but if it's customizable it could be what i'm looking for. nice tip! :)
    i can imagine such a display what shows a selected array element (midi device, midi channel) via 2 buttons (up, down).
     
    Last edited: Jan 13, 2012
  12. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Well I wasn't suggesting that you use that, I just meant to show it as a example that you can do pretty much whatever you want (make your own or use the one from the CP site, etc)... that you are not limited to just the kXGUI stuff.

    BTW: I generally use a basic dialog application in Visual Studio to create and test my controls, etc, as you have access to the classwizard, and applying changes and recompiling and testing/debugging is much faster/easier (than testing in a plugin in kX DSP, etc).
     
    Last edited: Jan 13, 2012
  13. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    how could it look:
    https://sites.google.com/site/kxmodular/customized_display_control_02.bmp?attredirects=0

    using the wizzard and that toolbox stuff is pretty much straight forward (i have no really experience with it), but if i combine something with kx i get stuck. classes, memberclasses, base classes.. you know. it's to much to have a quick overview. i'm better in designing some nice graphics than going into deep with winapi, mfc and so on.
     
    Last edited: Jan 13, 2012
  14. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Looks nice, but don't forget what it is being used to display... 7 characters is probably not going to be enough to show anything meaningful, is it? e.g. You do all the work to make it all look nice, etc and all it says is "In From", etc.
     
    Last edited: Jan 13, 2012
  15. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    that should not the biggest problem. tweaking size, colors etc. is to fetch later. btw: you have build in an edit- mode. it's quite comlete. but it is not included in the sdk. ( i found no sourcecode in 3545, 3550)
    for better understanding the rendering, i do the 3d construction parallel to the placements of the controls. if the code changes it can easy updated in den 3d scene by moving all that objects (no textures, expect the the bumpmaps and the pixelpatterns (which are placed on 2d- shapes too)). it's qiute similar to the use of "friendly- looking" functions in our codes. the render takes a few seconds thanks ghz- cpu's.
     
    Last edited: Jan 13, 2012
  16. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Well if that is what you want to go with you could probably use that code from CodeProject and modify it to use your own bitmaps/size for the characters, etc.

    As for FxRouter. I am not even sure I have the source code for that any more... My hard drive croaked a while back and I lost a lot of stuff (I might have to ask E. to send it back to me). I think parts of it were included in older versions of kX (like 3538j). In any case, it is probably not something you would want to use for this, as it size (height) is fixed.
     
  17. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    if it's lost it would be very painful. and it was surely a lot of work for you. i have older driver- versions from 3534 - 3550.
    maybe is everything available.
    you mean the x/y ratio of the letters are fixed or generally its hight. were you are using a bitmap charset?
     
    Last edited: Jan 13, 2012
  18. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    No, I did not use bitmaps, everything is drawn manually (character width and height is fixed (each character is something like 22x17 pixels), so the control's height is fixed (IIRC, 32 pixels) and it's width is determined by how many characters you want to display (i.e. number of character times character width, plus width of the borders, etc)).

    i.e.
    In it's create function, you basically just specify the point for the top-left and how many characters you want, etc.

    Part's of it are there (e.g. I know the LCD code is there (in 3538j I think) cuz I remember someone asking about it in the forum), but not all the code (not sure why E. didn't include it all... maybe cause it is not likely stuff people would use in other plugins, etc). In any case, E. should still have it since the plugin is bundled with kX.
     
    Last edited: Jan 13, 2012
  19. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    i see the difficulty. all the characters have to drawn with new coordinates. this must be a nice array... this code project thing is bitmap based (and it scrolls longer content.. well you are right). it compiled, but it it uses some more .h, .cpp files which i was unable to implement yet in kx. what i'm doing now is make that button functionality working and then we will see.
     
    Last edited: Jan 13, 2012
  20. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I only took a quick look at the code, but I think you should only need the MatrixStatic.h and MatrixStatic.cpp files and modify the code to load the bitmaps from the skin (or maybe from disk for testing) instead of from the resource file.

    If I have the chance I will take a look at it (I am on a laptop atm with no kX).
     

Share This Page

visited