|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
DriverHeaven Junior Member
Join Date: Jan 2006
Posts: 28
Rep Power: 0 ![]() |
kSlider.set_buttons - how to use it?
I am trying to add custom images to the kSlider. It doesn't seem to work for me. Here is what I have:
Code:
kSlider chFader;
chFader.set_bitmaps(mf.load_image("fader_line1_256.bmp"),mf.load_image("fader_knob1_256.bmp"));
create_vslider(chFader[i], FADER_ID + i, tmp, FADER_MIN_VALUE, 0, 10, 360, CHWIDTH, 50);
What is missing? Any ideas? Regards, Frank |
|
|
|
|
|
#2 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62 ![]() ![]() ![]() ![]() ![]() ![]() |
Did you attach your skin to your .kxl file?
i.e. copy /b MyPlugin.kxl + Myskin.kxs |
|
|
|
|
|
|
|
DriverHeaven Junior Member
Join Date: Jan 2006
Posts: 28
Rep Power: 0 ![]() |
Yes, I did. I am using some other images form the skin for eKnob classes, no problems.
As I said, I can see that slider is actually resized to the size of my background image. So slider is reading my image and taking the dimensions from there, but it is not showing the images. Regards, Frank |
|
|
|
|
|
#4 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62 ![]() ![]() ![]() ![]() ![]() ![]() |
Sorry, I have not tried to skin kSlider as of yet, so I am not sure what the correct method is with that.
I just did a quick test myself and the only way I could get it to use any of my images was to set_bitmaps after create_vslider, which is opposite of what the readme says to do, and it did not seem to draw right, so I do not know. <edit> Oops, my background image size was slightly off, which caused the drawing problem. Now the above works for me (but it is still opposite of what the readme says). </edit> Last edited by Russ; Aug 8, 2008 at 09:07 PM. |
|
|
|
|
|
|
|
DriverHeaven Junior Member
Join Date: Jan 2006
Posts: 28
Rep Power: 0 ![]() |
thanks!
I moved set_bitmaps call after create and now I have something. I also have problem with the background drawing, not sure why. What was your problem with the background? For me it first dowsn't show background, only the thumb image and as I move it background is dispayed all messed up. Still this is progress it might be something with my image, have to play with it.Thanks again! Regards, Frank |
|
|
|
|
|
#6 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62 ![]() ![]() ![]() ![]() ![]() ![]() |
Yeah, that is the same thing it was doing for me. I accidentally cropped it one pixel to small on each side. The size that worked is the size used in the create_vslider call (well actually I used create_hslider (since I used the demo plugin for testing), but same difference).
i.e. 170 x 30 slider background image using (straight from the demo plugin): create_hslider(level_1, VOL1_ID, "Left", 0x0, 0x7fffffff, 55, 35, 170, 30); If you create the slider (at the size you want) without the skin, and click on it so its highlighted, and then take a screen shot, you can use the selection rectangle to figure out where it should be cropped (area should include the selection rectangle), and it will also give you the correct location for the track slot thing, and any tick marks etc. BTW: If you want something to be transparent use white (RGB: 255,255,255). Last edited by Russ; Aug 9, 2008 at 02:33 AM. |
|
|
|
|
|
|
|
DriverHeaven Junior Member
Join Date: Jan 2006
Posts: 28
Rep Power: 0 ![]() |
I have it working now, however there are some problems.
Let me summarize (for future generations ):- set_bitmaps(...) needs to be called after create_Xslider(...) - size of the background image has to match exactly the size in the create_Xslider call Issues: - white background is treated as transparent, however it did not work for me, it gets messed up - too narrow background images produce weird problems. make them at least 30 pixels wide - there is some flickering when the fader is moved - main issue is that you need to click close to the middle of the thumb to move it properly. it seems that there is still the default windows slider beneath the image and if you click outside the invisible thumb, you get "jumping" movements. bottom line is that it works. I did not yet try it with the kFader class, not sure if it will work with the label and text field, have to try that. Thanks Russ for the help! Regards, Frank |
|
|
|
|
|
#8 | |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62 ![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
As for the other issues, I really didn't notice, but I made my thumb control with the same exact dimensions as the non-skinned version, and the size of the slider was at least 30 pixels, etc, so that is probably why (I pretty much just used a different color scheme). In any case, thanks for sharing your results, hopefully it will help someone else. |
|
|
|
|
|
|
#9 |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64 ![]() ![]() ![]() ![]() |
Those "skinned" kslider/kfader controls are too buggy. (all known issues btw)
Best to avoid them. None of the better plugins use them AFAIK. |
|
|
|
|
|
|
|
|
DriverHeaven Junior Member
Join Date: Jan 2006
Posts: 28
Rep Power: 0 ![]() |
Quote:
I noticed that most of the "better" plugins have their own custom controls. It would be nice if they shared the source code for those controls. In SDK I found eKnob class, which works fine for me (with minor mods). So far I could not find any replacement for skinned fader. I guess it would make sense to bring all those custom controls into SDK - what is the point of having a SDK with buggy and unfinished controls? I apologise if this was already duscussed earlier, I searched the forum and could not find any reference to skinned slider / fader. Regards, Frank Last edited by zaboomafoo; Aug 9, 2008 at 06:16 AM. |
|
|
|
|
|
|
#11 | ||||
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64 ![]() ![]() ![]() ![]() |
Quote:
(less code, less bugs etc) No knob control though. Quote:
(a well known phenomena on MS platform) Correct, there isn't any. Quote:
Most common controls (slider,button,checkbox,combo, static etc.) are provided in kxgui and they work fine. Remember there is no Knob or dial control in MFC/win32 either. The 'skinning' features in kxgui are far from perfect and must be seen as a bonus. Keep in mind the nature of kX project. One can not expect kX to provide and maintain a full-blown GUI framework for just a few potential interested coders. If you have finished some custom control you wish to contribute to kX I'm sure it will be appreciated ![]() Quote:
Most info can be found in the DSP section, that's were the (very small) group of kX coders usualy hang out. Best to post/look there. Last edited by Lex Nahumury; Aug 9, 2008 at 06:58 PM. Reason: corr. |
||||
|
|
|
|
|
|
|
|
DriverHeaven Junior Member
Join Date: Jan 2006
Posts: 28
Rep Power: 0 ![]() |
Quote:
). I am stuck with 3838 on w2k.Regards, Frank |
|
|
|
|
|
|
#13 |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64 ![]() ![]() ![]() ![]() |
I know. I'm just trying to explain why things are the way they are.
Well, apart from the latest 24-bit changes (for 10k2 only) I hardly see any advantage, especially if you are into kX DSP programming. So it might not be as bad as you think. |
|
|
|
![]() |
| Thread Tools | |
|
|