topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
|---|---|
Bug in TBar?
|
Daniel,
Thanks for your help again.
But also it is required to work with the program, click on buttons, open dialogs, treport, etc.
With the MessageBox at transbmp I am able to trace it as it shows the message, I can capture the screen and see stack calls.
It is not easy to trace it. Sorry.
Who is the author of TransBmp?.
|
Bug in TBar?
|
[quote="ukservice":16a398mz]Who is the author of TransBmp?.[/quote:16a398mz]
fivetech
[quote="ukservice":16a398mz]But also it is required to work with the program, click on buttons, open dialogs, treport, etc.[/quote:16a398mz]
it's really a hard test... i added a sysrefresh too, after 1:30 (more) continue stable the sample
|
Bug in TBar?
|
Other samples
More hard
[code=fw:36yo20l6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">define</span> <span style="color: #0000ff;">timer</span> oTimer <span style="color: #0000ff;">interval</span> <span style="color: #000000;">1000</span> <span style="color: #0000ff;">action</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> n++%<span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, oWnd:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> , , <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span> <span style="color: #000000;">)</span>, oWnd:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> , , <span style="color: #000000;">800</span>, <span style="color: #000000;">800</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, sysrefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">of</span> oWnd</div>[/code:36yo20l6]
|
Bug in TBar?
|
Daniel,
Thanks for helping.
[quote:29a0w2sa]ukservice wrote:
Who is the author of TransBmp?.
[/quote:29a0w2sa]
I mean the person.
I am afraid it can´t be traced just with a timer <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
The sequence of Transbmp is ok?.
What the bitmap can´t be created?.
[code=fw:29a0w2sa]<div class="fw" id="{CB}" style="font-family: monospace;">MessageBox<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"(2) Can't create bitmap!"</span>, <span style="color: #ff0000;">"Error"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /> </div>[/code:29a0w2sa]
And what about METHOD Paint() at CLASS TRBtn?. At the end of it [b:29a0w2sa]//ReleaseDC( ::hWnd, ::hDC ) [/b:29a0w2sa]is commented. I don´t know why.
Thanks again.
|
Bug in TBar?
|
[quote="ukservice":hul40iti]And what about METHOD Paint() at CLASS TRBtn?. At the end of it //ReleaseDC( ::hWnd, ::hDC ) is commented. I don´t know why.[/quote:hul40iti]
because is not necessary, it's automatically release
|
Bug in TBar?
|
Hello
it's a screenshot of a personal project... this system work around 12 hours daily and never show error (using ribbon and tabs)
work with socket, mysql, fivewin, fastreport
[img:1adwvfly]http://www.sitasoft.net/fivewin/screen/img1.png[/img:1adwvfly]
[img:1adwvfly]http://www.sitasoft.net/fivewin/screen/img2.png[/img:1adwvfly]
[img:1adwvfly]http://www.sitasoft.net/fivewin/screen/img3.png[/img:1adwvfly]
[img:1adwvfly]http://www.sitasoft.net/fivewin/screen/img4.png[/img:1adwvfly]
|
Bug in TBar?
|
Daniel,
Thanks again.
Did you interact with your software?.
Also, during my tests i found out sometimes a resource leak with checkres():
[code=fw:3kuexxr6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">FONT</span>,<span style="color: #000000;">1292505504</span>,TWINDOW:<span style="color: #000000;">GETFONT</span><span style="color: #000000;">(</span><span style="color: #000000;">2732</span><span style="color: #000000;">)</span>->TWINDOW:<span style="color: #00C800;">NEW</span><span style="color: #000000;">(</span><span style="color: #000000;">847</span><span style="color: #000000;">)</span>->MAIN<span style="color: #000000;">(</span><span style="color: #000000;">179</span><span style="color: #000000;">)</span><br /> </div>[/code:3kuexxr6]
Line in window.prg FW 11.1.1 is:
[code=fw:3kuexxr6]<div class="fw" id="{CB}" style="font-family: monospace;"> ::<span style="color: #000000;">GetFont</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span></div>[/code:3kuexxr6]
Main(179) is my DEFINE WINDOW:
[code=fw:3kuexxr6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWndMain <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">28</span>, <span style="color: #000000;">75</span> ; <br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"TEST"</span> ;<br /> <span style="color: #0000ff;">MENU</span> MenuMain<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> </div>[/code:3kuexxr6]
|
Bug in TBar?
|
[quote="ukservice":3folf2sh]Did you interact with your software?.[/quote:3folf2sh]
Yes, i used
[quote="ukservice":3folf2sh]Also, during my tests i found out sometimes a resource leak with checkres():
CODE: SELECT ALL EXPAND VIEW
FONT,1292505504,TWINDOW:GETFONT(2732)->TWINDOW:NEW(847)->MAIN(179)
[/quote:3folf2sh]
if your main windows, dont worry about that...
try to test, check resource before go in a module and check after go out of module
|
Bug in TBar?
|
Daniel,
This leak appears before QUIT, not in/between modules.
It may be related.
Why all resouces are NOT cleared by FWH before exiting the application?.
Thanks.
|
Bug in TBar?
|
[quote="ukservice":2ua9phiv]This leak appears before QUIT, not in/between modules.[/quote:2ua9phiv]
yes, i know
[quote="Daniel Garcia-Gil":2ua9phiv]try to test, check resource before go in a module and check after go out of module[/quote:2ua9phiv]
if you want report the results
[quote="ukservice":2ua9phiv]Why all resouces are NOT cleared by FWH before exiting the application?.[/quote:2ua9phiv]
really is no matter, all will be released after quit... when you say "Why all resouces are NOT cleared" what other gdi object is not release?
[quote="Daniel Garcia-Gil":2ua9phiv]Other samples
More hard
[code=fw:2ua9phiv]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">define</span> <span style="color: #0000ff;">timer</span> oTimer <span style="color: #0000ff;">interval</span> <span style="color: #000000;">1000</span> <span style="color: #0000ff;">action</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> n++%<span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, oWnd:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> , , <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span> <span style="color: #000000;">)</span>, oWnd:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> , , <span style="color: #000000;">800</span>, <span style="color: #000000;">800</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, sysrefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">of</span> oWnd</div>[/code:2ua9phiv][/quote:2ua9phiv]
this test is finished after 7 hours without problem....
i'm using TransBmp provided by Fivetech...
is really important you provide a sample...
|
Bug in TBar?
|
Daniel,
Thanks again for time and support.
It is not a question of sintax or sample that does not work (it is not an error as the one that happens when trying to build samples\skin1.prg or skin2.prg).
Code works fine most of the times. So it is a question of runtime, related to resources or transbmp.
Please, see <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=21662">viewtopic.php?f=3&t=21662</a><!-- l -->
Carlos Vargas, Maurizio and Enrico confirmed the error also.
|
Bug in TBar?
|
[quote="Enrico Maria Giordano":1kvmw39o]Unfortunately not. It is very very random. Myself I didn't saw the problem anymore.
EMG[/quote:1kvmw39o]
about carlos cargas... i dont know if the problem continue to him
i'll will do the test with xharbour now
|
Bug in TBar?
|
i return to xharbour and the error is not present yet.
salu2
carlos vargas
|
Bug in TBar?
|
Daniel,
[quote:1afz0noe]Unfortunately not. It is very very random. Myself I didn't saw the problem anymore.
[/quote:1afz0noe]
The error does not occur very often during develop tests, but it is more often in production use.
I am afraid not all programmers test the software as hard as I do. Also, in every build I always discover new bugs <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) -->.
Thanks again for all your so valuable help and support.
|
Bug in TBitmap [Fixed]
|
TBitmap disables nomodal oDlg valid. This is a sample. Try to hit ESC on the first and on the second dialogs. The first will close (it shouldn't), the second not.
[code=fw:1hcs9vx5]<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 /><br /> TBitmap<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</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;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">bValid</span> := <span style="color: #000000;">{</span> || !GetKeyState<span style="color: #000000;">(</span> VK_ESCAPE <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>;<br /> <span style="color: #0000ff;">CENTER</span> NOMODAL<br /><br /> SYSWAIT<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /><br /> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">bValid</span> := <span style="color: #000000;">{</span> || !GetKeyState<span style="color: #000000;">(</span> VK_ESCAPE <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>;<br /> <span style="color: #0000ff;">CENTER</span> NOMODAL<br /><br /> SYSWAIT<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:1hcs9vx5]
EMG
|
Bug in TBitmap [Fixed]
|
The same problem there is with TButton but not with TGet.
Any workaround? How to get nomodal dialog's VALID clause to work with any controls?
EMG
|
Bug in TBitmap [Fixed]
|
Enrico,
It is working fine this way:
[code=fw:12d1b81b]<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, oBmp<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br /> oBmp := TBitmap<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oBmp:<span style="color: #000000;">nDlgCode</span> = DLGC_WANTALLKEYS<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br /> <span style="color: #0000ff;">CENTER</span> NOMODAL ;<br /> <span style="color: #0000ff;">VALID</span> ! GetKeyState<span style="color: #000000;">(</span> VK_ESCAPE <span style="color: #000000;">)</span><br /><br /> SYSWAIT<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /><br /> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">bValid</span> := <span style="color: #000000;">{</span> || !GetKeyState<span style="color: #000000;">(</span> VK_ESCAPE <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>;<br /> <span style="color: #0000ff;">CENTER</span> NOMODAL<br /><br /> SYSWAIT<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:12d1b81b]
|
Bug in TBitmap [Fixed]
|
Thank you. But this new sample, using resources, still doesn't work:
[code=fw:1ecpfzag]<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;">RESOURCE</span> <span style="color: #ff0000;">"TEST"</span><br /><br /> TBitmap<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #0000ff;">Redefine</span><span style="color: #000000;">(</span> <span style="color: #000000;">101</span>, , , oDlg <span style="color: #000000;">)</span>:<span style="color: #000000;">nDlgCode</span> = DLGC_WANTALLKEYS<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">bValid</span> := <span style="color: #000000;">{</span> || !GetKeyState<span style="color: #000000;">(</span> VK_ESCAPE <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>;<br /> <span style="color: #0000ff;">CENTER</span> NOMODAL<br /><br /> SYSWAIT<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /><br /> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">bValid</span> := <span style="color: #000000;">{</span> || !GetKeyState<span style="color: #000000;">(</span> VK_ESCAPE <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>;<br /> <span style="color: #0000ff;">CENTER</span> NOMODAL<br /><br /> SYSWAIT<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:1ecpfzag]
[code=fw:1ecpfzag]<div class="fw" id="{CB}" style="font-family: monospace;">TEST <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">69</span>, <span style="color: #000000;">74</span>, <span style="color: #000000;">180</span>, <span style="color: #000000;">65</span><br /><span style="color: #0000ff;">STYLE</span> DS_MODALFRAME | WS_POPUP | WS_CAPTION<br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">11</span>, <span style="color: #ff0000;">"Arial"</span><br />LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL<br /><span style="color: #000000;">{</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">-1</span>, <span style="color: #ff0000;">"BUTTON"</span>, BS_GROUPBOX | WS_CHILD | WS_VISIBLE, <span style="color: #000000;">10</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">160</span>, <span style="color: #000000;">35</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">101</span>, <span style="color: #ff0000;">"TBitmap"</span>, WS_CHILD | WS_VISIBLE, <span style="color: #000000;">20</span>, <span style="color: #000000;">17</span>, <span style="color: #000000;">16</span>, <span style="color: #000000;">15</span><br /><span style="color: #000000;">}</span></div>[/code:1ecpfzag]
EMG
|
Bug in TBitmap [Fixed]
|
Please invert the order in the RC:
Here it is working fine this way
[quote:1850f3r5]TEST DIALOG 69, 74, 180, 65
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
FONT 11, "Arial"
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
{
CONTROL "", 101, "TBitmap", WS_CHILD | WS_VISIBLE, 20, 17, 16, 15
CONTROL "", -1, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 10, 5, 160, 35
}[/quote:1850f3r5]
|
Bug in TBitmap [Fixed]
|
Thank you. But still doesn't work with this new RC:
[code=fw:735hai5i]<div class="fw" id="{CB}" style="font-family: monospace;">TEST <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">69</span>, <span style="color: #000000;">74</span>, <span style="color: #000000;">180</span>, <span style="color: #000000;">65</span><br /><span style="color: #0000ff;">STYLE</span> DS_MODALFRAME | WS_POPUP | WS_CAPTION<br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">11</span>, <span style="color: #ff0000;">"Arial"</span><br />LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL<br /><span style="color: #000000;">{</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">101</span>, <span style="color: #ff0000;">"TBitmap"</span>, WS_CHILD | WS_VISIBLE, <span style="color: #000000;">20</span>, <span style="color: #000000;">17</span>, <span style="color: #000000;">16</span>, <span style="color: #000000;">15</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">-1</span>, <span style="color: #ff0000;">"BUTTON"</span>, BS_GROUPBOX | WS_CHILD | WS_VISIBLE, <span style="color: #000000;">10</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">160</span>, <span style="color: #000000;">35</span><br /> CONTROL <span style="color: #ff0000;">"&Annulla"</span>, <span style="color: #000000;">201</span>, <span style="color: #ff0000;">"BUTTON"</span>, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, <span style="color: #000000;">70</span>, <span style="color: #000000;">45</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">15</span><br /><span style="color: #000000;">}</span></div>[/code:735hai5i]
EMG
|
Bug in TBitmap [Fixed]
|
It seems as this behavior and the one reported by Miacord are based on the same bug:
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=33870">viewtopic.php?f=6&t=33870</a><!-- l -->
I have found a workaround for it. In class TDialog these lines should be added in Method Command()
[code=fw:4jp5wsbi]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">case</span> nID == IDCANCEL .and. ! ::<span style="color: #000000;">lModal</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lValid</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">bValid</span> = <span style="color: #00C800;">nil</span> <br /> ::<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> .T.<br /> <span style="color: #00C800;">endif</span> <br /> <span style="color: #00C800;">return</span> .F.</div>[/code:4jp5wsbi]
just above case nID != 0
I appreciate if you test it as it is difficult to know what side effects may bring so it has to be tested my many users before including it in FWH
|
Bug in TBitmap [Fixed]
|
Ok, I'm testing, thank you. All fine so far.
EMG
|
Bug in TBitmap [Fixed]
|
Enrico, you obtain any error?
|
Bug in TBitmap [Fixed]
|
It works again if I comment out
[code=fw:2kqsr4rj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> REVD1801</div>[/code:2kqsr4rj]
inside bitmap.prg.
Any better solution?
EMG
|
Bug in TBitmap [Fixed]
|
[quote="cnavarro":2fxc0scy]Enrico, you obtain any error?[/quote:2fxc0scy]
No, only a blank bitmap.
EMG
|
Bug in TBitmap [Fixed]
|
How do you call painting your bitmaps?, or you use command for define bitmaps?
|
Bug in TBitmap [Fixed]
|
Bitmaps on dialogs are not more visible using FWH 18.01, at least in my applications.
Any ideas?
EMG
|
Bug in TBitmap [Fixed]
|
[quote="cnavarro":3i0hgh24]How do you call painting your bitmaps?, or you use command for define bitmaps?[/quote:3i0hgh24]
I'm using REDEFINE BITMAP command.
EMG
|
Bug in TBitmap [Fixed]
|
[quote="Enrico Maria Giordano":yn5a7lz6]It works again if I comment out
[code=fw:yn5a7lz6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> REVD1801</div>[/code:yn5a7lz6]
inside bitmap.prg.
Any better solution?
EMG[/quote:yn5a7lz6]
And even with the line above commented out, the bitmap is blank if the REDEFINE BITMAP ... TRANSPARENT clause is used.
All of this used to worked perfectly in the previous FWH releases (since decades).
EMG
|
Bug in TBitmap [Fixed]
|
It works perfectly if bitmap.prg from the previous FWH release is used.
EMG
|
Bug in TBitmap [Fixed]
|
Mr Enrico
I tried to reproduce your problem but could not. I would be highly thankful if you can provide a small sample to reproduce the problem.
|
Bug in TBitmap [Fixed]
|
[quote="nageswaragunupudi":2wb3ujd7]Mr Enrico
I tried to reproduce your problem but could not. I would be highly thankful if you can provide a small sample to reproduce the problem.[/quote:2wb3ujd7]
No, sorry. I can't reproduce the problem with a sample, only in my applications.
EMG
|
Bug in TBitmap [Fixed]
|
No problem, my friend.
EMG
|
Bug in TBitmap [Fixed]
|
Ok, never mind, my fault, sorry. Case closed.
EMG
|
Bug in TBitmap [Fixed]
|
The problem (for the posterity) was that I redefined GetObjectType() function that now is used for FW_ReadImage().
EMG
|
Bug in TBitmap [Fixed]
|
[quote="Enrico Maria Giordano":211wvmts]The problem (for the posterity) was that I redefined GetObjectType() function that now is used for FW_ReadImage().
EMG[/quote:211wvmts]
At first, I thank you for the clarification. I feel greatly relieved that I did not introduce any bug.
At the same time, I am also sorry. We started the convention of prefixing FW_ to all FWH functions not to clash with programmers' own functions inadvertently. But this was a function which we created earlier. Sorry for the inconvenience.
|
Bug in TBitmap [Fixed]
|
This code:
[code=fw:28spd2ad]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">REDEFINE</span> BITMAP;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg;<br /> FILE <span style="color: #ff0000;">"TEST.PAK"</span>;<br /> <span style="color: #0000ff;">ADJUST</span></div>[/code:28spd2ad]
where TEST.PAK is TEST.BMP renamed, shows "Argument error conditional". It used to work fine in the previous FWH releases.
Any workaround?
EMG
|
Bug in TBitmap [Fixed]
|
Enrico,
Please post the calls stack section from the error.log file, thanks
|
Bug in TBitmap [Fixed]
|
This is a sample. It doesn't error out but shows a sheet instead of the bitmap (open.pak is open.bmp renamed).
[code=fw:26d28ax6]<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 /><br /> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> BITMAP;<br /> FILE <span style="color: #ff0000;">"open.pak"</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:26d28ax6]
EMG
|
Bug in TBitmap [Fixed]
|
Any workaround?
EMG
|
Bug in TBitmap [Fixed]
|
Enrico,
Here an empty dialog is shown
Please post a screenshot of what you get, thanks
|
Bug in TBitmap [Fixed]
|
I copied an open.bmp to open.pak and it is properly shown
Please double check that open.pak is the right bitmap that you want to show
|
Bug in TBitmap [Fixed]
|
I just sent the sample (PRG, PAK and EXE) to your private email.
EMG
|
Bug in TBitmap [Fixed]
|
Unfortunately your email provider rejected the attachment. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
Anyway, you must be able to reproduce the problem using my sample:
[code=fw:3rjvdcyy]<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 /><br /> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> BITMAP;<br /> FILE <span style="color: #ff0000;">"open.pak"</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:3rjvdcyy]
EMG
|
Bug in TBitmap [Fixed]
|
I just sent you PRG and PAK (without EXE).
EMG
|
Bug in TBitmap [Fixed]
|
And an image of the result.
EMG
|
Bug in TBitmap [Fixed]
|
Enrico,
It is working fine here
I have emailed you the most recent FWH libs
thanks
|
Bug in TBitmap [Fixed]
|
It doesn't work here. Can I have you EXE to test here, please?
EMG
|
Bug in TBitmap [Fixed]
|
Works fine if I comment out
[code=fw:2licwnyx]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//#define REVD1801</span></div>[/code:2licwnyx]
from bitmap.prg.
EMG
|
Bug in TBitmap [Fixed]
|
We are checking it, thanks
|
Bug in TBitmap [Fixed]
|
Any news?
EMG
|
Bug in TBitmap [Fixed]
|
This bug is still present in FWH 18.02. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
EMG
|
Bug in TBitmap [Fixed]
|
Any news?
EMG
|
Bug in TBitmap [Fixed]
|
Any chance to have this fixed? Or, at least, any workaround?
EMG
|
Bug in TBitmap [Fixed]
|
Enrico,
In function FW_ReadImage() at FWH\source\function\imgtxtio.prg please modify this:
elseif ( UseGDI() .or. lGdipImage ) .and. cExt $ "PNG,JPG,JPEG,GIF,TIF,TIFF,EMF,WMF"
with
elseif ( UseGDI() .or. lGdipImage ) .and. cExt $ "PNG,JPG,JPEG,GIF,TIF,TIFF,EMF,WMF,PAK"
|
Bug in TBitmap [Fixed]
|
I don't like this fix very much. What if I'd want to load an image with a different extension? Better having a default format used for any unknown extension.
EMG
|
Bug in TBitmap [Fixed]
|
Enrico,
> Better having a default format used for any unknown extension
There is no a default format for unknown extensions
Why don't you want to use the standard format BMP ?
|
Bug in TBitmap [Fixed]
|
[quote="Antonio Linares":1ywbfr3m]There is no a default format for unknown extensions[/quote:1ywbfr3m]
I know. That's why I proposed to implement a default format so that we can use any extension for an image of that default format (ie. if default format is BMP we can use TEST.PAK or TEST.ABC instead of TEST.BMP).
[quote="Antonio Linares":1ywbfr3m]Why don't you want to use the standard format BMP ?[/quote:1ywbfr3m]
I'm using a BMP renamed PAK (customer request, sorry).
Please note that it used to work in previous FWH releases.
EMG
|
Bug in TBitmap [Fixed]
|
The present code recognizes the image type by the file extension.
We will modify the function to recognize bmp files renamed to any non-image file type extension and communicate the revision to you asap.
|
Bug in TBitmap [Fixed]
|
Thank you.
EMG
|
Bug in TBitmap [Fixed]
|
Please try the following sample (with the manifest file). Click on the checkbox and you'll see that it doesn't change its status. It works fine if the bitmap exists.
[code=fw:124awhzh]<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> lVar := .F.<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br /> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"TEST"</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> BITMAP;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg;<br /> FILE <span style="color: #ff0000;">"NONEXISTENT.BMP"</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">CHECKBOX</span> lVar;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">OF</span> oDlg<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:124awhzh]
[code=fw:124awhzh]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #000000;">1</span> <span style="color: #000000;">24</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\s</span>amples<span style="color: #000000;">\w</span>inxp<span style="color: #000000;">\W</span>indowsXP.Manifest"</span><br /><br />TEST <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">300</span>, <span style="color: #000000;">300</span><br /><span style="color: #0000ff;">STYLE</span> DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU<br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"MS Sans Serif"</span><br />LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL<br /><span style="color: #000000;">{</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">101</span>, <span style="color: #ff0000;">"TBitmap"</span>, WS_CHILD | WS_VISIBLE, <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">57</span>, <span style="color: #000000;">62</span><br /> CONTROL <span style="color: #ff0000;">"TCheckBox"</span>, <span style="color: #000000;">102</span>, <span style="color: #ff0000;">"BUTTON"</span>, BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_CHILD | WS_VISIBLE | WS_TABSTOP, <span style="color: #000000;">120</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">46</span>, <span style="color: #000000;">13</span><br /><span style="color: #000000;">}</span></div>[/code:124awhzh]
EMG
|
Bug in TBitmap [Fixed]
|
This is a fix that seems to work:
[code=fw:waay50dk]<div class="fw" id="{CB}" style="font-family: monospace;">::<span style="color: #000000;">LoadImage</span><span style="color: #000000;">(</span> cResName, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> cBmpFile != <span style="color: #00C800;">nil</span> .and. File<span style="color: #000000;">(</span> cBmpFile <span style="color: #000000;">)</span>, AllTrim<span style="color: #000000;">(</span> cBmpFile <span style="color: #000000;">)</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span></div>[/code:waay50dk]
EMG
|
Bug in TBitmap [Fixed]
|
The problem is because the following lines in the Paint() method [code=fw:3ufpmb1d]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> .and. ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cBmpFile</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">LoadBmp</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">cBmpFile</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:3ufpmb1d]
keep calling LoadImage() repeatedly.
This is fixed by inserting these lines before present line no. 833 ( FWH18.03)
[code=fw:3ufpmb1d]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">hBitmap</span> == <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">cResName</span> := ::<span style="color: #000000;">cBmpFile</span> := <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:3ufpmb1d]
in the method LoadImage().
Thank you for pointing out this bug.
|
Bug in TBtnBmp
|
The following sample shows the problem (the button is inset and partially visible):
[code:2zqomxt4]#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
DEFINE DIALOG oDlg
@ 1, 1 BTNBMP
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL[/code:2zqomxt4]
EMG
|
Bug in TBtnBmp
|
Enrico,
Are you testing it in XP or in Vista ?
In Vista it looks fine (inset), the only problem I see is that the focus dotted line is not visible on the right side.
|
Bug in TBtnBmp
|
[quote="Antonio Linares":bgxfhsn3]Enrico,
Are you testing it in XP or in Vista ?
In Vista it looks fine (inset), the only problem I see is that the focus dotted line is not visible on the right side.[/quote:bgxfhsn3]
I tested it in XP and inset is one of the problems. It is not inset when defined from resources.
The BUTTONBMPs work fine instead.
EMG
|
Bug in TBtnBmp
|
Enrico,
So we are talking about the inset and the dotted line, right ? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Thanks for your help,
|
Bug in TBtnBmp
|
[quote="Antonio Linares":2dd6xavd]Enrico,
So we are talking about the inset and the dotted line, right ? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:2dd6xavd]
Exactly.
EMG
|
Bug in TBtnBmp [Solved]
|
In the following sample (with themes activated) I can't see the border to appear on mouse hovering anymore:
[code=fw:3ra2ncb0]<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 /><br /> @ <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">BTNBMP</span> 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 /> NOBORDER<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:3ra2ncb0]
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
We have just published a new FWH 9.04 build that fixes it, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Bug in TBtnBmp [Solved]
|
Thank you Master!
EMG
|
Bug in TBtnBmp [Solved]
|
Another little bug. In the following sample, the vertical line between the button and the menu arrow is not visible until you click on the button:
[code=fw:3fiux2zh]<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> oWnd, oMen<br /><br /> <span style="color: #0000ff;">MENU</span> oMen<br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #000000;">2007</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oWnd:<span style="color: #000000;">oBar</span>;<br /> <span style="color: #0000ff;">MENU</span> oMen;<br /> NOBORDER<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:3fiux2zh]
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
Again, we have just published a new FWH 9.04 build that fixes it, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Bug in TBtnBmp [Solved]
|
Thank you again! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
Many thanks for your great feedback <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Bug in TBtnBmp [Solved]
|
There's something different in the size of the bitmaps painted over bitmap buttons. Please check.
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
Here it seems ok. Could you please provide an example or a screenshot ? thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Bug in TBtnBmp [Solved]
|
Antonio,
screenshots sent. Let me know if you received them.
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
Yes, I got them. Thanks
In FWH 14.04 there is a change in Class TBtnBmp Method Paint, in line 1360:
[code=fw:30wdwqq0]<div class="fw" id="{CB}" style="font-family: monospace;"> <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>, oBmpRect:<span style="color: #000000;">nLeft</span>, oBmpRect:<span style="color: #000000;">nTop</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, oBmpRect:<span style="color: #000000;">nTop</span>, oBmpRect:<span style="color: #000000;">nLeft</span>, oBmpRect:<span style="color: #000000;">nWidth</span>, oBmpRect:<span style="color: #000000;">nWidth</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> PalBmpDraw<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, oBmpRect:<span style="color: #000000;">nTop</span>, oBmpRect:<span style="color: #000000;">nLeft</span>, hBmp, hPal, oBmpRect:<span style="color: #000000;">nWidth</span>, oBmpRect:<span style="color: #000000;">nHeight</span>, ;<br /> <span style="color: #00C800;">nil</span>, ::<span style="color: #000000;">lBmpTransparent</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span></div>[/code:30wdwqq0]
In this line please try to add a +1 in nTop and nLeft:
PalBmpDraw( ::hDC, oBmpRect:nTop + 1, oBmpRect:nLeft + 1, hBmp, hPal, oBmpRect:nWidth, oBmpRect:nHeight, ;
nil, ::lBmpTransparent )
thanks
|
Bug in TBtnBmp [Solved]
|
Antonio,
no, unfortunately it is not enough. The image is still not centered and the button still miss the border.
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
Just curiosity, have you tried with + 2 ?
It seems to me as those functions are using the coordinates in a different way. We are going to review it, thanks
|
Bug in TBtnBmp [Solved]
|
Antonio,
[quote="Antonio Linares":13uye2ao]Enrico,
Just curiosity, have you tried with + 2 ?[/quote:13uye2ao]
Yes. it doesn't make any difference. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
[quote="Antonio Linares":13uye2ao]It seems to me as those functions are using the coordinates in a different way. We are going to review it, thanks[/quote:13uye2ao]
Thank you, my friend!
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
Please change it this way and it should work fine:
[code=fw:22v8uk17]<div class="fw" id="{CB}" style="font-family: monospace;"> <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>, oBmpRect:<span style="color: #000000;">nLeft</span>, oBmpRect:<span style="color: #000000;">nTop</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, oBmpRect:<span style="color: #000000;">nTop</span>, oBmpRect:<span style="color: #000000;">nLeft</span>, oBmpRect:<span style="color: #000000;">nWidth</span>, oBmpRect:<span style="color: #000000;">nWidth</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, oBmpRect:<span style="color: #000000;">nTop</span>, oBmpRect:<span style="color: #000000;">nLeft</span>, oBmpRect:<span style="color: #000000;">nWidth</span>, oBmpRect:<span style="color: #000000;">nWidth</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span></div>[/code:22v8uk17]
|
Bug in TBtnBmp [Solved]
|
Antonio,
[quote="Antonio Linares":2q1fdlag]Enrico,
Please change it this way and it should work fine:
[code=fw:2q1fdlag]<div class="fw" id="{CB}" style="font-family: monospace;"> <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>, oBmpRect:<span style="color: #000000;">nLeft</span>, oBmpRect:<span style="color: #000000;">nTop</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, oBmpRect:<span style="color: #000000;">nTop</span>, oBmpRect:<span style="color: #000000;">nLeft</span>, oBmpRect:<span style="color: #000000;">nWidth</span>, oBmpRect:<span style="color: #000000;">nWidth</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, oBmpRect:<span style="color: #000000;">nTop</span>, oBmpRect:<span style="color: #000000;">nLeft</span>, oBmpRect:<span style="color: #000000;">nWidth</span>, oBmpRect:<span style="color: #000000;">nWidth</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span></div>[/code:2q1fdlag][/quote:2q1fdlag]
Sorry, no change. The problem seems to be here:
[code=fw:2q1fdlag]<div class="fw" id="{CB}" style="font-family: monospace;">DrawTransBmp<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hBmp, oBmpRect:<span style="color: #000000;">nTop</span>, oBmpRect:<span style="color: #000000;">nLeft</span>, oBmpRect:<span style="color: #000000;">nWidth</span>, oBmpRect:<span style="color: #000000;">nWidth</span> <span style="color: #000000;">)</span></div>[/code:2q1fdlag]
If I change it to this:
[code=fw:2q1fdlag]<div class="fw" id="{CB}" style="font-family: monospace;">DrawTransBmp<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDc</span>, hBmp, oBmpRect:<span style="color: #000000;">nTop</span> + <span style="color: #000000;">1</span>, oBmpRect:<span style="color: #000000;">nLeft</span> + <span style="color: #000000;">1</span>, oBmpRect:<span style="color: #000000;">nWidth</span>, oBmpRect:<span style="color: #000000;">nWidth</span> <span style="color: #000000;">)</span></div>[/code:2q1fdlag]
the result is better but still different from the previous version. At least, there is no border anymore. How can I get the border back?
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
How do you create the TBtnBm control ? is it from resources ?
Please post here the RC section and the REDEFINE ... code, thanks
|
Bug in TBtnBmp [Solved]
|
Antonio,
here they are:
[code=fw:24utvouy]<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;">109</span> <span style="color: #0000ff;">OF</span> oDlg;<br /> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"BMP1"</span>, <span style="color: #00C800;">NIL</span>, <span style="color: #ff0000;">"BMP2"</span>;<br /> <span style="color: #0000ff;">ACTION</span> ...</div>[/code:24utvouy]
[code=fw:24utvouy]<div class="fw" id="{CB}" style="font-family: monospace;">CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">109</span>, <span style="color: #ff0000;">"TBtnBmp"</span>, WS_CHILD | WS_VISIBLE, <span style="color: #000000;">207</span>, <span style="color: #000000;">125</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">13</span></div>[/code:24utvouy]
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
Could you provide an example without RCs ? thanks
|
Bug in TBtnBmp [Solved]
|
Antonio,
yes, here it is:
[code=fw:2l8ufrsj]<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:2l8ufrsj]
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
The bug was in front of our eyes and we were not seing it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop, oBmpRect:nLeft, oBmpRect:nWidth, oBmpRect[color=#FF0000:10g7oyk0]:nWidth[/color:10g7oyk0] )
obviously it has to be this way:
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop, oBmpRect:nLeft, oBmpRect:nWidth, oBmpRect:nHeight )
|
Bug in TBtnBmp [Solved]
|
Antonio,
yes, now the bitmaps are centered again, great! Please note that there are more than one place to fix.
Now, how to get the border back? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
Yes, I saw the two times also.
Please lets try this obvious change:
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop + 1, oBmpRect:nLeft + 1, oBmpRect:nWidth, oBmpRect:nHeight )
and let me know if you get part of the border back, thanks
|
Bug in TBtnBmp [Solved]
|
Antonio,
[quote="Antonio Linares":2q6ydk9r]Enrico,
Yes, I saw the two times also.[/quote:2q6ydk9r]
No, they are [b:2q6ydk9r]four[/b:2q6ydk9r] places to fix. Look carefully. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
EMG
|
Bug in TBtnBmp [Solved]
|
Antonio,
[quote="Antonio Linares":13p5nrav]Please lets try this obvious change:
DrawTransBmp( ::hDC, hBmp, oBmpRect:nTop + 1, oBmpRect:nLeft + 1, oBmpRect:nWidth, oBmpRect:nHeight )
and let me know if you get part of the border back, thanks[/quote:13p5nrav]
No, sorry. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
Ok, I am going to review it in deep and see whats going on.
Thanks for your great feedback, my friend <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Bug in TBtnBmp [Solved]
|
Antonio,
you're welcome. It's our interest to keep Fivewin healty! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
This code (in both places) seems to fix the border issue <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[code=fw:2zkg8o3x]<div class="fw" id="{CB}" style="font-family: monospace;"> <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>, oBmpRect:<span style="color: #000000;">nLeft</span>, oBmpRect:<span style="color: #000000;">nTop</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, oBmpRect:<span style="color: #000000;">nTop</span>, oBmpRect:<span style="color: #000000;">nLeft</span>, oBmpRect:<span style="color: #000000;">nWidth</span>, oBmpRect:<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, oBmpRect:<span style="color: #000000;">nTop</span>, oBmpRect:<span style="color: #000000;">nLeft</span>, oBmpRect:<span style="color: #000000;">nWidth</span>, oBmpRect:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <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> <br /> <span style="color: #00C800;">endif</span></div>[/code:2zkg8o3x]
I appreciate your comments, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Bug in TBtnBmp [Solved]
|
Enrico,
To me, this is the right fix (I am testing FWH\samples\testbtnb.prg).
[code=fw:3qgzy595]<div class="fw" id="{CB}" style="font-family: monospace;"> <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>, oBmpRect:<span style="color: #000000;">nLeft</span>, oBmpRect:<span style="color: #000000;">nTop</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, oBmpRect:<span style="color: #000000;">nTop</span>, oBmpRect:<span style="color: #000000;">nLeft</span> + <span style="color: #000000;">2</span>, oBmpRect:<span style="color: #000000;">nWidth</span>, oBmpRect:<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, oBmpRect:<span style="color: #000000;">nTop</span>, oBmpRect:<span style="color: #000000;">nLeft</span> + <span style="color: #000000;">2</span>, oBmpRect:<span style="color: #000000;">nWidth</span>, oBmpRect:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <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> <br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:3qgzy595]
Anyhow, we may need to test it in deep and see if there are some side effects.
|
Bug in TBtnBmp [Solved]
|
Antonio,
I'm lost in the changes. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Can you send me the fixed btnbmp.prg to my email, please?
EMG
|
Bug in TBtnBmp [Solved]
|
Enrico,
xharbour and Borland, right ? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
(I know you can't move to harbour yet)
|
Bug in TBtnBmp [Solved]
|
Enrico,
I have sent you the libs and btnbmp.prg, thanks
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.