topic
stringlengths
1
63
text
stringlengths
1
577k
Bug in TBtnBmp [Solved]
Antonio, thank you. Unfortunately the result is... ugly! <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG
Bug in TBtnBmp [Solved]
Enrico, I am testing FWH\samples\testbtnb.prg and it looks fine. What example are you testing ?
Bug in TBtnBmp [Solved]
[img:t0nj2xm9]http&#58;//i57&#46;tinypic&#46;com/90aots&#46;jpg[/img:t0nj2xm9]
Bug in TBtnBmp [Solved]
Antonio, [quote="Antonio Linares":3fjrnfvv]Enrico, I am testing FWH\samples\testbtnb.prg and it looks fine. What example are you testing ?[/quote:3fjrnfvv] The simple one that I've already reported: [code=fw:3fjrnfvv]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>, <span style="color: #000000;">600</span><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FILE <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>pen.bmp"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ADJUST</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">CENTER</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:3fjrnfvv] EMG
Bug in TBtnBmp [Solved]
Antonio, [quote="Antonio Linares":3cm1eqmj][img:3cm1eqmj]http&#58;//i57&#46;tinypic&#46;com/90aots&#46;jpg[/img:3cm1eqmj][/quote:3cm1eqmj] As you can see, there is no border anymore (it was there using the previous FWH release). <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG
Bug in TBtnBmp [Solved]
Antonio, I have a proposal: why not to revert back to the previous btnbmp.prg that used to work very well? What was the reason behind the new changes? EMG
Bug in TBtnBmp [Solved]
Enrico, The btnbmp source code is an old class (it comes with FWH since the very early beginning) and have been experiencing many transformations, so from time to time, we try to simplify and reorganice the code. Recently Rao worked on it to simplify it, but it seems that still it is not ok. So yes, in the meantime, you could use the previous version and everything should work fine <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Bug in TBtnBmp [Solved]
Antonio, [quote:2tjgl204]* Fix: There was a painting error in Class TBtnBmp due to recent changes in Class TBtnBmp. Now it is ok. [/quote:2tjgl204] Unfortunately it is not properly fixed. I had to revert to the previous btnbmp.prg again. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG
Bug in TBtnBmp [Solved]
Enrico, I tested them on a ButtonBar and also on GET ... ACTION ... and seemed ok. If I remember properly you provided here an example, I am going to review it. thanks
Bug in TBtnBmp [Solved]
Enrico, I did my tests on FWH\samples\testbtnb.prg. I have just tested it again and seems fine. Could you please run that example and see if it is fine there for you ? thanks
Bug in TBtnBmp [Solved]
Antonio, I just sent you an image showing the problem: 1. There is a black border that wasn't there before 2. The bitmap is not centered in the button anymore EMG
Bug in TBtnBmp [Solved]
Enrico, The black border is painted from here (Class TBtnBmp Method Paint()): [code=fw:iqphwtrd]<div class="fw" id="{CB}" style="font-family: monospace;">      <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBorder</span><br />         WndBox<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, ::<span style="color: #000000;">nHeight</span> - <span style="color: #000000;">1</span>, ::<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span></div>[/code:iqphwtrd] If you do oBtn:lBorder := .F. then you will avoid it (at least for a temporary solution) Please try it and lets see if the paiting improves, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Bug in TBtnBmp [Solved]
Antonio, no, sorry. The border went away, but: 1. it goes back when the mouse is over the button 2. the bitmap is still not centered 3. there is no 3D effect on the button anymore <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG
Bug in TBtnBmp [Solved]
[quote="Enrico Maria Giordano":17ecxo5y]Antonio, no, sorry. The border went away, but: 1. it goes back when the mouse is over the button 2. the bitmap is still not centered 3. there is no 3D effect on the button anymore <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG[/quote:17ecxo5y] Antonio, a mi me ocurre lo mismo Antonio, I so do I
Bug in TBtnBmp [Solved]
Enrico, Cristobal, The source code for Class TBtnBmp Method Paint() has been evolving along the years and actually is quite messy. So this morning I decided to reorganize it, to properly structure it and I have found this: If you replace Method Paint() with this code: [code=fw:nzqr2zzo]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// local aInfo := ::DispBegin()</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lTransparent</span><br />&nbsp; &nbsp; &nbsp; SetBrushOrgEx<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, nBmpWidth<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span> - ::<span style="color: #000000;">nLeft</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nBmpHeight<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span> - ::<span style="color: #000000;">nTop</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; FillRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bClrGrad</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FillRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">aGrad</span> != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GradientFill<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, ::<span style="color: #000000;">nHeight</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">aGrad</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// ::DispEnd( aInfo )</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:nzqr2zzo] This way the background is properly filled. Now if you uncomment the calls to DispBegin() and DispEnd() an unexpected border appears at the top and at the left. So in order to properly fix its painting we first need to know where this is coming from. Please test it and lets try to find why that is happening. Thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Bug in TBtnBmp [Solved]
Antonio, can you send me the modified btnbmp.prg, please? EMG
Bug in TBtnBmp [Solved]
I don't keep a copy of my changes today, sorry. But just replace the Method Paint() in Class TBtnBmp and you will see what I mean. We need to solve this before moving on and reorganize Method Paint() My plan is to replace it with a much more structured code.
Bug in TBtnBmp [Solved]
Ok, can you send me the original btnbmp.prg? I replaced it with the working one. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
Bug in TBtnBmp [Solved]
Antonio, I already have the new btnbmp.prg! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
Bug in TBtnBmp [Solved]
Antonio, [quote="Antonio Linares":2944vih9]This way the background is properly filled. Now if you uncomment the calls to DispBegin() and DispEnd() an unexpected border appears at the top and at the left.[/quote:2944vih9] I just tried but I don't see any border, with or without the two calls. And, by the way, I don't see the bitmap too, of course. EMG
Bug in TBtnBmp [Solved]
Enrico, Quite curious, now I tested here again and its fine <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Please test this Class TBtnBmp Method Paint() (warning to other users: this is for testing only, don't use this code yet) [code=fw:i0i7q3br]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aInfo := ::<span style="color: #000000;">DispBegin</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hBmp := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! IsWindowEnabled<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap3</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">hBitmap3</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nBtn := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! IsWindowEnabled<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span> .and. ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap3</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">3</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lMOver</span> .and. ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lTransparent</span><br />&nbsp; &nbsp; &nbsp; SetBrushOrgEx<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, nBmpWidth<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span> - ::<span style="color: #000000;">nLeft</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nBmpHeight<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span> - ::<span style="color: #000000;">nTop</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; FillRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bClrGrad</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FillRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">aGrad</span> != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GradientFill<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, ::<span style="color: #000000;">nHeight</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">aGrad</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBmpTransparent</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> SetAlpha<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .and. ::<span style="color: #000000;">aAlpha</span><span style="color: #000000;">&#91;</span> nBtn <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ABPaint<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hBmp, ::<span style="color: #000000;">nAlphaLevel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DrawTransBmp<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, hBmp, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DrawTransBmp<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, hBmp, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:i0i7q3br]
Bug in TBtnBmp [Solved]
Enrico, The same one modified as there is no need to call DrawTransBmp() when the bitmap is not going to be used in transparent mode: [code=fw:waheld9z]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aInfo := ::<span style="color: #000000;">DispBegin</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hBmp := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! IsWindowEnabled<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap3</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">hBitmap3</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nBtn := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! IsWindowEnabled<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span> .and. ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap3</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">3</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lMOver</span> .and. ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lTransparent</span><br />&nbsp; &nbsp; &nbsp; SetBrushOrgEx<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, nBmpWidth<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span> - ::<span style="color: #000000;">nLeft</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nBmpHeight<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span> - ::<span style="color: #000000;">nTop</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; FillRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bClrGrad</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FillRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">aGrad</span> != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GradientFill<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, ::<span style="color: #000000;">nHeight</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">aGrad</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBmpTransparent</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> SetAlpha<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .and. ::<span style="color: #000000;">aAlpha</span><span style="color: #000000;">&#91;</span> nBtn <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ABPaint<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hBmp, ::<span style="color: #000000;">nAlphaLevel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DrawTransBmp<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, hBmp, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DrawBitmap<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, hBmp, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:waheld9z]
Bug in TBtnBmp [Solved]
Antonio, no, it doesn't work fine, sorry: - the bitmap is expanded to fill all the button - there is no 3d effect - the bitmap is not centered EMG
Bug in TBtnBmp [Solved]
Enrico, The above method Paint() works fine here on a window: [img:31504bxy]https&#58;//bitbucket&#46;org/fivetech/screenshots/downloads/enrico_btnbmp_support&#46;jpg[/img:31504bxy]
Bug in TBtnBmp [Solved]
Enrico, Yes I know it, its only a test. Its not completed yet. Now I am going to use it from a dialog and there the differences start (and that is what I don't want). thanks for your testings <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Bug in TBtnBmp [Solved]
Now, on a dialog the differences begin: Now searching why that inset border appears [img:2csqxur2]https&#58;//bitbucket&#46;org/fivetech/screenshots/downloads/enrico_btnbmp_support2&#46;jpg[/img:2csqxur2]
Bug in TBtnBmp [Solved]
Enrico, Could you please test this Class TBtnBmp Method Paint() (warning: it is not finished yet) and let me know if the results are getting better for you ? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> thanks [code=fw:2fp3qzrt]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aInfo := ::<span style="color: #000000;">DispBegin</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nTop, nLeft<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hBmp := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! IsWindowEnabled<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap3</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">hBitmap3</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nBtn := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! IsWindowEnabled<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span> .and. ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap3</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">3</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lMOver</span> .and. ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lTransparent</span><br />&nbsp; &nbsp; &nbsp; SetBrushOrgEx<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, nBmpWidth<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span> - ::<span style="color: #000000;">nLeft</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nBmpHeight<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span> - ::<span style="color: #000000;">nTop</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; FillRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bClrGrad</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FillRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">aGrad</span> != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GradientFill<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, ::<span style="color: #000000;">nHeight</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">aGrad</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;nTop &nbsp;= <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nHeight</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">&#40;</span> nBmpHeight<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nLeft = <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nWidth</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">&#40;</span> nBmpWidth<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBmpTransparent</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> SetAlpha<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .and. ::<span style="color: #000000;">aAlpha</span><span style="color: #000000;">&#91;</span> nBtn <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ABPaint<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, nTop + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLeft + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, hBmp, ::<span style="color: #000000;">nAlphaLevel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DrawTransBmp<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, hBmp, nTop + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nLeft + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, nBmpWidth<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nBmpHeight<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DrawBitmap<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, hBmp, nTop + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLeft + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, nBmpWidth<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nBmpHeight<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:2fp3qzrt]
Bug in TBtnBmp [Solved]
Antonio, yes it getting better but: - bitmaps are not painted transparently - 3D effect is missing - bitmaps (on dialogs) are not centered EMG
Bug in TBtnBmp [Solved]
Enrico, I have finally reorganized Class TBtnBmp Method Paint() and now see how it looks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> [code=fw:ox63rc1x]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br />   <span style="color: #00C800;">local</span> aInfo := ::<span style="color: #000000;">DispBegin</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   ::<span style="color: #000000;">GetBmp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>  <br /><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span><br />      ::<span style="color: #000000;">PaintBackGroundAs20072010</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span>   <br />      ::<span style="color: #000000;">PaintBackGroundStandard</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span>   <br /><br />   ::<span style="color: #000000;">PaintBitmap</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   ::<span style="color: #000000;">PaintCaption</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br />   ::<span style="color: #000000;">PaintBorder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oPopup</span> != <span style="color: #00C800;">nil</span><br />      ::<span style="color: #000000;">PaintPopupSection</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span>   <br /><br />   ::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:ox63rc1x] I am sending it to you by email, in case you want to try it. Still it may miss some changes, thus I appreciate your feedback, thanks!
Bug in TBtnBmp [Solved]
Antonio, it looks better but: - 3D effect is missing - bitmaps (on dialogs) are not centered EMG
Bug in TBtnBmp [Solved]
Enrico, Do you mean 3D effect for buttons on dialogs ?
Bug in TBtnBmp [Solved]
Antonio, yes, Sir, exactly! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
Bug in TBtnBmp [Solved]
Enrico, They look like "inset", right ? Like this one, right ? <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?p=161582#p161582">viewtopic.php?p=161582#p161582</a><!-- l -->
Bug in TBtnBmp [Solved]
Antonio, no, the other way around. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> I can send you an image, if you need it. EMG
Bug in TBtnBmp [Solved]
Enrico, Yes, please post a screenshot, thanks
Bug in TBtnBmp [Solved]
Antonio, sent to your private email. EMG
Bug in TBtnBmp [Solved]
Any news? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
Bug in TBtnBmp [Solved]
Enrico, I just answered your latest email about it, that I missed
Bug in TBtnBmp [Solved]
Enrico, I have modified Class TBtnBmp Method PaintBorder(), now your example seems ok. I am emailing you the most recent Class TBtnBmp and wait for your feedback, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Bug in TBtnBmp [Solved]
Antonio, it's getting better, but the raised effect vanishes when the mouse is over the button. Almost done! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
Bug in TBtnBmp [Solved]
Enrico, In your btn.prg example, it keeps the 3d border here when the mouse is over
Bug in TBtnBmp [Solved]
Antonio, I checked again and the 3d border goes aways when the mouse is over. <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? --> EMG
Bug in TBtnBmp [Solved]
Enrico, Have you tried it with FWH 14.07 ?
Bug in TBtnBmp [Solved]
Antonio, yes, just tried: no 3d border when mouse is over. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG
Bug in TBtnBmp [Solved]
Enrico, Please try this EXE, thanks: [url:mxdavv37]https&#58;//bitbucket&#46;org/fivetech/fivewin-contributions/downloads/btn&#46;exe[/url:mxdavv37]
Bug in TBtnBmp [Solved]
Antonio, your exe works fine. Can you send me the exact PRG and RC you are using? What am I missing? EMG
Bug in TBtnBmp [Solved]
Enrico, I just modified this: [code=fw:qoqwhiw3]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"TEST"</span> NOROUND</div>[/code:qoqwhiw3] Please try it
Bug in TBtnBmp [Solved]
Antonio, tried: no change. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG
Bug in TBtnBmp [Solved]
Enrico, Are you already using FWH 14.07 ?
Bug in TBtnBmp [Solved]
Antonio, yes. I'm very confused... EMG
Bug in TBtnBmp [Solved]
Enrico, I sent you several modified Class TBtnBmp, maybe you are still linking one of them ?
Bug in TBtnBmp [Solved]
Antonio, no, I'm using clean latest FWH. Can you try using the downloaded FWH package? Maybe you have changed something in the last minute? EMG
Bug in TBtnBmp [Solved]
Enrico, I just downloaded FWH 14.07, went to samples folder, did a buildh btn, and the EXE is working fine. Really strange. Could you test it on another computer ?
Bug in TBtnBmp [Solved]
Antonio, the raised effect doesn't go away if I comment out this refresh: [code=fw:3stpisqw]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> MouseMove<span style="color: #000000;">&#40;</span> nRow, nCol, nKeyFlags <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lMOver</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lMOver</span> = .T.<br /><span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp;::Refresh()</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;</div>[/code:3stpisqw] Is it a clue? EMG
Bug in TBtnBmp [Solved]
Enrico, Thats no a solution, as you are avoiding the repainting of the control. Do you have virtualbox ? if you don't have another PC at hand, you may use one virtual and try it there.
Bug in TBtnBmp [Solved]
Antonio, your EXE works fine here too so what's the point to test mine on another PC? Anyway, I just tried on my old XP machine: no change. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG
Bug in TBtnBmp [Solved]
Antonio, the problem seems to be located here: [code=fw:2rnb4ddq]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> PaintBorder<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nAdjustBorder := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span><br />&nbsp; &nbsp; &nbsp; nAdjustBorder = <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lBorder</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lBarBtn</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lMOver</span> .and. ::<span style="color: #000000;">lBoxSelect</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lRound</span> .and. ! ::<span style="color: #000000;">lEllipse</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WndBox2007<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, nAdjustBorder, nAdjustBorder,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nHeight</span> - nAdjustBorder - <span style="color: #000000;">1</span>, ::<span style="color: #000000;">nWidth</span> - nAdjustBorder - <span style="color: #000000;">1</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">221</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">155</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lPressed</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WndRaised<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WndInset<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span> &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lEllipse</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">DrawEllipse</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">221</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">155</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lRound</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RoundBox<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span>, ::<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">3</span>, ::<span style="color: #000000;">nHeight</span> - <span style="color: #000000;">3</span>, <span style="color: #000000;">6</span>, <span style="color: #000000;">6</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">221</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">155</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lPressed</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WndRaised<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WndInset<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span></div>[/code:2rnb4ddq] As you can see, in the case of ::lRound = .T. (that is the default) we don't have a raised border. With NOROUND clause it works fine. EMG
Bug in TBtnBmp [Solved]
Enrico, ok, thats what I told you: thst only using NOROUND was working fine. Now the question is: why lRound is set to .T. by default ? Try to set it .F. by default and then it should work fine.
Bug in TBtnBmp [Solved]
Enrico, Please place this MsgBeep() calls that I used here: [code=fw:38m9xi4j]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> PaintBorder<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nAdjustBorder := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span><br />&nbsp; &nbsp; &nbsp; nAdjustBorder = <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lBorder</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lBarBtn</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lMOver</span> .and. ::<span style="color: #000000;">lBoxSelect</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lRound</span> .and. ! ::<span style="color: #000000;">lEllipse</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WndBox2007<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, nAdjustBorder, nAdjustBorder,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nHeight</span> - nAdjustBorder - <span style="color: #000000;">1</span>, ::<span style="color: #000000;">nWidth</span> - nAdjustBorder - <span style="color: #000000;">1</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">221</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">155</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgBeep<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lPressed</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WndRaised<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WndInset<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span> &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lEllipse</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">DrawEllipse</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">221</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">155</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lRound</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RoundBox<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span>, ::<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">3</span>, ::<span style="color: #000000;">nHeight</span> - <span style="color: #000000;">3</span>, <span style="color: #000000;">6</span>, <span style="color: #000000;">6</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">221</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">155</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span> &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lPressed</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WndRaised<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WndInset<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBorder</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MsgBeep<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lPressed</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WndRaised<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span> &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WndInset<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:38m9xi4j] Here I hear a beep when the mouse comes over the button and again when the mouse goes away from the button. Please check if you get the same beeps, thanks
Bug in TBtnBmp [Solved]
Antonio, [quote="Antonio Linares":35wkamty]Enrico, ok, thats what I told you: thst only using NOROUND was working fine. Now the question is: why lRound is set to .T. by default ? Try to set it .F. by default and then it should work fine.[/quote:35wkamty] This prints .T. no matter how I set lRound (INIT and redefine method default). Why? [code=fw:35wkamty]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> PaintBorder<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nAdjustBorder := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span><br />&nbsp; &nbsp; &nbsp; nAdjustBorder = <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lBorder</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lBarBtn</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lMOver</span> .and. ::<span style="color: #000000;">lBoxSelect</span><br />? ::<span style="color: #000000;">lRound</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lRound</span> .and. ! ::<span style="color: #000000;">lEllipse</span></div>[/code:35wkamty] EMG
Bug in TBtnBmp [Solved]
Enrico, Please help me to locate the error, I am very busy with EasyReport, sorry, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Bug in TBtnBmp [Solved]
[quote="Antonio Linares":2z3wtfpd]Enrico, Please help me to locate the error, I am very busy with EasyReport, sorry, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:2z3wtfpd] Ok. lRound is .T. because the REDEFINE BTNBMP command instructs so (NOROUND clause set lRound to .F.). Solved adding clause NOROUND. Now it seems to work fine. There is one more difference, though: on click, the bitmap goes down but the prompt don't. Is this what you want? EMG
Bug in TBtnBmp [Solved]
Enrico, Now the caption also moves <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> [code=fw:1w49qndo]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> PaintCaption<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nStyle, nClr<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hOldFont, aRect, lMultiline, cWord, cWord2<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nOffset, nMaxWidth, nLine<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nTxtTop := <span style="color: #000000;">0</span>, nTxtLeft := <span style="color: #000000;">6</span>, nTxtRight := ::<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">6</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nTxtHeight, nAdjust := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nLayOut := ::<span style="color: #000000;">nLayOut</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">oPopup</span> != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; nTxtRight -= <span style="color: #000000;">12</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oFont</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">GetFont</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; lMultiLine = ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">&#41;</span> .and. CRLF $ ::<span style="color: #000000;">cCaption</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> lMultiLine<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cWord = cStrWord<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cCaption</span>, nOffset, CRLF <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">while</span> nOffset < Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nMaxWidth = <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> nMaxWidth,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Len<span style="color: #000000;">&#40;</span> cWord2 := cStrWord<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cCaption</span>, @nOffset, CRLF <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> cWord <span style="color: #000000;">&#41;</span> < nMaxWidth<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cWord = cWord2<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLine = MLCount<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cWord = ::<span style="color: #000000;">cCaption</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; nStyle = nOr<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nLayOut</span> == <span style="color: #000000;">0</span>, DT_CENTER, nLayOut <span style="color: #000000;">&#41;</span>, DT_WORDBREAK ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nLayOut</span> % <span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, DT_VCENTER, DT_TOP <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; nClr = <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> IsWindowEnabled<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nClrText</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lDisColor</span>, CLR_HGRAY, ::<span style="color: #000000;">nClrTextDis</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; SetTextColor<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ValType<span style="color: #000000;">&#40;</span> nClr <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"B"</span>, Eval<span style="color: #000000;">&#40;</span> nClr, ::<span style="color: #000000;">lMOver</span> <span style="color: #000000;">&#41;</span>, nClr <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; SetBkMode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oFont</span> != <span style="color: #00C800;">nil</span> .or. ::<span style="color: #000000;">oFont</span> != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hOldFont = SelectObject<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">oFont</span>:<span style="color: #000000;">hFont</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; aRect = <span style="color: #000000;">&#123;</span> nTxtTop + nAdjust, nTxtLeft + nAdjust, ::<span style="color: #000000;">nHeight</span> + nAdjust - <span style="color: #000000;">4</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nTxtRight + nAdjust <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; lMultiLine = <span style="color: #000000;">&#40;</span> nTxtHeight := DrawText<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">cCaption</span>, aRect,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nOr<span style="color: #000000;">&#40;</span> DT_WORDBREAK, DT_CALCRECT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DrawText<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">cCaption</span>, aRect, nOr<span style="color: #000000;">&#40;</span> DT_SINGLELINE, DT_CALCRECT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nLayOut</span> == <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nStyle &nbsp; &nbsp; = nOr<span style="color: #000000;">&#40;</span> DT_CENTER, DT_WORDBREAK <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = aRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> - nTxtHeight<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nLayOut</span> == <span style="color: #000000;">3</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lPressed</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span>++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span>++<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span> &nbsp; <br /><br />&nbsp; &nbsp; &nbsp; DrawText<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">cCaption</span>, aRect, nStyle &nbsp;<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; SelectObject<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, hOldFont <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1w49qndo]
Bug in TBtnBmp [Solved]
Antonio, great! Now btnbmp seems to work like the old version. Thank you! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
Bug in TBtnBmp and dialogs
In the following sample, please place the mouse pointer over the button and try to close the dialog using ALT-F4. It will not close. [code:h3yhbgap]#include "Fivewin&#46;ch" FUNCTION MAIN&#40;&#41; LOCAL oDlg DEFINE DIALOG oDlg @ 1, 1 BTNBMP; FILE "C&#58;\FWH\BITMAPS\OPEN&#46;BMP"; NOBORDER ACTIVATE DIALOG oDlg; CENTER RETURN NIL[/code:h3yhbgap] EMG
Bug in TBtnBmp and dialogs
Any news? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
Bug in TBtnBmp and dialogs
Enrico, Fixed <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Please add this code to Class TDialog: [code:1h6axnqv] METHOD SysCommand&#40; nWParam, nLParam &#41; CLASS TDialog if nWParam == SC_CLOSE &#46;and&#46; &#58;&#58;lModal if GetCapture&#40;&#41; != 0 // New ! ReleaseCapture&#40;&#41; // New ! endif // New ! return &#46;f&#46; endif &#46;&#46;&#46; [/code:1h6axnqv]
Bug in TBtnBmp and dialogs
Is it possible that the problem doesn't occur when creating dialogs from resources ? I don't have the problem in my application. Thanks.
Bug in TBtnBmp and dialogs
Michel, Have you tested with FWH 7.12 ?
Bug in TBtnBmp and dialogs
[quote="Antonio Linares":14i2456p]Enrico, Fixed <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Please add this code to Class TDialog:[/quote:14i2456p] Thank you! EMG
Bug in TBtnBmp and dialogs
antonio, this is for 7.11 or 7.12 or too?
Bug in TBtnBmp and dialogs
Norberto, For both and previous versions too
Bug in TBtnBmp prompt
In the following sample the prompt is not splitted across two lines and two little squares are displayed instead: [code:33f79spz]#include "Fivewin&#46;ch" FUNCTION MAIN&#40;&#41; LOCAL oWnd, oBar DEFINE WINDOW oWnd DEFINE BUTTONBAR oBar OF oWnd 2007; SIZE 50, 70 DEFINE BUTTON OF oBar; ACTION oWnd&#58;End&#40;&#41;; PROMPT "Close" + CRLF + "Window" ACTIVATE WINDOW oWnd RETURN NIL[/code:33f79spz] EMG
Bug in TBtnBmp prompt
Enrico, In Class TBtnBmp please replace: [code:3h9j3ah8] &#58;&#58;Say&#40; 2 * &#40; &#58;&#58;nHeight / 3 &#41; + If&#40; &#58;&#58;lPressed, 1, 0 &#41;,; &#40; &#58;&#58;nWidth / 2 &#41; - &#40; GetTextWidth&#40; &#58;&#58;hDC, &#58;&#58;cCaption,; &#58;&#58;oWnd&#58;oFont&#58;hFont &#41; / 2 &#41; + If&#40; &#58;&#58;lPressed, 1, 0 &#41;,; &#58;&#58;cCaption, nClr,, &#58;&#58;oWnd&#58;oFont, &#46;T&#46;, &#46;T&#46; &#41; [/code:3h9j3ah8] with [code:3h9j3ah8] nTop = 2 * &#40; &#58;&#58;nHeight / 3 &#41; + If&#40; &#58;&#58;lPressed, 1, 0 &#41; + If&#40; At&#40; CRLF, &#58;&#58;cCaption &#41; == 0, 5, 0 &#41; SetBkMode&#40; &#58;&#58;hDC, 1 &#41; hOldFont = SelectObject&#40; &#58;&#58;hDC, &#58;&#58;oWnd&#58;oFont&#58;hFont &#41; DrawText&#40; &#58;&#58;hDC, &#58;&#58;cCaption,; &#123; nTop - 5, If&#40; &#58;&#58;lPressed, 1, 0 &#41;, nTop + &#58;&#58;nHeight / 3, &#58;&#58;nWidth + If&#40; &#58;&#58;lPressed, 1, 0 &#41; &#125;,; nOr&#40; DT_VCENTER, DT_CENTER, DT_WORDBREAK &#41; &#41; SelectObject&#40; &#58;&#58;hDC, hOldFont &#41; [/code:3h9j3ah8] You need these defines: [code:3h9j3ah8] #define DT_CENTER 1 #define DT_VCENTER 4 #define DT_WORDBREAK 16 [/code:3h9j3ah8] [url=http&#58;//imageshack&#46;us:3h9j3ah8][img:3h9j3ah8]http&#58;//img48&#46;imageshack&#46;us/img48/6335/enricoeq8&#46;png[/img:3h9j3ah8][/url:3h9j3ah8] Thanks!
Bug in TBtnBmp prompt
I can wait for the new FWH release, thank you. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
Bug in TBtnBmp prompt
Enrico, It will be available by early December <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Bug in TBtnBmp prompt
Great! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
Bug in TBtnBmp prompt
Antonio, Have you modify msgitem ( clock and date ) on msgbar ?
Bug in TBtnBmp prompt
Silvio, No, not yet
Bug in TBtnBmp prompt
Antonio, I don't found this code in my BtnBmp.prg... My version is FWH 7.1 and I have this problem, when I use CRLF to "break" the text in more than 1 line text is displayed in same line and CRLF turn into a square character. Thanks! Maurilio
Bug in TBtnBmp prompt
Maurilio, Basically the function used to paint the text has to be (Window's) DrawText() instead of TextOut(). The published patch is for FWH 7.11. We have to build another for 7.01
Bug in TBtnBmp prompt
This modification is working for 2007 style only. For non 2007 style both lines of text are painted in the middle of the bitmap [url=http&#58;//img220&#46;imageshack&#46;us/my&#46;php?image=tbmpoz9&#46;png:1awif05t][img:1awif05t]http&#58;//img220&#46;imageshack&#46;us/img220/3185/tbmpoz9&#46;th&#46;png[/img:1awif05t][/url:1awif05t]
Bug in TBtnBmp prompt
Mr Antonio Can a fix be made available for multi-line prompts for tbar without 2007 style please?
Bug in TBtnBmp?
What is the reason for these lines in TBtnBmp:LostFocus() method? [code=fw:3tk9d4jg]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lPressed</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lPressed</span> := .f.<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span></div>[/code:3tk9d4jg] A negative effect is that a pressed button (using GoDown() method) switch to non-pressed status on lostfocus. Can I remove the above lines without side effects? EMG
Bug in TBtnBmp?
I just tried to comment out those lines and now the problem seems to be fixed. I can't see any side effects. Can I apply this fix in the FWH SVN? EMG
Bug in TBtnBmp?
Antonio? EMG
Bug in TBtnBmp?
Bumped up for Daniel
Bug in TBtnBmp?
Thanks Enrico already fixed and updated to SVN
Bug in TBtnBmp?
Thank you Daniel! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
Bug in TBtnBmp?
In the sample below, please click on the "Test" button and you will see the BtnBmp doesn't go away (while if you try with the Bitmap all is fine). [code=fw:23yjezqs]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">LOCAL</span> oDlg<br /><br />    <span style="color: #00C800;">LOCAL</span> oCtl<br /><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />           <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>, <span style="color: #000000;">600</span><br /><br /><span style="color: #B900B9;">//    @ 1, 1 BITMAP oCtl</span><br />    @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BTNBMP</span> oCtl<br /><br />    @ <span style="color: #000000;">7</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span>;<br />           <span style="color: #0000ff;">ACTION</span> oCtl:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />             <span style="color: #0000ff;">CENTER</span><br /><br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:23yjezqs] EMG
Bug in TBtnBmp?
Enrico, Yes, it seems. [code=fw:2aok4sdu]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oCtl<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> cVar := <span style="color: #ff0000;">"Hola"</span><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> nVar := <span style="color: #000000;">1</span><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> lVar := .t.<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>, <span style="color: #000000;">600</span><br /><br /><span style="color: #B900B9;">// &nbsp; &nbsp;@ 1, 1 BITMAP oCtl &nbsp; &nbsp;//yes</span><br />&nbsp; &nbsp; @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BTNBMP</span> oCtl <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"BtnBmp"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>,<span style="color: #000000;">14</span> <span style="color: #B900B9;">//NO</span><br /><span style="color: #B900B9;">// &nbsp; &nbsp;@ 1, 1 BUTTON oCtl PROMPT "Button" &nbsp; //yes</span><br /><span style="color: #B900B9;">// &nbsp; &nbsp;@ 1, 1 SAY &nbsp; &nbsp;oCtl PROMPT "HOLA" &nbsp; &nbsp;//yes</span><br /><span style="color: #B900B9;">// &nbsp; &nbsp;@ 1, 1 CHECKBOX &nbsp;oCtl VAR lVar &nbsp; &nbsp; &nbsp;//yes</span><br /><span style="color: #B900B9;">// &nbsp; &nbsp;@ 1, 1 RADIO oCtl VAR nVar ITEMS "&One", "&Two" SIZE 150, 25 &nbsp;//yes</span><br /><span style="color: #B900B9;">// &nbsp; &nbsp;@ 1, 1 GET oCtl VAR cVAR SIZE 40,12 &nbsp;//yes</span><br /><span style="color: #B900B9;">// &nbsp; &nbsp;@ 1, 1 COMBOBOX oCtl VAR nVar ITEMS {"1","2","3"} &nbsp; //yes</span><br /><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">7</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> oCtl:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">CENTER</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:2aok4sdu]
Bug in TBtnBmp?
Any ideas? I think the problem is inside Destroy() method. EMG
Bug in TBtnBmp?
[code=fw:209bmlio]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oDlg, oCtl<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>, <span style="color: #000000;">600</span><br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">// @ 1, 1 BITMAP oCtl</span><br />&nbsp; &nbsp; @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BTNBMP</span> oCtl <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Visible"</span><br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">/* // error<br />&nbsp; &nbsp; @ 7, 1 BUTTON "Test";<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ACTION oCtl:End()<br />&nbsp; &nbsp; */</span><br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">// Invisible</span><br />&nbsp; &nbsp; @ <span style="color: #000000;">7</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Hide"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> oCtl:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">// Visible</span><br />&nbsp; &nbsp; @ <span style="color: #000000;">9</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Show"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> oCtl:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">11</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Exit"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> CANCEL <span style="color: #0000ff;">UPDATE</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp;</div>[/code:209bmlio]
Bug in TBtnBmp?
João, Thank you, but I'd want to End() it, not to just hide it. EMG
Bug in TBtnBmp?
[code=fw:2r4bxfe7]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oDlg, oCtl<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>, <span style="color: #000000;">600</span><br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">// @ 1, 1 BITMAP oCtl</span><br />&nbsp; &nbsp; @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BTNBMP</span> oCtl <span style="color: #0000ff;">PROMPt</span> <span style="color: #ff0000;">"Visible"</span><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">3</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test1"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> oCtl:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">UpDate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">5</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test2"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> oCtl:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oCtl:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">UpDate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">// Invisible</span><br />&nbsp; &nbsp; @ <span style="color: #000000;">7</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Hide"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> oCtl:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">// Visible</span><br />&nbsp; &nbsp; @ <span style="color: #000000;">9</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Show"</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> oCtl:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">11</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Exit"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> CANCEL <span style="color: #0000ff;">UPDATE</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp;</div>[/code:2r4bxfe7] 
Bug in TBtnBmp?
João, you missed the point: there is a problem in TBtmBmp Destroy() method that prevents the control to End(). It needs to be fixed. EMG
Bug in TBtnClr
In tbtnclr.prg there is a public function called PickColor that is already defined in pickcolor.prg.
Bug in TBtnClr
Dear Enrico, tbtnclr.prg modified as: static Function PickColor(nColor,oControl) many thanks for your feedback
Bug in TBtnClr
Thank you.
Bug in TButton
The following sample shows the problem. Try to put any character in the GET and then hit ALT-C. You will see that the DIALOG won't close. On the contrary, if you click on the button the DIALOG will close. [code:2ybzy861]#include "Fivewin&#46;ch" FUNCTION MAIN&#40;&#41; LOCAL oDlg LOCAL cVar &#58;= SPACE&#40; 20 &#41; DEFINE DIALOG oDlg @ 1, 1 GET cVar; VALID !EMPTY&#40; cVar &#41; @ 3, 1 BUTTON "&Close"; ACTION oDlg&#58;End&#40;&#41; ACTIVATE DIALOG oDlg; CENTER RETURN NIL[/code:2ybzy861] EMG