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://i57.tinypic.com/90aots.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;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oDlg<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: #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 /> 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 /> <span style="color: #0000ff;">ADJUST</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:3fjrnfvv]
EMG
|
Bug in TBtnBmp [Solved]
|
Antonio,
[quote="Antonio Linares":3cm1eqmj][img:3cm1eqmj]http://i57.tinypic.com/90aots.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;">(</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;">)</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;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br /> <span style="color: #B900B9;">// local aInfo := ::DispBegin()</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lTransparent</span><br /> SetBrushOrgEx<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nBmpWidth<span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> - ::<span style="color: #000000;">nLeft</span>,;<br /> nBmpHeight<span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> - ::<span style="color: #000000;">nTop</span> <span style="color: #000000;">)</span><br /> FillRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">bClrGrad</span> <span style="color: #000000;">)</span><br /> FillRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">aGrad</span> != <span style="color: #00C800;">nil</span><br /> GradientFill<span style="color: #000000;">(</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;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span> <br /> <span style="color: #00C800;">endif</span><br /><br /> <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;">(</span><span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> hBmp := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span>,;<br /> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! IsWindowEnabled<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap3</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hBitmap3</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> nBtn := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! IsWindowEnabled<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span> .and. ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap3</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #000000;">3</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lTransparent</span><br /> SetBrushOrgEx<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nBmpWidth<span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> - ::<span style="color: #000000;">nLeft</span>,;<br /> nBmpHeight<span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> - ::<span style="color: #000000;">nTop</span> <span style="color: #000000;">)</span><br /> FillRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">bClrGrad</span> <span style="color: #000000;">)</span><br /> FillRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">aGrad</span> != <span style="color: #00C800;">nil</span><br /> GradientFill<span style="color: #000000;">(</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;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span> <br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBmpTransparent</span><br /> <span style="color: #00C800;">if</span> SetAlpha<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .and. ::<span style="color: #000000;">aAlpha</span><span style="color: #000000;">[</span> nBtn <span style="color: #000000;">]</span><br /> ABPaint<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>,;<br /> hBmp, ::<span style="color: #000000;">nAlphaLevel</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> DrawTransBmp<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hBmp, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">nHeight</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> DrawTransBmp<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hBmp, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">nHeight</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">(</span> aInfo <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </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;">(</span><span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> hBmp := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span>,;<br /> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! IsWindowEnabled<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap3</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hBitmap3</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> nBtn := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! IsWindowEnabled<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span> .and. ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap3</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #000000;">3</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lTransparent</span><br /> SetBrushOrgEx<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nBmpWidth<span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> - ::<span style="color: #000000;">nLeft</span>,;<br /> nBmpHeight<span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> - ::<span style="color: #000000;">nTop</span> <span style="color: #000000;">)</span><br /> FillRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">bClrGrad</span> <span style="color: #000000;">)</span><br /> FillRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">aGrad</span> != <span style="color: #00C800;">nil</span><br /> GradientFill<span style="color: #000000;">(</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;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span> <br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBmpTransparent</span><br /> <span style="color: #00C800;">if</span> SetAlpha<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .and. ::<span style="color: #000000;">aAlpha</span><span style="color: #000000;">[</span> nBtn <span style="color: #000000;">]</span><br /> ABPaint<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>,;<br /> hBmp, ::<span style="color: #000000;">nAlphaLevel</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> DrawTransBmp<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hBmp, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">nHeight</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> DrawBitmap<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hBmp, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">nHeight</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">(</span> aInfo <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </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://bitbucket.org/fivetech/screenshots/downloads/enrico_btnbmp_support.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://bitbucket.org/fivetech/screenshots/downloads/enrico_btnbmp_support2.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;">(</span><span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> nTop, nLeft<br /><br /> <span style="color: #00C800;">local</span> hBmp := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span>,;<br /> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! IsWindowEnabled<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap3</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hBitmap3</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> nBtn := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. ;<br /> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! IsWindowEnabled<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span> .and. ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap3</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #000000;">3</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lTransparent</span><br /> SetBrushOrgEx<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nBmpWidth<span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> - ::<span style="color: #000000;">nLeft</span>,;<br /> nBmpHeight<span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> - ::<span style="color: #000000;">nTop</span> <span style="color: #000000;">)</span><br /> FillRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">bClrGrad</span> <span style="color: #000000;">)</span><br /> FillRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">aGrad</span> != <span style="color: #00C800;">nil</span><br /> GradientFill<span style="color: #000000;">(</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;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span> <br /> <span style="color: #00C800;">endif</span><br /><br /> nTop = <span style="color: #000000;">(</span> ::<span style="color: #000000;">nHeight</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> - <span style="color: #000000;">(</span> nBmpHeight<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> nLeft = <span style="color: #000000;">(</span> ::<span style="color: #000000;">nWidth</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> - <span style="color: #000000;">(</span> nBmpWidth<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBmpTransparent</span><br /> <span style="color: #00C800;">if</span> SetAlpha<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .and. ::<span style="color: #000000;">aAlpha</span><span style="color: #000000;">[</span> nBtn <span style="color: #000000;">]</span><br /> ABPaint<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nTop + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>,;<br /> nLeft + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, hBmp, ::<span style="color: #000000;">nAlphaLevel</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> DrawTransBmp<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hBmp, nTop + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>,;<br /> nLeft + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, nBmpWidth<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span>,;<br /> nBmpHeight<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> DrawBitmap<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hBmp, nTop + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>,;<br /> nLeft + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, nBmpWidth<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span>,;<br /> nBmpHeight<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">(</span> aInfo <span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">GetBmp</span><span style="color: #000000;">(</span><span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span> <br /> ::<span style="color: #000000;">PaintBackGroundStandard</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span> <br /><br /> ::<span style="color: #000000;">PaintBitmap</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">PaintCaption</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> ::<span style="color: #000000;">PaintBorder</span><span style="color: #000000;">(</span><span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span> <br /><br /> ::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">(</span> aInfo <span style="color: #000000;">)</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://bitbucket.org/fivetech/fivewin-contributions/downloads/btn.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;"> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span>;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg;<br /> <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;">(</span> nRow, nCol, nKeyFlags <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br /> <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lMOver</span><br /> ::<span style="color: #000000;">lMOver</span> = .T.<br /><span style="color: #B900B9;">// ::Refresh()</span><br /> <span style="color: #00C800;">endif</span><br /> </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;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br /> <span style="color: #00C800;">local</span> nAdjustBorder := <span style="color: #000000;">0</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span><br /> nAdjustBorder = <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lBorder</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lBarBtn</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lMOver</span> .and. ::<span style="color: #000000;">lBoxSelect</span><br /> <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lRound</span> .and. ! ::<span style="color: #000000;">lEllipse</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span><br /> WndBox2007<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nAdjustBorder, nAdjustBorder,;<br /> ::<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 /> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">221</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">155</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lPressed</span><br /> WndRaised<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> WndInset<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span> <br /> <span style="color: #00C800;">endif</span> <br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lEllipse</span><br /> ::<span style="color: #000000;">DrawEllipse</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">221</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">155</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lRound</span><br /> RoundBox<span style="color: #000000;">(</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 /> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">221</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">155</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span> <br /> <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lPressed</span><br /> WndRaised<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> WndInset<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span> <br /> <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;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br /> <span style="color: #00C800;">local</span> nAdjustBorder := <span style="color: #000000;">0</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span><br /> nAdjustBorder = <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lBorder</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lBarBtn</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lMOver</span> .and. ::<span style="color: #000000;">lBoxSelect</span><br /> <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lRound</span> .and. ! ::<span style="color: #000000;">lEllipse</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span><br /> WndBox2007<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nAdjustBorder, nAdjustBorder,;<br /> ::<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 /> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">221</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">155</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> MsgBeep<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lPressed</span><br /> WndRaised<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> WndInset<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span> <br /> <span style="color: #00C800;">endif</span> <br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lEllipse</span><br /> ::<span style="color: #000000;">DrawEllipse</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">221</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">155</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lRound</span><br /> RoundBox<span style="color: #000000;">(</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 /> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">221</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">155</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span> <br /> <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lPressed</span><br /> WndRaised<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> WndInset<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span> <br /> <span style="color: #00C800;">endif</span> <br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBorder</span><br /> MsgBeep<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lPressed</span><br /> <span style="color: #00C800;">if</span> ! <span style="color: #000000;">(</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span> <span style="color: #000000;">)</span><br /> WndRaised<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span> <br /> WndInset<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span> <br /> <span style="color: #00C800;">endif</span> <br /> <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;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br /> <span style="color: #00C800;">local</span> nAdjustBorder := <span style="color: #000000;">0</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span><br /> nAdjustBorder = <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lBorder</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lBarBtn</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <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 /> <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;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br /> <span style="color: #00C800;">local</span> nStyle, nClr<br /> <span style="color: #00C800;">local</span> hOldFont, aRect, lMultiline, cWord, cWord2<br /> <span style="color: #00C800;">local</span> nOffset, nMaxWidth, nLine<br /> <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 /> <span style="color: #00C800;">local</span> nTxtHeight, nAdjust := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nLayOut := ::<span style="color: #000000;">nLayOut</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oPopup</span> != <span style="color: #00C800;">nil</span><br /> nTxtRight -= <span style="color: #000000;">12</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oFont</span> == <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">GetFont</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> lMultiLine = ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span> .and. CRLF $ ::<span style="color: #000000;">cCaption</span><br /><br /> <span style="color: #00C800;">if</span> lMultiLine<br /> cWord = cStrWord<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span>, nOffset, CRLF <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">while</span> nOffset < Len<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span><br /> nMaxWidth = <span style="color: #0000ff;">Max</span><span style="color: #000000;">(</span> nMaxWidth,;<br /> Len<span style="color: #000000;">(</span> cWord2 := cStrWord<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span>, @nOffset, CRLF <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> Len<span style="color: #000000;">(</span> cWord <span style="color: #000000;">)</span> < nMaxWidth<br /> cWord = cWord2<br /> <span style="color: #00C800;">endif</span><br /> end<br /><br /> nLine = MLCount<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> cWord = ::<span style="color: #000000;">cCaption</span><br /> <span style="color: #00C800;">endif</span><br /><br /> nStyle = nOr<span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">nLayOut</span> == <span style="color: #000000;">0</span>, DT_CENTER, nLayOut <span style="color: #000000;">)</span>, DT_WORDBREAK ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</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;">)</span> <span style="color: #000000;">)</span><br /><br /> nClr = <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> IsWindowEnabled<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nClrText</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lDisColor</span>, CLR_HGRAY, ::<span style="color: #000000;">nClrTextDis</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> SetTextColor<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> nClr <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span>, Eval<span style="color: #000000;">(</span> nClr, ::<span style="color: #000000;">lMOver</span> <span style="color: #000000;">)</span>, nClr <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> SetBkMode<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /><br /> <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 /> hOldFont = SelectObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">oFont</span>:<span style="color: #000000;">hFont</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> aRect = <span style="color: #000000;">{</span> nTxtTop + nAdjust, nTxtLeft + nAdjust, ::<span style="color: #000000;">nHeight</span> + nAdjust - <span style="color: #000000;">4</span>,;<br /> nTxtRight + nAdjust <span style="color: #000000;">}</span><br /> lMultiLine = <span style="color: #000000;">(</span> nTxtHeight := DrawText<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">cCaption</span>, aRect,;<br /> nOr<span style="color: #000000;">(</span> DT_WORDBREAK, DT_CALCRECT <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> > ;<br /> DrawText<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">cCaption</span>, aRect, nOr<span style="color: #000000;">(</span> DT_SINGLELINE, DT_CALCRECT <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nLayOut</span> == <span style="color: #000000;">1</span><br /> nStyle = nOr<span style="color: #000000;">(</span> DT_CENTER, DT_WORDBREAK <span style="color: #000000;">)</span><br /> aRect<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = aRect<span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> - nTxtHeight<br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nLayOut</span> == <span style="color: #000000;">3</span><br /> aRect<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">2</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lPressed</span><br /> aRect<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>++<br /> aRect<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>++<br /> aRect<span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>++<br /> aRect<span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span>++<br /> <span style="color: #00C800;">endif</span> <br /><br /> DrawText<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">cCaption</span>, aRect, nStyle <span style="color: #000000;">)</span><br /><br /> SelectObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hOldFont <span style="color: #000000;">)</span><br /> <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.ch"
FUNCTION MAIN()
LOCAL oDlg
DEFINE DIALOG oDlg
@ 1, 1 BTNBMP;
FILE "C:\FWH\BITMAPS\OPEN.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( nWParam, nLParam ) CLASS TDialog
if nWParam == SC_CLOSE .and. ::lModal
if GetCapture() != 0 // New !
ReleaseCapture() // New !
endif // New !
return .f.
endif
...
[/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.ch"
FUNCTION MAIN()
LOCAL oWnd, oBar
DEFINE WINDOW oWnd
DEFINE BUTTONBAR oBar OF oWnd 2007;
SIZE 50, 70
DEFINE BUTTON OF oBar;
ACTION oWnd:End();
PROMPT "Close" + CRLF + "Window"
ACTIVATE WINDOW oWnd
RETURN NIL[/code:33f79spz]
EMG
|
Bug in TBtnBmp prompt
|
Enrico,
In Class TBtnBmp please replace:
[code:3h9j3ah8]
::Say( 2 * ( ::nHeight / 3 ) + If( ::lPressed, 1, 0 ),;
( ::nWidth / 2 ) - ( GetTextWidth( ::hDC, ::cCaption,;
::oWnd:oFont:hFont ) / 2 ) + If( ::lPressed, 1, 0 ),;
::cCaption, nClr,, ::oWnd:oFont, .T., .T. )
[/code:3h9j3ah8]
with
[code:3h9j3ah8]
nTop = 2 * ( ::nHeight / 3 ) + If( ::lPressed, 1, 0 ) + If( At( CRLF, ::cCaption ) == 0, 5, 0 )
SetBkMode( ::hDC, 1 )
hOldFont = SelectObject( ::hDC, ::oWnd:oFont:hFont )
DrawText( ::hDC, ::cCaption,;
{ nTop - 5, If( ::lPressed, 1, 0 ), nTop + ::nHeight / 3, ::nWidth + If( ::lPressed, 1, 0 ) },;
nOr( DT_VCENTER, DT_CENTER, DT_WORDBREAK ) )
SelectObject( ::hDC, hOldFont )
[/code:3h9j3ah8]
You need these defines:
[code:3h9j3ah8]
#define DT_CENTER 1
#define DT_VCENTER 4
#define DT_WORDBREAK 16
[/code:3h9j3ah8]
[url=http://imageshack.us:3h9j3ah8][img:3h9j3ah8]http://img48.imageshack.us/img48/6335/enricoeq8.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://img220.imageshack.us/my.php?image=tbmpoz9.png:1awif05t][img:1awif05t]http://img220.imageshack.us/img220/3185/tbmpoz9.th.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;"> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lPressed</span><br /> ::<span style="color: #000000;">lPressed</span> := .f.<br /> ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <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;">(</span><span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</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;"> <span style="color: #00C800;">LOCAL</span> oDlg<br /><br /> <span style="color: #00C800;">LOCAL</span> oCtl<br /><br /> <span style="color: #00C800;">LOCAL</span> cVar := <span style="color: #ff0000;">"Hola"</span><br /> <span style="color: #00C800;">LOCAL</span> nVar := <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">LOCAL</span> lVar := .t.<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 //yes</span><br /> @ <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;">// @ 1, 1 BUTTON oCtl PROMPT "Button" //yes</span><br /><span style="color: #B900B9;">// @ 1, 1 SAY oCtl PROMPT "HOLA" //yes</span><br /><span style="color: #B900B9;">// @ 1, 1 CHECKBOX oCtl VAR lVar //yes</span><br /><span style="color: #B900B9;">// @ 1, 1 RADIO oCtl VAR nVar ITEMS "&One", "&Two" SIZE 150, 25 //yes</span><br /><span style="color: #B900B9;">// @ 1, 1 GET oCtl VAR cVAR SIZE 40,12 //yes</span><br /><span style="color: #B900B9;">// @ 1, 1 COMBOBOX oCtl VAR nVar ITEMS {"1","2","3"} //yes</span><br /><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;">(</span><span style="color: #000000;">)</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: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;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oDlg, oCtl<br /><br /> <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 /> <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 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Visible"</span><br /><br /> <span style="color: #B900B9;">/* // error<br /> @ 7, 1 BUTTON "Test";<br /> ACTION oCtl:End()<br /> */</span><br /><br /> <span style="color: #B900B9;">// Invisible</span><br /> @ <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 /> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">(</span> oCtl:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Visible</span><br /> @ <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 /> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">(</span> oCtl:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <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 /> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> CANCEL <span style="color: #0000ff;">UPDATE</span><br /><br /> <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 /> </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;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oDlg, oCtl<br /><br /> <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 /> <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 <span style="color: #0000ff;">PROMPt</span> <span style="color: #ff0000;">"Visible"</span><br /><br /> @ <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 /> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">(</span> oCtl:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oDlg:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oDlg:<span style="color: #0000ff;">UpDate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <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 /> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">(</span> oCtl:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oCtl:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oDlg:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oDlg:<span style="color: #0000ff;">UpDate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Invisible</span><br /> @ <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 /> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">(</span> oCtl:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// Visible</span><br /> @ <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 /> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">(</span> oCtl:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <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 /> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> CANCEL <span style="color: #0000ff;">UPDATE</span><br /><br /> <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 /> </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.ch"
FUNCTION MAIN()
LOCAL oDlg
LOCAL cVar := SPACE( 20 )
DEFINE DIALOG oDlg
@ 1, 1 GET cVar;
VALID !EMPTY( cVar )
@ 3, 1 BUTTON "&Close";
ACTION oDlg:End()
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL[/code:2ybzy861]
EMG
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.