topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
|---|---|
Bug in SkinButtons()
|
Just a question:
from the practical point of view which is the way to enable and disable the button?
@ 2, 2 BUTTON "&Test";
ACTION ( oBtn:Disable(), oBtn:Enable() )
...excuse me dear friends but I do not understand the problem.
|
Bug in SkinButtons()
|
Marco,
To disable a button, or any window, dialog or control, we use oControl:Disable() only.
In this case Enrico found that when calling to both oBtn:Disable(), oBtn:Enable() then the used skin is not applied.
|
Bug in SkinButtons()
|
Antonio,
is this the case:
1) disable button
2) call to several functions
3) enable button again
Is that correct? is this the case?
Bye
|
Bug in SkinButtons()
|
Marco,
Yes, that should work fine.
The problem is only when doing the two consecutive calls
|
Bug in SkinButtons()
|
No, the problem is when any function is called in between too:
[code=fw:2ld32yam]<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, oBtn<br /><br /> SKINBUTTONS<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: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Test"</span>;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oBtn:<span style="color: #000000;">Disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, TEST<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBtn:<span style="color: #000000;">Enable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Close"</span>;<br /> <span style="color: #0000ff;">ACTION</span> oDlg:<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><br /><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> TEST<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;">2</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Close"</span>;<br /> <span style="color: #0000ff;">ACTION</span> oDlg:<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:2ld32yam]
EMG
|
Bug in SkinButtons()
|
Enrico,
This reduced version from yours also fails in Windows 7:
[code=fw:17u1gtln]<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 /><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, oBtn<br /><br /> SKINBUTTONS<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: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Test"</span>;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oBtn:<span style="color: #000000;">Disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBtn:<span style="color: #000000;">Enable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Close"</span>;<br /> <span style="color: #0000ff;">ACTION</span> oDlg:<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><br /> </div>[/code:17u1gtln]
|
Bug in SkinButtons()
|
Is this bug present in 10.3 or has it been resolved?
|
Bug in SkinButtons()
|
Unfortunately, It is still present. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
EMG
|
Bug in SkinButtons()
|
Thank you for the info Enrico
|
Bug in TBTNBMP Class FWH 19.12 ?
|
Hello friends:
In the following example, a dialog is created with a radio and two buttons: one to "select" and the other to "cancel" the task without processing anything after the dialog. That is, what follows after the dialog should only be processed if you click on the "Select" button.
The [b:2t9zx5kr]lSelecc [/b:2t9zx5kr]variable is initialized as [b:2t9zx5kr].F.[/b:2t9zx5kr] and will only change to [b:2t9zx5kr].T,[/b:2t9zx5kr] if the "Select" button is pressed.
In other words, if you close the dialog with any of the four options other than "Select" (they are: 1.- ESC key, 2.- click on the "Cancel" button, 3.- click on the "X "in the upper right corner of the dialog, and 4.- Press the ALT+F4 keys to close the dialog), the variable" lSelecc "should remain in .F.
This condition is met in the first three cases, but fails in 4 (ALT+F4) that puts the variable in .T. as if you had clicked on the "Select" button.
This happens only with the [b:2t9zx5kr]TBTNBMP[/b:2t9zx5kr] class. With the other classes for button handling everything is going well.
How can I fix it or what should I correct in the class? I urgently need to solve it because the process in which this scenario is involved is highly sensitive to the integrity of the client's data.
Thanks in advance for your extraordinary help.
[code=fw:2t9zx5kr]<div class="fw" id="{CB}" style="font-family: monospace;"><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 /> <span style="color: #00C800;">LOCAL</span> oDlg, oBtn1, oBtn2, oRad, nOpr:=<span style="color: #000000;">1</span><br /> <span style="color: #00C800;">LOCAL</span> lSelecc:=.F. , lNoEsc := .F.<br /> <span style="color: #00C800;">LOCAL</span> aItems := <span style="color: #000000;">{</span><span style="color: #ff0000;">"Opcion 1"</span>,<span style="color: #ff0000;">"Opcion 2"</span>,<span style="color: #ff0000;">"Opcion 3"</span>,<span style="color: #ff0000;">"Opcion 4"</span>,<span style="color: #ff0000;">"Opcion 5"</span><span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">176</span>,<span style="color: #000000;">245</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Documentos a Reversar"</span> TRANSPARENT<br /><br /> @ <span style="color: #000000;">05</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Seleccione tipo documento:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">08</span><br /><br /> oRad := TRadMenu<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;">15</span>,<span style="color: #000000;">25</span>,aItems,<span style="color: #000000;">{</span>|u|If<span style="color: #000000;">(</span>PCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span>==<span style="color: #000000;">0</span>,nOpR,nOpR:=u<span style="color: #000000;">)</span><span style="color: #000000;">}</span>, oDlg,,,,,,.F.,, <span style="color: #000000;">70</span> , <span style="color: #000000;">09</span>,,.F.,.F.,.T.<span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">68</span>,<span style="color: #000000;">08</span> <span style="color: #0000ff;">BTNBMP</span> oBtn1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Select"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> lNoEsc := .T. , lSelecc:=.T. , oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">48</span>,<span style="color: #000000;">14</span> <span style="color: #0000ff;">PIXEL</span>;<br /> <span style="color: #0000ff;">LEFT</span> NOBORDER<br /><br /> @ <span style="color: #000000;">68</span>,<span style="color: #000000;">67</span> <span style="color: #0000ff;">BTNBMP</span> oBtn1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Cancel"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> lNoEsc := .T. , lSelecc:=.F. , oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">48</span>,<span style="color: #000000;">14</span> <span style="color: #0000ff;">PIXEL</span>;<br /> <span style="color: #0000ff;">LEFT</span> NOBORDER<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">VALID</span> lNoEsc <br /> <span style="color: #00C800;">if</span> lSelecc<br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span>nOpr<span style="color: #000000;">)</span> <span style="color: #B900B9;">// <=== *** THIS MUST BE PROCESSED IF, AND ONLY IF, WE CLICK ON THE "SELECT" BUTTON. *** //</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">(</span><span style="color: #00C800;">NIL</span><span style="color: #000000;">)</span></div>[/code:2t9zx5kr]
|
Bug in TBTNBMP Class FWH 19.12 ?
|
Very interesting.
Even more interesting is this. Change the prompt of oBtn1 as "&OK" or "&Choose" or any other text. Then ALT-F4 does not close the dialog.
Further, even much more interesting is that if you remove "&" and keep the prompt as "Select" or keep ampersand before any letter other than 's', i.e., "Se&lect", then also ALT-F4 does not close the dialog.
Looks like ALT-F4 is also sending ALT-S to the dialog.
If we use &S in the prompt of any button, that button click is activated by ALT-F4.
This problem is not with BUTTON class.
This is an issue which we need to study carefully and fix the problem.
Meanwhile, this is a temporary workaround for you:
Please remove "&" before "S" in the prompt.
If you want you can keep the "&" before any other letter, eg. "Se&lect"
|
Bug in TBTNBMP Class FWH 19.12 ?
|
Nages thanks for your reply.
In fact, the issue is related to the union of the accelerator symbol [b:rw5ftdl4]"&"[/b:rw5ftdl4] with the letter [b:rw5ftdl4]"S"[/b:rw5ftdl4] and the combination [b:rw5ftdl4]"ALT+F4"[/b:rw5ftdl4].
With any other letter it works without problems, it is only when "&S" is contained in the prompt of the button.
At the moment I will follow your suggestion temporarily. We have to find the final solution, because I would have to change in many places within the applications
[b:rw5ftdl4]If you check this thread, you will see that it is an old problem, reported by Oscar A. Martinez in 2009, and still not solved ![/b:rw5ftdl4]
[url:rw5ftdl4]http://forums.fivetechsupport.com/viewtopic.php?f=6&t=15422&hilit=acelerador[/url:rw5ftdl4]
Regards,
|
Bug in TBTNBMP Class FWH 19.12 ?
|
I agree with you.
We need to find a final solution.
We will look into this.
|
Bug in TBTNBMP Class FWH 19.12 ?
|
Hi Carlos,
I propose you to modify your source as below
[code=fw:3ctahe5k]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oDlg, oBtn1, oBtn2, oRad, nOpr:=<span style="color: #000000;">1</span><br /> <span style="color: #00C800;">LOCAL</span> lSelecc:=.F. , lNoEsc := .F.<br /> <span style="color: #00C800;">LOCAL</span> aItems := <span style="color: #000000;">{</span><span style="color: #ff0000;">"Opcion 1"</span>,<span style="color: #ff0000;">"Opcion 2"</span>,<span style="color: #ff0000;">"Opcion 3"</span>,<span style="color: #ff0000;">"Opcion 4"</span>,<span style="color: #ff0000;">"Opcion 5"</span><span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">176</span>,<span style="color: #000000;">245</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Documentos a Reversar"</span> TRANSPARENT<br /><br /> @ <span style="color: #000000;">05</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Seleccione tipo documento:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">08</span><br /><br /> oRad := TRadMenu<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;">15</span>,<span style="color: #000000;">25</span>,aItems,<span style="color: #000000;">{</span>|u|If<span style="color: #000000;">(</span>PCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span>==<span style="color: #000000;">0</span>,nOpR,nOpR:=u<span style="color: #000000;">)</span><span style="color: #000000;">}</span>, oDlg,,,,,,.F.,, <span style="color: #000000;">70</span> , <span style="color: #000000;">09</span>,,.F.,.F.,.T.<span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">68</span>,<span style="color: #000000;">08</span> <span style="color: #0000ff;">BTNBMP</span> oBtn1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Select"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> lNoEsc := .T. , lSelecc:=.T. , oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">48</span>,<span style="color: #000000;">14</span> <span style="color: #0000ff;">PIXEL</span>;<br /> <span style="color: #0000ff;">LEFT</span> NOBORDER<br /> <span style="color: #B900B9;">/*****/</span><br /> oBtn1:<span style="color: #000000;">nId</span> := IDOK <br /> <span style="color: #B900B9;">/*****/</span><br /> @ <span style="color: #000000;">68</span>,<span style="color: #000000;">67</span> <span style="color: #0000ff;">BTNBMP</span> oBtn2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Cancel"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> lNoEsc := .T. , lSelecc:=.F. , oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">48</span>,<span style="color: #000000;">14</span> <span style="color: #0000ff;">PIXEL</span>;<br /> <span style="color: #0000ff;">LEFT</span> NOBORDER<br /> <span style="color: #B900B9;">/*****/</span><br /> oBtn2:<span style="color: #000000;">nId</span> := IDCANCEL <br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">VALID</span> lNoEsc<br /> <span style="color: #00C800;">if</span> lSelecc<br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span>nOpr<span style="color: #000000;">)</span> <span style="color: #B900B9;">// <=== *** THIS MUST BE PROCESSED IF, AND ONLY IF, WE CLICK ON THE "SELECT" BUTTON. *** //</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">Return</span><span style="color: #000000;">(</span><span style="color: #00C800;">NIL</span><span style="color: #000000;">)</span></div>[/code:3ctahe5k]
and to modify the callclick function in the control class
[code=fw:3ctahe5k]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> CallClick<span style="color: #000000;">(</span> nKey, aControls, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> n, cPrompt, nAt, oControl<br /><br /> <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> aControls <span style="color: #000000;">)</span><br /> oControl = aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">if</span> oControl:<span style="color: #000000;">Classname</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #ff0000;">"TBTNBMP"</span> .OR. oControl:<span style="color: #000000;">Classname</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #ff0000;">"TRBTN"</span><br /> cPrompt := aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">cCaption</span><br /> nAt = <span style="color: #00C800;">At</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"&"</span>, cPrompt <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> nAt != <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">if</span> Upper<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cPrompt, nAt + <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> == Upper<span style="color: #000000;">(</span> Chr<span style="color: #000000;">(</span> nKey <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> .and. IsWindowEnabled<span style="color: #000000;">(</span> aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">IF</span> oControl:<span style="color: #000000;">Classname</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #ff0000;">"TBTNBMP"</span> .AND. <span style="color: #000000;">(</span>nKey == VK_F4 .and. GetKeyState<span style="color: #000000;">(</span> VK_MENU <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> n := AScan<span style="color: #000000;">(</span> aControls, <span style="color: #000000;">{</span> |o| o:<span style="color: #000000;">nID</span> == IDCANCEL <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> n > <span style="color: #000000;">0</span><br /> SetFocus<span style="color: #000000;">(</span> aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #0000ff;">Click</span><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 /> SetFocus<span style="color: #000000;">(</span> aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #0000ff;">Click</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span> <span style="color: #B900B9;">// msg processed</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;">next</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3ctahe5k]
regards
Massimo
|
Bug in TBTNBMP Class FWH 19.12 ?
|
Hi Massimo, please read my message yesterday
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=38498#p229748">viewtopic.php?f=6&t=38498#p229748</a><!-- l -->
|
Bug in TBTNBMP Class FWH 19.12 ?
|
This is the final fix:
Please locate this line in the METHOD SysKeyDown( nKey, nFlags ) in control.prg:
[code=fw:3li6a8ph]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oMenu</span> == <span style="color: #00C800;">NIL</span><br /> </div>[/code:3li6a8ph]
Modify this line as
[code=fw:3li6a8ph]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oMenu</span> == <span style="color: #00C800;">NIL</span> .and. nKey != VK_F4<br /> </div>[/code:3li6a8ph]
No other changes are required in control.prg
This fix is available in the next version of FWH under release.
Note:
ALTERNATIVELY,
Please see this line in the static function CallClick( nKey, aControls, Self )
[code=fw:3li6a8ph]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">if</span> Upper<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cPrompt, nAt + <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> == Upper<span style="color: #000000;">(</span> Chr<span style="color: #000000;">(</span> nKey <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> .and. IsWindowEnabled<span style="color: #000000;">(</span> aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> </div>[/code:3li6a8ph]
This line can be changed as
[code=fw:3li6a8ph]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">if</span> Upper<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cPrompt, nAt + <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> == Chr<span style="color: #000000;">(</span> nKey <span style="color: #000000;">)</span> .and. IsWindowEnabled<span style="color: #000000;">(</span> aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> </div>[/code:3li6a8ph]
This change also works instead of the above.
|
Bug in TBTNBMP Class FWH 19.12 ?
|
Nages and Cristobal, thanks a lot. You are the best <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
I'll be waiting for the new version.
Regards
|
Bug in TBTNBMP Class FWH 19.12 ?
|
On further testing we noticed that the first fix posted above is not full-proof. It is the second fix that works as expected.
This is the revised function:
[code=fw:34fdkm4g]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> CallClick<span style="color: #000000;">(</span> nKey, aControls, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> n, cPrompt, nAt, oControl, cKey<br /><br /> <span style="color: #00C800;">if</span> nKey >= VK_NUMPAD0 .and. nKey <= VK_NUMPAD9<br /> <span style="color: #B900B9;">// seen as 0x60 and Asc( "a" ) to Asc( "i" )</span><br /> nKey -= 0x30 <span style="color: #B900B9;">// converted to Asc( "0" ) to Asc( "9" )</span><br /> <span style="color: #00C800;">endif</span><br /><br /> cKey := Chr<span style="color: #000000;">(</span> nKey <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> IsUpper<span style="color: #000000;">(</span> cKey <span style="color: #000000;">)</span> .or. IsDigit<span style="color: #000000;">(</span> cKey <span style="color: #000000;">)</span> <span style="color: #B900B9;">// 2020-02-19</span><br /><br /> <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> aControls <span style="color: #000000;">)</span><br /> oControl = aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">if</span> oControl:<span style="color: #000000;">Classname</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #ff0000;">"TBTNBMP"</span> .OR. oControl:<span style="color: #000000;">Classname</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #ff0000;">"TRBTN"</span><br /> cPrompt := aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">cCaption</span><br /> nAt = <span style="color: #00C800;">At</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"&"</span>, cPrompt <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> nAt != <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">if</span> Upper<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cPrompt, nAt + <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> == cKey .and. IsWindowEnabled<span style="color: #000000;">(</span> aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> SetFocus<span style="color: #000000;">(</span> aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> aControls<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>:<span style="color: #0000ff;">Click</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span> <span style="color: #B900B9;">// msg processed</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;">next</span><br /><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:34fdkm4g]
|
Bug in TBar
|
In the following sample, please click on the button and you will see a red line under the toolbar of the dialog. It looks like the bottom line of the toolbar is transparent:
[code=fw:2r8ydhd0]<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<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd;<br /> <span style="color: #0000ff;">COLOR</span> <span style="color: #00C800;">NIL</span>, CLR_HRED<br /><br /> @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Test"</span>;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span>;<br /> <span style="color: #0000ff;">ACTION</span> TEST<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd;<br /> <span style="color: #0000ff;">MAXIMIZED</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> TEST<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: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> TOOLBAR<span style="color: #000000;">(</span> oDlg <span style="color: #000000;">)</span>;<br /> <span style="color: #0000ff;">CENTER</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> TOOLBAR<span style="color: #000000;">(</span> oDlg <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">40</span> <span style="color: #000000;">2007</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:2r8ydhd0]
EMG
|
Bug in TBar
|
Please note that the previous FWH release didn't have this bug.
EMG
|
Bug in TBar
|
Hello Enrico
i cant see the problem...
i use win7 32 and current fivewin svn... please test the exe
[url:3m87q86x]http://www.sitasoft.net/fivewin/samples/testbb.zip[/url:3m87q86x]
[img:3m87q86x]http://www.sitasoft.net/fivewin/screen/testbb.png[/img:3m87q86x]
|
Bug in TBar
|
Enrico,
Could you please post a screenshot ? thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
In Windows 7 seems to look fine...
|
Bug in TBar
|
[quote="Daniel Garcia-Gil":31k9yaar]Hello Enrico
i cant see the problem...
i use win7 32 and current fivewin svn... please test the exe[/quote:31k9yaar]
Your EXE shows the bug here (Windows XP).
EMG
|
Bug in TBar
|
[quote="Antonio Linares":2i78he56]Enrico,
Could you please post a screenshot ? thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
In Windows 7 seems to look fine...[/quote:2i78he56]
Sent to your private email.
EMG
|
Bug in TBar
|
In the following sample, if you click on the window you will get TBAR. With the previous FWH release you got TSAY.
[code=fw:1foudjac]<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<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<br /><br /> @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"This is a test"</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CLICK</span> <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">aControls</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">ClassName</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:1foudjac]
EMG
|
Bug in TBar
|
The problem seems to be in TBar New() method:
[code=fw:1ju1dksc]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">Create</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">GetFont</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #B900B9;">// oWnd:AddControl( Self )</span><br /> <span style="color: #00C800;">else</span></div>[/code:1ju1dksc]
Commenting out oWnd:AddControl( Self ) seems to fix it.
Can you confirm?
EMG
|
Bug in TBar
|
Enrico,
[quote:334f74x7]In the following sample, if you click on the window you will get TBAR. With the previous FWH release you got TSAY.[/quote:334f74x7]
That seems to be correct now. TBar is another control of the window and as it has to be created the first one
thats why it appears as the first control.
|
Bug in TBar
|
Antonio,
but it's no backward compatible. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
EMG
|
Bug in TBar
|
We should not keep a bug backwards compatible <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Does it means many changes in your app ?
|
Bug in TBar
|
Antonio,
probably not. But that behavior was there from the beginnings of FW. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
EMG
|
Bug in TBar
|
Enrico,
Yes, you are right, but with recent TBar changes this was needed to be implemented
|
Bug in TBar with dialogs
|
In the following sample click on the icon and a dialog will open. Then hit ALT key on the keyboard and you will see that the icon on the dialog's toolbar vanish with a piece of the toolbar itself:[code:1jfk30qh]#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oWnd
DEFINE WINDOW oWnd
DEFINE BUTTONBAR OF oWnd 2007
DEFINE BUTTON;
OF oWnd:oBar;
FILE "C:\FWH\BITMAPS\OPEN.BMP";
ACTION MYDIALOG()
ACTIVATE WINDOW oWnd
RETURN NIL
STATIC FUNCTION MYDIALOG()
LOCAL oDlg
DEFINE DIALOG oDlg
ACTIVATE DIALOG oDlg;
ON INIT TOOLBAR( oDlg );
CENTER
RETURN NIL
STATIC FUNCTION TOOLBAR( oDlg )
DEFINE BUTTONBAR OF oDlg 2007
DEFINE BUTTON;
OF oDlg:oBar;
FILE "C:\FWH\BITMAPS\CLOSE.BMP";
ACTION oDlg:End()
RETURN NIL[/code:1jfk30qh]EMG
|
Bug in TBar with dialogs
|
Any news?EMG
|
Bug in TBar with dialogs
|
Dear Enrico,That bug was detected by a FWH user and commented in the forums, and it was already solved <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->(I am searching for the topic where it was commented and posted the solution...)
|
Bug in TBar with dialogs
|
Found <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --><!-- m --><a class="postlink" href="http://forums.fivetechsoft.com/viewtopic.php?t=11175">http://forums.fivetechsoft.com/viewtopic.php?t=11175</a><!-- m -->This fix is already included for next build
|
Bug in TBar with dialogs
|
Thank you!EMG
|
Bug in TBar?
|
With the latest libs I get
[code:27hm8gzx]Error BASE/1004 Class: 'NIL' has no exported method: OBAR[/code:27hm8gzx]
running the following sample:
[code:27hm8gzx]#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oPrn
PRINT oPrn PREVIEW
PAGE
ENDPAGE
ENDPRINT
RETURN NIL[/code:27hm8gzx]
EMG
|
Bug in TBar?
|
Guess RPreview is checking for oBar of WndMain(). In this example WndMain() returns NIL. This is my guess but this is the most likely possiblity.
Mr. Antonio to Fix it in notime.
|
Bug in TBar?
|
Sorry, I meant
Mt Antonio "can" fix in no time.
|
Bug in TBar?
|
Fixed <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Thanks
|
Bug in TBar?
|
Sorry, now it gives
[code:12fizbnl]Error BASE/1004 Class: 'NIL' has no exported method: L2007[/code:12fizbnl]
EMG
|
Bug in TBar?
|
Fixed, thanks Enrico <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Bug in TBar?
|
It is the same issue. The intention was to ascertain if the WndMain()'s oBar and oMsgBar's l2007 is true.
Another peaceful look at the code will bring out where all the nil checks are to be made.
|
Bug in TBar?
|
Please check with the new LIBs just sent, thanks!
|
Bug in TBar?
|
Sorry, no change.
EMG
|
Bug in TBar?
|
Damn, I left one. Fixed <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Bug in TBar?
|
It's ok now, thank you.
EMG
|
Bug in TBar?
|
I can't reproduce the problem with a sample but sometimes a btnbmp of the toolbar vanishes.
Do you have any ideas on the possible reason?
EMG
|
Bug in TBar?
|
Surprising.
There has been no change in TBar code as such.
We shall all keep a watch and try to fix any problem.
|
Bug in TBar?
|
Dear Mr. Rao,
I noticed that I have to use now oBar:SetFont() otherwise I get an ugly bold font for the PROMPT’s.
Best regards,
Otto
|
Bug in TBar?
|
[quote="nageswaragunupudi":ep58f6yn]Surprising.
There has been no change in TBar code as such.
We shall all keep a watch and try to fix any problem.[/quote:ep58f6yn]
Please note that this erratic behavior is older, not related with latest FWH release.
EMG
|
Bug in TBar?
|
I still get this behavior (mainly under Vista and Win7): the bitmaps of the TBar suddenly vanish.
EMG
|
Bug in TBar?
|
I have not noticed so far, but as you said this happens randomly.
Can we try with an old version of tbar and see?
|
Bug in TBar?
|
[quote="nageswaragunupudi":2118z28w]I have not noticed so far, but as you said this happens randomly.[/quote:2118z28w]
Maybe this is a memory leak problem outside of TBar (in other functions, parts of FWH) and it depends what the user do with the app before you can see it at TBar.
After I use
[code=fw:2118z28w]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//----------------------------------------------------------------------------//</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> oWnd<br /><br /> SetResDebug<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> ...<br /><br /> FERASE<span style="color: #000000;">(</span><span style="color: #ff0000;">"CHECKRES.TXT"</span><span style="color: #000000;">)</span><br /> CHECKRES<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> winExec<span style="color: #000000;">(</span><span style="color: #ff0000;">"notepad .<span style="color: #000000;">\c</span>heckres.txt"</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:2118z28w]
the whole time while developing I could reduced memory leaks in my app (or told FiveTech to solve it) and now my customer tell me about the problem only few times. In the past they had the problem very often.
|
Bug in TBar?
|
[quote="nageswaragunupudi":2ql438uc]Can we try with an old version of tbar and see?[/quote:2ql438uc]
No, as my customers report me this problem since months. Anyway, if you send me an old TBar I can test it.
EMG
|
Bug in TBar?
|
Enrico,
Like Ruediger I have also seen this problem with memory leaks.
Regards,
James
|
Bug in TBar?
|
It maybe, but eventually the leaks is inside FWH.
EMG
|
Bug in TBar?
|
Yes, or the leaks could even be in other programs. The bitmaps seem to vanish when the available memory gets low for whatever reason.
Regards,
James
|
Bug in TBar?
|
Here it is a screenshot of the problem:
[img:2yxtzsa5]http://www.emagsoftware.it/Icons.jpg[/img:2yxtzsa5]
EMG
|
Bug in TBar?
|
Yes, I have noticed this error with Ribbon Bar.
Any clue?.
It is very serious.
Thank you.
|
Bug in TBar?
|
Hello.
Is there any update on this topic?.
Thank you very much.
|
Bug in TBar?
|
Hello,
What is the difference between painting Bitmaps on Menu and in Ribbon and TBar?.
Maybe here is the clue.
I do experience this problem too but I have not been able to trace.
Thanks
|
Bug in TBar?
|
Maybe is connected to this <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=22142">viewtopic.php?f=6&t=22142</a><!-- l --> ?
|
Bug in TBar?
|
Update: I'm getting this problem under my XP too. I just compile and run my application and immediately see the vanishing bitmaps. So I don't think it's a resource leak problem.
EMG
|
Bug in TBar?
|
Yes. I confirm it.
What's wrong?.
|
Bug in TBar?
|
Hello,
I always use a Buttonbar on Dialog-INIT and never had a Problem.
( You can Test it from inside my new Debugging-tool )
[code=fw:2hsuxqly]<div class="fw" id="{CB}" style="font-family: monospace;"><br />...<br />...<br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgMain ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span> oDlgMain:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> <span style="color: #000000;">120</span> , <span style="color: #000000;">70</span>, <span style="color: #000000;">900</span>, <span style="color: #000000;">265</span>, .f. <span style="color: #000000;">)</span>, DLG_BAR<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// ------- BUTTONBAR MAIN - DIALOG ----------------</span><br /><span style="color: #B900B9;">// ---------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> DLG_BAR<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> oBar, oBtn1, oBtn2, oBtn3, oBtn4, oBtn5, oBtn6, oBtn7, oBtn8, oBtn9<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oDlgMain2 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">55</span> 3DLOOK <span style="color: #000000;">2007</span> TOP<br />...<br />...<br /> </div>[/code:2hsuxqly]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
Bug in TBar?
|
Uwe,
Try to compile and start many times your app. You will see vanishing bitmaps
|
Bug in TBar?
|
Hi,
Any update?
Thanks.
|
Bug in TBar?
|
I even use xHarbour recently (last svn version) and never experience this error, I recently changed to harbor for testing the latest version (svn) and I are two occasions where the bitmap disappear. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Bug in TBar?
|
Carlos,
Thank you for your feedback.
Where you able to track it?.
|
Bug in TBar?
|
tried to duplicate the error, but has not been shown again, but again with xHarbour never happened.
|
Bug in TBar?
|
I'm using xHarbour and saw the problem as well.
EMG
|
Bug in TBar?
|
Sometimes I Have this problem with BUTTONBAR .
Maurizio
<!-- w --><a class="postlink" href="http://www.nipeservice.com">www.nipeservice.com</a><!-- w -->
|
Bug in TBar?
|
TBar and BUTTONBAR are the same class (TBar). TBar is the class, BUTTONBAR is a command that creates an instance of TBar.
EMG
|
Bug in TBar?
|
Antonio,
Any clue?.
This is very important !!!.
Thank you.
|
Bug in TBar?
|
Antonio,
Can you please look at this?.
Thank you very much.
|
Bug in TBar?
|
I have never seen this problem myself, anyhow I think that we have two things to check:
1. Check the bitmap handle before painting it to see if it still is a valid GDI object. There is a function IsGdiObject() that we can use
2. Painting a bitmap involves the creation of new DCs (hDC) that eventually could fail on low memory conditions, this is very difficult to happen, but we could check it.
Finally the way to go is to create a log file and check every single step taken when a bitmap is going to be painted. I am going to show how to create and implement such log file. Then. For those of you where it is failing, you will just have to review the log file and we will get a clear idea of what is happening <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Bug in TBar?
|
Antonio,
I search into Manual and Wiki for function IsGdiObject() and it does not exist.
My PC has 8 GB of RAM, so I think it is not a question of memory (unless FWH does not manage 8 GB as it happened with nExtMem()).
Point 3 sounds very interesting. I await your instructions.
Thanks a lot.
|
Bug in TBar?
|
Hello
already added to WiKi: [url:2vczrbjr]http://wiki.fivetechsoft.com/doku.php?id=fivewin_function_isgdiobject[/url:2vczrbjr]
|
Bug in TBar?
|
Daniel,
How are Bmps painted in Ribbon?. Does Ribbon use TBar?.
How can I track painted bmps?.
Thanks.
|
Bug in TBar?
|
Please add this code to your main PRG:
[code=fw:29e8z7y1]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br /><span style="color: #00C800;">static</span> void TransBmp<span style="color: #000000;">(</span> HBITMAP hBitmap, int iXsize, int iYsize,<br /> COLORREF rgbTransparent, HDC hDC,<br /> int iXOffset, int iYOffset, int iWidth, int iHeight <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> HDC mDC, nDC;<br /> HBITMAP hMask, hBmOld1, hBmOld2;<br /> LPBYTE lpBits;<br /><br /> mDC = CreateCompatibleDC<span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span>;<br /> <br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> mDC <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> hBmOld1 = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span> mDC, hBitmap <span style="color: #000000;">)</span>;<br /><br /> lpBits = <span style="color: #000000;">(</span> LPBYTE <span style="color: #000000;">)</span> hb_xgrab<span style="color: #000000;">(</span> iXsize * iYsize * <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lpBits <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> hMask = CreateBitmap<span style="color: #000000;">(</span> iXsize, iYsize, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span>, lpBits <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> hMask <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> nDC = CreateCompatibleDC<span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> nDC <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> hBmOld2 = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span> nDC, hMask <span style="color: #000000;">)</span>;<br /> SetBkColor<span style="color: #000000;">(</span> mDC, rgbTransparent <span style="color: #000000;">)</span>;<br /><br /> BitBlt<span style="color: #000000;">(</span> nDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, iXsize, iYsize, mDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, SRCCOPY <span style="color: #000000;">)</span>;<br /><br /> SetStretchBltMode<span style="color: #000000;">(</span> hDC, COLORONCOLOR <span style="color: #000000;">)</span>;<br /><br /> StretchBlt<span style="color: #000000;">(</span> hDC, iXOffset, iYOffset, iWidth, iHeight,<br /> mDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, iXsize, iYsize,<br /> SRCINVERT <span style="color: #000000;">)</span>;<br /><br /> StretchBlt<span style="color: #000000;">(</span> hDC, iXOffset, iYOffset, iWidth, iHeight,<br /> nDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, iXsize, iYsize,<br /> SRCAND <span style="color: #000000;">)</span>;<br /><br /> StretchBlt<span style="color: #000000;">(</span> hDC, iXOffset, iYOffset, iWidth, iHeight,<br /> mDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, iXsize, iYsize,<br /> SRCINVERT <span style="color: #000000;">)</span>;<br /><br /> SelectObject<span style="color: #000000;">(</span> nDC, hBmOld2 <span style="color: #000000;">)</span>;<br /> DeleteDC<span style="color: #000000;">(</span> nDC <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> MessageBox<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Can't create compatible DC!"</span>, <span style="color: #ff0000;">"Error"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br /> DeleteObject<span style="color: #000000;">(</span> hMask <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> MessageBox<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Can't create bitmap!"</span>, <span style="color: #ff0000;">"Error"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br /> hb_xfree<span style="color: #000000;">(</span> lpBits <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> MessageBox<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Can't allocate memory!"</span>, <span style="color: #ff0000;">"Error"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /> <br />SelectObject<span style="color: #000000;">(</span> mDC, hBmOld1 <span style="color: #000000;">)</span>;<br /> DeleteDC<span style="color: #000000;">(</span> mDC <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> MessageBox<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Can't create DC!"</span>, <span style="color: #ff0000;">"Error"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> TRANSBMP <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> TransBmp<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span>,<br /> <span style="color: #000000;">(</span> HDC <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">5</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">6</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">7</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">8</span> <span style="color: #000000;">)</span>, <br /> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">9</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>; <br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:29e8z7y1]
|
Bug in TBar?
|
Antonio,
It happened today in Ribbon but no messagebox appear!!!.
Is above TransBmp included in FW 11.11?.
Can you check it?.
Thanks.
|
Bug in TBar?
|
up
|
Bug in TBar?
|
Daniel?.
Any idea or clue?.
Thank you.
|
Bug in TBar?
|
Hello
i have not any error or bug with this class, can you provide a sample we can reproduce the problem...
thanks
|
Bug in TBar?
|
Unfortunately not. It is very very random. Myself I didn't saw the problem anymore.
EMG
|
Bug in TBar?
|
Enrico, thanks for listening.
Daniel, is TransBmp´s funcion pasted above included in FW 11.11?.
Thank you.
|
Bug in TBar?
|
John,
yes, it is but without the MessageBox() calls
|
Bug in TBar?
|
Antonio,
I need please latest source with MessageBox in order to trace the bug.
Where should I put the code?.
Thanks.
|
Bug in TBar?
|
John,
If you include that code in one of your own PRGs, your function will be used instead of FWH one
|
Bug in TBar?
|
Antonio,
Done.
I also added a number to each message to trace the error:
[code=fw:2zj8bca4]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br /><span style="color: #00C800;">static</span> void TransBmp<span style="color: #000000;">(</span> HBITMAP hBitmap, int iXsize, int iYsize,<br /> COLORREF rgbTransparent, HDC hDC,<br /> int iXOffset, int iYOffset, int iWidth, int iHeight <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> HDC mDC, nDC;<br /> HBITMAP hMask, hBmOld1, hBmOld2;<br /> LPBYTE lpBits;<br /><br /> mDC = CreateCompatibleDC<span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span>;<br /><br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> mDC <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> hBmOld1 = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span> mDC, hBitmap <span style="color: #000000;">)</span>;<br /><br /> lpBits = <span style="color: #000000;">(</span> LPBYTE <span style="color: #000000;">)</span> hb_xgrab<span style="color: #000000;">(</span> iXsize * iYsize * <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lpBits <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> hMask = CreateBitmap<span style="color: #000000;">(</span> iXsize, iYsize, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span>, lpBits <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> hMask <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> nDC = CreateCompatibleDC<span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> nDC <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> hBmOld2 = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span> nDC, hMask <span style="color: #000000;">)</span>;<br /> SetBkColor<span style="color: #000000;">(</span> mDC, rgbTransparent <span style="color: #000000;">)</span>;<br /><br /> BitBlt<span style="color: #000000;">(</span> nDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, iXsize, iYsize, mDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, SRCCOPY <span style="color: #000000;">)</span>;<br /><br /> SetStretchBltMode<span style="color: #000000;">(</span> hDC, COLORONCOLOR <span style="color: #000000;">)</span>;<br /><br /> StretchBlt<span style="color: #000000;">(</span> hDC, iXOffset, iYOffset, iWidth, iHeight,<br /> mDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, iXsize, iYsize,<br /> SRCINVERT <span style="color: #000000;">)</span>;<br /><br /> StretchBlt<span style="color: #000000;">(</span> hDC, iXOffset, iYOffset, iWidth, iHeight,<br /> nDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, iXsize, iYsize,<br /> SRCAND <span style="color: #000000;">)</span>;<br /><br /> StretchBlt<span style="color: #000000;">(</span> hDC, iXOffset, iYOffset, iWidth, iHeight,<br /> mDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, iXsize, iYsize,<br /> SRCINVERT <span style="color: #000000;">)</span>;<br /><br /> SelectObject<span style="color: #000000;">(</span> nDC, hBmOld2 <span style="color: #000000;">)</span>;<br /> DeleteDC<span style="color: #000000;">(</span> nDC <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> MessageBox<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"(1) Can't create compatible DC!"</span>, <span style="color: #ff0000;">"Error"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br /> DeleteObject<span style="color: #000000;">(</span> hMask <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> 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 /><br /> hb_xfree<span style="color: #000000;">(</span> lpBits <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> MessageBox<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"(3) Can't allocate memory!"</span>, <span style="color: #ff0000;">"Error"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br />SelectObject<span style="color: #000000;">(</span> mDC, hBmOld1 <span style="color: #000000;">)</span>;<br /> DeleteDC<span style="color: #000000;">(</span> mDC <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> MessageBox<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"(4) Can't create DC!"</span>, <span style="color: #ff0000;">"Error"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> TRANSBMP <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> TransBmp<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span>,<br /> <span style="color: #000000;">(</span> HDC <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">5</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">6</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">7</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">8</span> <span style="color: #000000;">)</span>,<br /> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">9</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:2zj8bca4]
Form this .c code, how could I invoke Fivewin´s error system to generate an error.log file with all the debug info to trace this bug?.
|
Bug in TBar?
|
Antonio,
I was able to trace the error.
Most of the buttons of the ribbon where painted, but in one case I got:
Error (2) Can't create bitmap!. Please, see above code to see error numbers.
[code=fw:1pgjt5pi]<div class="fw" id="{CB}" style="font-family: monospace;">Stack Calls<br />===========<br /> Called <span style="color: #0000ff;">from</span>: => TRANSBMP<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TRBTN.PRG => TRBTN:<span style="color: #0000ff;">PAINT</span><span style="color: #000000;">(</span> <span style="color: #000000;">1428</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TRBTN.PRG => <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>TRBTN<span style="color: #000000;">(</span> <span style="color: #000000;">102</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TRBTN.PRG => TRBTN:<span style="color: #00C800;">DISPLAY</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">1665</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TRBTN.PRG => TRBTN:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">1516</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">(</span> <span style="color: #000000;">3160</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => WINRUN<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TWINDOW:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">(</span> <span style="color: #000000;">989</span> <span style="color: #000000;">)</span></div>[/code:1pgjt5pi]
|
Bug in TBar?
|
Antonio,
This how it looks the Bitmap at the Ribbon when generating the error:
[url=http://imageshack.us/photo/my-images/838/errortransbmp.png/:2ldm482s][IMG=http://img838.imageshack.us/img838/511/errortransbmp.png][/IMG][/url:2ldm482s]
Uploaded with [url=http://imageshack.us:2ldm482s]ImageShack.us[/url:2ldm482s]
Thanks.
|
Bug in TBar?
|
Antonio,
Also, I got it in TTabs:
[code=fw:kg36irwm]<div class="fw" id="{CB}" style="font-family: monospace;"> Called <span style="color: #0000ff;">from</span>: => TRANSBMP<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TABS.PRG => TTABS:<span style="color: #000000;">PAINTTAB</span><span style="color: #000000;">(</span> <span style="color: #000000;">365</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TABS.PRG => TTABS:<span style="color: #000000;">PAINTOVER</span><span style="color: #000000;">(</span> <span style="color: #000000;">523</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TABS.PRG => TTABS:<span style="color: #000000;">MOUSEHOVER</span><span style="color: #000000;">(</span> <span style="color: #000000;">553</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TABS.PRG => <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>TTABS_NEW<span style="color: #000000;">(</span> <span style="color: #000000;">182</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TWINDOW:<span style="color: #000000;">MOUSEMOVE</span><span style="color: #000000;">(</span> <span style="color: #000000;">2911</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">MOUSEMOVE</span><span style="color: #000000;">(</span> <span style="color: #000000;">741</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TABS.PRG => TTABS:<span style="color: #000000;">MOUSEMOVE</span><span style="color: #000000;">(</span> <span style="color: #000000;">1041</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">1699</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\TABS.PRG => TTABS:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">1021</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">(</span> <span style="color: #000000;">3160</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => DIALOGBOXINDIRECT<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">(</span> <span style="color: #000000;">266</span> <span style="color: #000000;">)</span><br /> </div>[/code:kg36irwm]
|
Bug in TBar?
|
What is the error ? This is the calls stack only...
|
Bug in TBar?
|
Antonio,
Thanks for reply.
It was indicated in previous post.
[quote:3daztmbf]Error (2) Can't create bitmap[/quote:3daztmbf]
I got it in [b:3daztmbf]Ribbon [/b:3daztmbf]and [b:3daztmbf]Tabs[/b:3daztmbf].
I modified with your help Transbmp to add error msgs:
[code=fw:3daztmbf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br /><span style="color: #00C800;">static</span> void TransBmp<span style="color: #000000;">(</span> HBITMAP hBitmap, int iXsize, int iYsize,<br /> COLORREF rgbTransparent, HDC hDC,<br /> int iXOffset, int iYOffset, int iWidth, int iHeight <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> HDC mDC, nDC;<br /> HBITMAP hMask, hBmOld1, hBmOld2;<br /> LPBYTE lpBits;<br /><br /> mDC = CreateCompatibleDC<span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span>;<br /><br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> mDC <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> hBmOld1 = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span> mDC, hBitmap <span style="color: #000000;">)</span>;<br /><br /> lpBits = <span style="color: #000000;">(</span> LPBYTE <span style="color: #000000;">)</span> hb_xgrab<span style="color: #000000;">(</span> iXsize * iYsize * <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lpBits <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> hMask = CreateBitmap<span style="color: #000000;">(</span> iXsize, iYsize, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span>, lpBits <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> hMask <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> nDC = CreateCompatibleDC<span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> nDC <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> hBmOld2 = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span> nDC, hMask <span style="color: #000000;">)</span>;<br /> SetBkColor<span style="color: #000000;">(</span> mDC, rgbTransparent <span style="color: #000000;">)</span>;<br /><br /> BitBlt<span style="color: #000000;">(</span> nDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, iXsize, iYsize, mDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, SRCCOPY <span style="color: #000000;">)</span>;<br /><br /> SetStretchBltMode<span style="color: #000000;">(</span> hDC, COLORONCOLOR <span style="color: #000000;">)</span>;<br /><br /> StretchBlt<span style="color: #000000;">(</span> hDC, iXOffset, iYOffset, iWidth, iHeight,<br /> mDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, iXsize, iYsize,<br /> SRCINVERT <span style="color: #000000;">)</span>;<br /><br /> StretchBlt<span style="color: #000000;">(</span> hDC, iXOffset, iYOffset, iWidth, iHeight,<br /> nDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, iXsize, iYsize,<br /> SRCAND <span style="color: #000000;">)</span>;<br /><br /> StretchBlt<span style="color: #000000;">(</span> hDC, iXOffset, iYOffset, iWidth, iHeight,<br /> mDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, iXsize, iYsize,<br /> SRCINVERT <span style="color: #000000;">)</span>;<br /><br /> SelectObject<span style="color: #000000;">(</span> nDC, hBmOld2 <span style="color: #000000;">)</span>;<br /> DeleteDC<span style="color: #000000;">(</span> nDC <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> MessageBox<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"(1) Can't create compatible DC!"</span>, <span style="color: #ff0000;">"Error"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br /> DeleteObject<span style="color: #000000;">(</span> hMask <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> 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 /><br /> hb_xfree<span style="color: #000000;">(</span> lpBits <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> MessageBox<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"(3) Can't allocate memory!"</span>, <span style="color: #ff0000;">"Error"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br />SelectObject<span style="color: #000000;">(</span> mDC, hBmOld1 <span style="color: #000000;">)</span>;<br /> DeleteDC<span style="color: #000000;">(</span> mDC <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> MessageBox<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"(4) Can't create DC!"</span>, <span style="color: #ff0000;">"Error"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> TRANSBMP <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> TransBmp<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span>,<br /> <span style="color: #000000;">(</span> HDC <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">5</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">6</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">7</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">8</span> <span style="color: #000000;">)</span>,<br /> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">9</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:3daztmbf]
|
Bug in TBar?
|
up-
|
Bug in TBar?
|
Antonio, Daniel,
Any help please?.
Thanks a lot!!
|
Bug in TBar?
|
i started a test with this code in ribbon.prg sample
[code=fw:3uurmv2k]<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> oWnd:<span style="color: #000000;">cTitle</span> := Time<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oRBar:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">of</span> oWnd</div>[/code:3uurmv2k]
after 1 hour i'll report
|
Bug in TBar?
|
Hello
after 1:30 all is fine...
the test still continue
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.