|
Excellent control. I was planning to create something similar for CodeProject. Think I need to drop the idea
==========================
AB => Code and let code
==========================
|
|
|
|
|
Thank you.
Oh, why don't you share your plan with others?
If you play a role in this control, it will be good for everyone.
|
|
|
|
|
Not tried to implement it yet but the demo app just looks great !!!
|
|
|
|
|
Thank you.
Please let me know if you have any trouble with implementation.
Good luck!
|
|
|
|
|
Hello,
I tried to implement it but ran through several issue:
- the first is that I manually destroy my slider when I do not need it and I recreate it later. On the second call to SetChannelBitmap, the CBitmap's have not been detached and so the Attach calls fail. Of course I could only hide my slider and show it again later but it would be cleaner if you implemented OnDestroy and detached the bitmap there.
- second is that I use the slider in a Media Player and so my slider needs to be easily resized. This is not the case in the current version. Do you have any suggestion on how to implement dynamic resizing (only in the slider orientation of course).
Best regards,
Nicolas
|
|
|
|
|
Hi,
The first one is my mistake.
I modified it. And following version will not have that problem.
I missed calling CBitmap::DeleteObject inside CBitmapSlider::OnDestroy function.
To support dynamic resizing, it will have two modes.
1. Tiles - Calling CDC::BitBlt repeatedly, its area will be covered.
2. Stretch - It will use CDC::StretchBlt function.
Thanks to your interest!
|
|
|
|
|
You get my 5
I done a slider also : http://www.codeproject.com/miscctrl/CSkinProgress.asp ! A bit more complicated to use than yours, but with text support...
Very good work, thanks
Kochise
In Code we trust !
|
|
|
|
|
Thank you very much!
I thought CSkinProgress was a progress control.
And I see this control, CBitmapSlider, also can be used as a progress control.
By the way, CSkinProgress is really fascinating!
Though I didn't look at your code in detail yet,
I'm sure I can learn much knowledge from your work.
I like it!
|
|
|
|
|
CSkinProgress is a progress control, you're right... But I coded (not yet released) a wrapper called CSkinSlider which encapsulate CSkinProgress, catch all mouse events, calculate them according to the position and size of the slider and modify the CSkinProgress parameters ! Quite fun...
What's interresting in your slider is transparency... I was not aware how to do this as I use AlphaBlend routines I created to work on every computer (which feature at least true-color capabilities, starting at 32768 colors - 15 bits) !
Kochise
In Code we trust !
|
|
|
|
|
That is good news!
I am looking forward to the release.
I hope this control can offer any information to the work.
|
|
|
|
|
Behind your link "Download Executable - 216 Kb" is the download for the sourcecode, so there's not executable anyway!
____________________________
Rule #1: code doesn't lie!
Rule #2: code never lies!
Rule #3: if the docs are incorrect -> take a look at the code!
|
|
|
|
|
At that time, I had been wandering to add a demo executable file.
It was my mistake and now I fixed it.
I am sorry about that.
|
|
|
|
|
If I'm surfing the net from a computer that has not Visual Studio installed and download your project I simply will not have chance to try it
SoftechSoftware
Davide Calabro'
davide_calabro@yahoo.com
http://www.softechsoftware.it
|
|
|
|
|
if exe than please just in separated zip file
speaking true i have no wish to risk the run any unknown exe (it does not depend on this unedited article author)
t!
|
|
|
|
|
Thanks to your advices.
I added demo executable file.
Please let me know if there is any problem.
|
|
|
|
|
|
Probably because this is a site whose audience is programmers. It is quite reasonable to assume that the target audience of this article is capable of downloading the code and rebuilding it for themselves. If you can't then the code is of no use to you anyway.
Personally I consider the author of this article to be far too kind considering the tone of your message.
The Ten Commandments For C Programmers
|
|
|
|
|
I like it. Well formatted and documented source code.
One suggestion: What about keyboard support?
Cheers,
Holger
|
|
|
|
|
Thank you. Especially your suggestion!
I really wanted to support keyboard.
However, I couldn't find any way how CStatic control is noticed by keyboard.
Please let me know how to do that.
|
|
|
|
|
Hi,
First step: Implement a handler for the WM_GETDLGCODE message.
UINT CBitmapSlider::OnGetDlgCode()
{
if (::GetKeyState(VK_TAB) < 0)
{
return DLGC_WANTTAB;
}
else
{
return DLGC_WANTALLKEYS;
}
return CStatic::OnGetDlgCode();
}
Next step: Implement a handler for the WM_KEYDOWN message.
void CBitmapSlider::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CStatic::OnKeyDown(nChar, nRepCnt, nFlags);
}
A further suggestion is to draw a focus rect around the control
if it holds the focus.
Cheers,
Holger
|
|
|
|
|
Wow! It works!!
I appreciate your excellent suggestions and information.
There is one more thing that I want to ask you.
Using your code, it is impossible to loose its focus with Tab key.
In this way, it works.
UINT CBitmapSlider::OnGetDlgCode()
{
if( GetKeyState(VK_TAB) >= 0 ) {
return DLGC_WANTALLKEYS;
}
return CStatic::OnGetDlgCode();
}
Is it okay?
|
|
|
|
|
What about this?
void CBitmapSlider::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CStatic::OnKeyDown(nChar, nRepCnt, nFlags);
if (nChar == VK_TAB)
{
CWnd *pParentWnd = GetParent();
if (pParentWnd != NULL && pParentWnd->IsKindOf(RUNTIME_CLASS(CDialog)))
{
if (GetKeyState(VK_SHIFT ) < 0)
{
((CDialog *)pParentWnd)->PrevDlgCtrl();
}
else
{
((CDialog *)pParentWnd)->NextDlgCtrl();
}
}
}
else
{
}
}
UINT CBitmapSlider::OnGetDlgCode()
{
return DLGC_WANTALLKEYS;
}
Cheers,
Holger
|
|
|
|
|
Thank you. I am learning much from you.
My simple tests showed same result for both of them.
I will implement that way if I find problem with previous code.
Thank you again!
|
|
|
|
|
Hi,Joon,
We are software Company. One of our software R&D uses your CBitmapSlider codes in our sofware which now related with Open Source issues. Could you please let me know your contact way (E-mail) ASAP as we would like to talk with you about this open Source software.
Please reply me as soon as possible!
Thanks very much!
Zhuyu
|
|
|
|