topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
|---|---|
BtnBMP Error
|
Peter,
>
Also, we think that this error only occurs when the application is run through a remote desktop connection.
>
Its a quite strange error, because the C functions used in Method LoadBitmaps() always return an array, and in your error that array, somehow, has turned into a number (memory corruption?)
Anyhow, what you can do is to protect that method to avoid the error, this way:
[code:3pya8761]
if ! Empty( cResName1 )
aBmpPal = PalBmpLoad( cResName1 )
if ValType( aBmpPal ) == "A"
::hBitmap1 = aBmpPal[ 1 ]
::hPalette1 = aBmpPal[ 2 ]
endif
endif
[/code:3pya8761]
and do that for each use of aBmpPal in the method
|
BtnBMP Error
|
Thanks Antonio,
That has prevented the error message. I have now noticed that it is always the same bmp that is missing (which is what i'm assuming is causing the error) Could there be a problem with the resource file? - the bitmap used is contained in a resource file.
Also, what do we do from now on? Will i have to make the change you mention to all future versions of fivewin or will this be incorporated into future releases?
As i've found what part of the code is causing the error, is there anything i can do to give you any more info on why this is occurring? The code that uses the bitmap is:
DEFINE BUTTON OF oBar RESOURCE "TOP" NOBORDER GROUP ACTION (CursorWait(), oBrw:GoTop(), oBrw:SetFocus(), CursorArrow()) TOOLTIP "Top"
Thanks for your help
Pete
|
BtnBMP Error
|
Pete,
Please email me the bitmap file
What FWH version are you using ?
We can include such source code change in FWH source code, though we would like to understand and locate where the error is coming from
|
BtnBMP Error
|
Antonio,
Thanks for the reply - just sent you an email.
Pete
|
BtnBmp
|
When using a button bitmap on a dialog within a method in a class, when I end the dialog, I get an error:
tBtnBmp:New( 249 ) No exported method: NCLRTEXT
Looking at the btnbmp source, it is actually calling ::oWnd:nclrtext
Can anyone shed some light on what is happening so I can resolve this ? It is not specific to that bitmap.
Thanks for your ideas.
FWH 15.02, Harbour, MSVC 2013
|
BtnBmp
|
Tim,
It seems as ::oWnd is nil and it shouldn't be
Could you post the entire error.log here ? thanks
|
BtnBmp
|
[code=fw:1rvonew7]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Application<br />===========<br /> Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">C</span>:\Projects VS\MLS Service Writer <span style="color: #000000;">10</span>\Debug\MLS Service Writer <span style="color: #000000;">10</span>.exe <span style="color: #000000;">(</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">Size</span>: <span style="color: #000000;">*********</span> bytes<br /> Compiler version: <span style="color: #000000;">Harbour</span> <span style="color: #000000;">3.2</span>.0dev <span style="color: #000000;">(</span>r1412151448<span style="color: #000000;">)</span><br /> FiveWin Version: <span style="color: #000000;">FWH</span> <span style="color: #000000;">15.02</span><br /> Windows version: <span style="color: #000000;">6.2</span>, Build <span style="color: #000000;">9200</span> <br /><br /> Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">39</span> secs <br /> Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">03</span>/<span style="color: #000000;">19</span>/<span style="color: #000000;">15</span>, <span style="color: #000000;">14</span>:<span style="color: #000000;">33</span>:<span style="color: #000000;">42</span><br /> Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1004</span> No exported <span style="color: #00C800;">method</span>: <span style="color: #000000;">NCLRTEXT</span><br /> Args:<br /> <span style="color: #000000;">[</span> <span style="color: #000000;">1</span><span style="color: #000000;">]</span> = U <br /><br />Stack Calls<br />===========<br /> Called <span style="color: #0000ff;">from</span>: => NCLRTEXT<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;">BTNBMP</span>.PRG => TBTNBMP:<span style="color: #00C800;">NEW</span><span style="color: #000000;">(</span> <span style="color: #000000;">249</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TBTNBMP:<span style="color: #000000;">SAVE</span><span style="color: #000000;">(</span> <span style="color: #000000;">1636</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\Projects\MLS2015\Source\mAPaccounts.PRG => <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>TVENDORS_FULLEDIT<span style="color: #000000;">(</span> <span style="color: #000000;">195</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BTNBMP</span>.PRG => TBTNBMP:<span style="color: #0000ff;">CLICK</span><span style="color: #000000;">(</span> <span style="color: #000000;">535</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BTNBMP</span>.PRG => TBTNBMP:<span style="color: #000000;">LBUTTONUP</span><span style="color: #000000;">(</span> <span style="color: #000000;">763</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;">1723</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BTNBMP</span>.PRG => TBTNBMP:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">1409</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;">3355</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => DIALOGBOX<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;">286</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\Projects\MLS2015\Source\mAPaccounts.PRG => TVENDORS:<span style="color: #000000;">FULLEDIT</span><span style="color: #000000;">(</span> <span style="color: #000000;">224</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\Projects\MLS2015\Source\asw2015.prg => <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>MAIN<span style="color: #000000;">(</span> <span style="color: #000000;">363</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BTNBMP</span>.PRG => TBTNBMP:<span style="color: #0000ff;">CLICK</span><span style="color: #000000;">(</span> <span style="color: #000000;">535</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BTNBMP</span>.PRG => TBTNBMP:<span style="color: #000000;">LBUTTONUP</span><span style="color: #000000;">(</span> <span style="color: #000000;">763</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;">1723</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BTNBMP</span>.PRG => TBTNBMP:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">1409</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;">3355</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;">1057</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\Projects\MLS2015\Source\asw2015.prg => MAIN<span style="color: #000000;">(</span> <span style="color: #000000;">404</span> <span style="color: #000000;">)</span><br /><br />System<br />======<br /> CPU type: <span style="color: #000000;">Intel</span><span style="color: #000000;">(</span>R<span style="color: #000000;">)</span> Core<span style="color: #000000;">(</span>TM<span style="color: #000000;">)</span> i5<span style="color: #000000;">-4460</span> CPU @ <span style="color: #000000;">3</span>.20GHz <span style="color: #000000;">75</span> Mhz<br /> Hardware memory: <span style="color: #000000;">12240</span> megs<br /><br /> Free System resources: <span style="color: #000000;">90</span> %<br /> GDI resources: <span style="color: #000000;">90</span> %<br /> User resources: <span style="color: #000000;">90</span> %<br /><br /> Windows total applications running: <span style="color: #000000;">6</span><br /> <span style="color: #000000;">1</span> , C:\windows\SYSTEM32\SHELL32.dll <br /> <span style="color: #000000;">2</span> , C:\windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6<span style="color: #000000;">.0</span><span style="color: #000000;">.9600</span>.17415_none_a9ed7f <br /> <span style="color: #000000;">3</span> DDE <span style="color: #00C800;">Server</span> <span style="color: #0000ff;">Window</span>, C:\windows\SYSTEM32\ole32.dll <br /> <span style="color: #000000;">4</span> GDI+ <span style="color: #0000ff;">Window</span>, <br /> <span style="color: #000000;">5</span> GDI+ <span style="color: #0000ff;">Window</span>, C:\windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1<span style="color: #000000;">.1</span><span style="color: #000000;">.9600</span>.17415_none_dad8722c5bcc2d <br /> <span style="color: #000000;">6</span> Task Switching, C:\Projects VS\MLS Service Writer <span style="color: #000000;">10</span>\Debug\MLS Service Writer <span style="color: #000000;">10</span>.exe <br /><br />Variables in use<br />================<br /> Procedure Type Value<br /> ==========================<br /> NCLRTEXT<br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">O</span> <span style="color: #00C800;">Class</span>: <span style="color: #000000;">ERROR</span><br /> TBTNBMP:<span style="color: #00C800;">NEW</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">1</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">2</span>: <span style="color: #000000;">U</span> <br /> TBTNBMP:<span style="color: #000000;">SAVE</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">1</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">2</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">3</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">4</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">5</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">6</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">7</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">8</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">9</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">10</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">11</span>: <span style="color: #000000;">C</span> <span style="color: #ff0000;">" "</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">12</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">13</span>: <span style="color: #000000;">L</span> .F.<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">14</span>: <span style="color: #000000;">L</span> .F.<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">15</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">16</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">17</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">18</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">19</span>: <span style="color: #000000;">L</span> .T.<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">20</span>: <span style="color: #000000;">C</span> <span style="color: #ff0000;">"TOP"</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">21</span>: <span style="color: #000000;">L</span> .F.<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">22</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">23</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">24</span>: <span style="color: #000000;">L</span> .F.<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">25</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">26</span>: <span style="color: #000000;">L</span> .T.<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">27</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">28</span>: <span style="color: #000000;">L</span> .T.<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">29</span>: <span style="color: #000000;">L</span> .F.<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">30</span>: <span style="color: #000000;">S</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">31</span>: <span style="color: #000000;">O</span> <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TBTNBMP</span><br /> <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>TVENDORS_FULLEDIT<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">1</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">2</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">3</span>: <span style="color: #000000;">C</span> <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">4</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">5</span>: <span style="color: #000000;">O</span> <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TBTNBMP</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">6</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">7</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">0</span><br /> TBTNBMP:<span style="color: #0000ff;">CLICK</span><br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">O</span> <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TBTNBMP</span><br /> TBTNBMP:<span style="color: #000000;">LBUTTONUP</span><br /> TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">29</span><br /> Param <span style="color: #000000;">2</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">36</span><br /> Param <span style="color: #000000;">3</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">1</span>: <span style="color: #000000;">L</span> .T.<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">2</span>: <span style="color: #000000;">S</span> <br /> TBTNBMP:<span style="color: #000000;">HANDLEEVENT</span><br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">514</span><br /> Param <span style="color: #000000;">2</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">0</span><br /> Param <span style="color: #000000;">3</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">1900580</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">1</span>: <span style="color: #000000;">U</span> <br /> _FWH<br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">514</span><br /> Param <span style="color: #000000;">2</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">0</span><br /> Param <span style="color: #000000;">3</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">1900580</span><br /> DIALOGBOX<br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">1900580</span><br /> Param <span style="color: #000000;">2</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">514</span><br /> Param <span style="color: #000000;">3</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">0</span><br /> Param <span style="color: #000000;">4</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">1900580</span><br /> Param <span style="color: #000000;">5</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">76</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">1</span>: <span style="color: #000000;">O</span> <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TBTNBMP</span><br /> TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">3211264</span><br /> Param <span style="color: #000000;">2</span>: <span style="color: #000000;">C</span> <span style="color: #ff0000;">"PRO5210W"</span><br /> Param <span style="color: #000000;">3</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">7146848</span><br /> Param <span style="color: #000000;">4</span>: <span style="color: #000000;">O</span> <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TDIALOG</span><br /> TVENDORS:<span style="color: #000000;">FULLEDIT</span><br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">2</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">3</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">4</span>: <span style="color: #000000;">L</span> .F.<br /> Param <span style="color: #000000;">5</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">6</span>: <span style="color: #000000;">L</span> .T.<br /> Param <span style="color: #000000;">7</span>: <span style="color: #000000;">B</span> <span style="color: #000000;">{</span>|| ... <span style="color: #000000;">}</span><br /> Param <span style="color: #000000;">8</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">9</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">10</span>: <span style="color: #000000;">L</span> .F.<br /> Param <span style="color: #000000;">11</span>: <span style="color: #000000;">L</span> .F.<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">1</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">7146848</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">2</span>: <span style="color: #000000;">S</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">3</span>: <span style="color: #000000;">O</span> <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TDIALOG</span><br /> <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>MAIN<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">1</span>: <span style="color: #000000;">O</span> <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TVENDORS</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">2</span>: <span style="color: #000000;">A</span> Len: <span style="color: #000000;">163</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">3</span>: <span style="color: #000000;">A</span> Len: <span style="color: #000000;">249</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">4</span>: <span style="color: #000000;">A</span> Len: <span style="color: #000000;">65</span><br /> TBTNBMP:<span style="color: #0000ff;">CLICK</span><br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">O</span> <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TBTNBMP</span><br /> TBTNBMP:<span style="color: #000000;">LBUTTONUP</span><br /> TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">55</span><br /> Param <span style="color: #000000;">2</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">22</span><br /> Param <span style="color: #000000;">3</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">1</span>: <span style="color: #000000;">L</span> .T.<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">2</span>: <span style="color: #000000;">S</span> <br /> TBTNBMP:<span style="color: #000000;">HANDLEEVENT</span><br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">514</span><br /> Param <span style="color: #000000;">2</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">0</span><br /> Param <span style="color: #000000;">3</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">3604502</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">1</span>: <span style="color: #000000;">U</span> <br /> _FWH<br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">514</span><br /> Param <span style="color: #000000;">2</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">0</span><br /> Param <span style="color: #000000;">3</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">3604502</span><br /> WINRUN<br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">3604502</span><br /> Param <span style="color: #000000;">2</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">514</span><br /> Param <span style="color: #000000;">3</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">0</span><br /> Param <span style="color: #000000;">4</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">3604502</span><br /> Param <span style="color: #000000;">5</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">9</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">1</span>: <span style="color: #000000;">O</span> <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TBTNBMP</span><br /> TWINDOW:<span style="color: #0000ff;">ACTIVATE</span><br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">N</span> <span style="color: #000000;">7146848</span><br /> MAIN<br /> Param <span style="color: #000000;">1</span>: <span style="color: #000000;">C</span> <span style="color: #ff0000;">"MAXIMIZED"</span><br /> Param <span style="color: #000000;">2</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">3</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">4</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">5</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">6</span>: <span style="color: #000000;">B</span> <span style="color: #000000;">{</span>|| ... <span style="color: #000000;">}</span><br /> Param <span style="color: #000000;">7</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">8</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">9</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">10</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">11</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">12</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">13</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">14</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">15</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">16</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">17</span>: <span style="color: #000000;">B</span> <span style="color: #000000;">{</span>|| ... <span style="color: #000000;">}</span><br /> Param <span style="color: #000000;">18</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">19</span>: <span style="color: #000000;">U</span> <br /> Param <span style="color: #000000;">20</span>: <span style="color: #000000;">L</span> .F.<br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">1</span>: <span style="color: #000000;">O</span> <span style="color: #00C800;">Class</span>: <span style="color: #000000;">TWINDOW</span><br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">2</span>: <span style="color: #000000;">U</span> <br /> <span style="color: #00C800;">Local</span> <span style="color: #000000;">3</span>: <span style="color: #000000;">U</span> <br /><br />Linked RDDs<br />===========<br /> DBF<br /> DBFFPT<br /> DBFBLOB<br /> DBFCDX<br /> DBFNTX<br /> ADS<br /> ADSADT<br /> ADSVFP<br /> ADSCDX<br /> ADSNTX<br /><br />DataBases in use<br />================<br /><br /> <span style="color: #000000;">1</span>: => DB001 RddName: <span style="color: #000000;">ADSCDX</span><br /> ==============================<br /> RecNo RecCount BOF EOF<br /> <span style="color: #000000;">169</span> <span style="color: #000000;">228</span> .F. .F.<br /><br /> Indexes in use TagName<br /> acpnum AAPVEN<br /> => upper<span style="color: #000000;">(</span>acpcom<span style="color: #000000;">)</span> AAPCOM<br /><br /> Relations in use<br /><br /> <span style="color: #000000;">2</span>: <span style="color: #000000;">DB002</span> RddName: <span style="color: #000000;">ADSCDX</span><br /> ==============================<br /> RecNo RecCount BOF EOF<br /> <span style="color: #000000;">186</span> <span style="color: #000000;">185</span> .F. .T.<br /><br /> Indexes in use TagName<br /> => acpnum AAPTRN<br /> acpnum+DTOS<span style="color: #000000;">(</span>acppdt<span style="color: #000000;">)</span> AAPTRD<br /> acpnum+acpinv AAPTRR<br /><br /> Relations in use<br /><br />Classes in use:<br />===============<br /> <span style="color: #000000;">1</span> ERROR<br /> <span style="color: #000000;">2</span> HBCLASS<br /> <span style="color: #000000;">3</span> HBOBJECT<br /> <span style="color: #000000;">4</span> TCALC<br /> <span style="color: #000000;">5</span> TFONT<br /> <span style="color: #000000;">6</span> TDATABASE<br /> <span style="color: #000000;">7</span> TDATA<br /> <span style="color: #000000;">8</span> TCONFIG<br /> <span style="color: #000000;">9</span> TBRUSH<br /> <span style="color: #000000;">10</span> TWINDOW<br /> <span style="color: #000000;">11</span> TCONTROL<br /> <span style="color: #000000;">12</span> TBITMAP<br /> <span style="color: #000000;">13</span> TDIALOG<br /> <span style="color: #000000;">14</span> TGET<br /> <span style="color: #000000;">15</span> <span style="color: #0000ff;">GET</span><br /> <span style="color: #000000;">16</span> TCLIPGET<br /> <span style="color: #000000;">17</span> TBTNBMP<br /> <span style="color: #000000;">18</span> TRECT<br /> <span style="color: #000000;">19</span> TICON<br /> <span style="color: #000000;">20</span> TMENU<br /> <span style="color: #000000;">21</span> TMENUITEM<br /> <span style="color: #000000;">22</span> TBAR<br /> <span style="color: #000000;">23</span> TMSGBAR<br /> <span style="color: #000000;">24</span> TMSGITEM<br /> <span style="color: #000000;">25</span> TTIMER<br /> <span style="color: #000000;">26</span> TVENDORS<br /> <span style="color: #000000;">27</span> TLEDGER<br /> <span style="color: #000000;">28</span> TVENDORDATA<br /> <span style="color: #000000;">29</span> TCOMBOBOX<br /> <span style="color: #000000;">30</span> TMULTIGET<br /> <span style="color: #000000;">31</span> TXBROWSE<br /> <span style="color: #000000;">32</span> TXBRWCOLUMN<br /> <span style="color: #000000;">33</span> TBUTTON<br /> <span style="color: #000000;">34</span> TBUTTONBMP<br /> <span style="color: #000000;">35</span> TSCROLLBAR<br /> <span style="color: #000000;">36</span> TREG32<br /><br />Memory Analysis<br />===============<br /> <span style="color: #000000;">762</span> <span style="color: #00C800;">Static</span> variables<br /><br /> Dynamic memory consume:<br /> <span style="color: #000000;">Actual</span> Value: <span style="color: #000000;">0</span> bytes<br /> Highest Value: <span style="color: #000000;">0</span> bytes<br /><br /><br /> </div>[/code:1rvonew7]
|
BtnBmp
|
Tim,
As I guesssed, oWnd is nil.
Please show here the source code line contents where you create that BtnBmp, thanks
|
BtnBmp
|
Did you by any chance have a code like:
[code=fw:3r02c3ef]<div class="fw" id="{CB}" style="font-family: monospace;">@ r,c, <span style="color: #0000ff;">BTNBMP</span> oBtn ............... <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">Save</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:3r02c3ef]
This does not get translated as <yourclass>:Save() but gets translated as oBtn:Save()
|
BtnBmp
|
Tim,
If you are doing what Rao said, and if ::save() is a method of a TData or TRecord subclass, then you should not be making user interface code as part of the subclass, but rather passing the data object to the UI code. Remember that data objects should be models of real-world objects (e.g. customers, parts, etc.) and thus should not contain UI code.
If that is not what you are doing, then ignore everything I just said.
James
|
BtnBmp
|
Rao,
That resolved it. Thanks.
James,
The older I get, the less perfect I see the "real world".
I have separate data and interface classes. It's all part of my cleanup strategy and it works nicely.
To me, a user interface should no longer be a function, it should be a class. I've got so many functions that do essentially the same task, so all of those are being condensed into one for like actions. The code base is getting smaller and far more manageable.
Tim
|
BtnBmp (SOLVED)
|
Hi you all,
Does anyone knows how to get rid of this anoying line surronding BtnBmp's???
[img:3t26gl24]http://www.mayapos.com/FiveWin/boton3.png[/img:3t26gl24]
It appears when the mouse is on top of the button...
I've tried [color=#FF0000:3t26gl24]:lBoxSelect := .F.[/color:3t26gl24]
Which is the only thing I found in the class that I think can do anything about it, but it does not do it....
Any help will be appreciated....
Thanks!!!
|
BtnBmp (SOLVED)
|
test with
oBtnbmp:lTRANSPARENT = .T.
saluti
Stefano
|
BtnBmp (SOLVED)
|
Thanks Stefano, but I already tried and did not work, It seems that I get this effect because of the color of my bitmaps, when I use a picture it does no doit...
I think it does that to create the effect of movement in the button....
|
BtnBmp (SOLVED)
|
I included this Button, but cannot discover such Effect.
Maybe the way the Background is defined ?
[img:2zda8n9l]http://www.pflegeplus.com/pictures/btnfoc1.jpg[/img:2zda8n9l]
Best Regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
BtnBmp (SOLVED)
|
This is the way I define the control:
[code=fw:1r4e59c6]<div class="fw" id="{CB}" style="font-family: monospace;">@ <span style="color: #000000;">(</span> Cuadro2<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> + <span style="color: #000000;">(</span> Btn2Height * <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> Cuadro2<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> + <span style="color: #000000;">(</span> Btn2Width * <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">BTNBMP</span> oBtnA<span style="color: #000000;">[</span> <span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">OF</span> oDialog FILENAME <span style="color: #ff0000;">"<span style="color: #000000;">\M</span>ayaPOS<span style="color: #000000;">\g</span>raficos<span style="color: #000000;">\b</span>otones<span style="color: #000000;">\b</span>rush<span style="color: #000000;">\n</span>egro-rojo.bmp"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">(</span> Btn2Width - <span style="color: #000000;">7</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> Btn2Height - <span style="color: #000000;">5</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ADJUST</span> NOBORDER<br /> </div>[/code:1r4e59c6]
|
BtnBmp (SOLVED)
|
try this example
bmp 32 bit
Stefano
+ + + + + + +
// Dialog test
#include "FiveWin.ch"
static oDlg,obmp
//----------------------------------------------------------------------------//
function Main()
DEFINE DIALOG oDlg TITLE "Dialog 1" FROM 0, 0 TO 20, 40 TRANSPARENT
* say ....
* get ....
ACTIVATE DIALOG oDlg CENTERED ON INIT (GradBrush( oDlg,nRGB( 255, 255, 255 ),rgb(255,246,143 )),[color=#0000FF:w57fkfyt]dlgbmp()[/color:w57fkfyt])
return nil
FUNCTION [color=#0000FF:w57fkfyt]dlgbmp()[/color:w57fkfyt]
@30,30 BTNBMP obmp file "..\bitmaps\exit.bmp" NOBORDER ACTION oDlg:end() of oDlg pixel SIZE 26,26
obmp:lTRANSPARENT = .T.
RETURN (NIL)
STATIC FUNCTION GradBrush( oDlgkk,color1,color2)
local hDC, hBmp, hBmpOld,obrush
hDC = CreateCompatibleDC( oDlgkK:GetDC() )
hBmp = CreateCompatibleBitMap( oDlgkK:hDC, oDlgkK:nWidth, oDlgkK:nHeight )
hBmpOld = SelectObject( hDC, hBmp )
Gradient( hDC, {0, 0, oDlgkk:nHeight, oDlgKk:nWidth } ,color1,color2, .t. )
DeleteObject( oDlgkK:oBrush:hBrush )
oDlgkK:oBrush:hBitmap = hBmp
oDlgkK:oBrush:hBrush = CreatePatternBrush( hBmp )
SelectObject( hDC, hBmpOld )
oDlgKk:ReleaseDC()
RETURN (nil)
//-------------------------------------------------------------------//
DLL32 FUNCTION CREATECOMPATIBLEBITMAP( hDC AS LONG,;
nWidth AS LONG,;
nHeight AS LONG) AS LONG;
PASCAL FROM "CreateCompatibleBitmap" LIB "gdi32.dll"
|
BtnBmp (SOLVED)
|
Thanks Mr. Stefano, but it did not worked for me when applied to my window...
In your sample, the new dialog copies the background for some reazon...
This is an example that reproduces the problem:
[code=fw:1r0btrcv]<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;">static</span> oDialog<br /><br /><span style="color: #00C800;">FUNCTION</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oDialog ;<br /> <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> WndHeight<span style="color: #000000;">(</span> GetDesktopWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ; <span style="color: #B900B9;">//- fhTaskBar() )</span><br /> WndWidth<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> GetDesktopWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">PIXEL</span> ;<br /> <span style="color: #0000ff;">COLOR</span> CLR_WHITE,CLR_BLACK;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Button"</span>;<br /> <span style="color: #0000ff;">STYLE</span> nOR<span style="color: #000000;">(</span> WS_POPUP <span style="color: #000000;">)</span>;<br /> NOSYSMENU <br /> <br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">BTNBMP</span> oBtnA <span style="color: #0000ff;">OF</span> oDialog FILENAME <span style="color: #ff0000;">"negro-rojo.bmp"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ADJUST</span> NOBORDER<br /> <br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oDialog<br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">NIL</span></div>[/code:1r0btrcv]
|
BtnBmp (SOLVED)
|
Yes, there are different Results.
Make a Test and define a brush-function on [color=#FF0000:2evxd0iw]Init[/color:2evxd0iw] with the included Buttons.
On Button-click, there are no white borders.
[code=fw:2evxd0iw]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">PUBLIC</span> c_path := CURDRIVE<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">":<span style="color: #000000;">\"</span> + GETCURDIR() <br /><br />DEFINE WINDOW oWndMain ;<br /> FROM 0, 0 TO WndHeight( GetDesktopWindow() ), ; //- fhTaskBar() )<br /> WndWidth( ( GetDesktopWindow() ) ) ;<br /> PIXEL ;<br /> TITLE "</span><span style="color: #0000ff;">Button</span><span style="color: #ff0000;">";<br /> STYLE nOR( WS_POPUP );<br /> NOSYSMENU <br /> <br />ACTIVATE WINDOW oWndMain ;<br />ON INIT SHOW_BTN(oWndMain)<br /><br />Return NIL<br /><br />// -----------------<br /><br />FUNCTION SHOW_BTN(oWndMain)<br />LOCAL oBrush, oBtnA<br /><br />DEFINE BRUSH oBrush COLOR 0 // Black<br />SET BRUSH OF oWndMain TO oBrush<br />RELEASE BRUSH oBrush<br /><br />@ 10,10 BTNBMP oBtnA OF oWndMain FILENAME c_path + "</span>\<span style="color: #0000ff;">Images</span>\Button1.bmp<span style="color: #ff0000;">" SIZE 80, 80 ;<br />CENTER PIXEL ADJUST NOBORDER<br />oBtnA:lTransparent := .T.<br /><br />RETURN NIL <br /></span></div>[/code:2evxd0iw]
|
BtnBmp (SOLVED)
|
That made it with BtnBmp, thanks Uwe, and one more thanks for all the great tools you facilitate to this forum...
|
BtnBmp (SOLVED)
|
That Made it with the painting!!!
But is there any way to detect any changes in the control???
For Example, when the mouse is over it (lMOver becomes .T.), is there a way to detect this and run an action for it???
What I will like to do is set a Text color for every state of the control : Normal, Mouse Over it and Button Pressed...
With SBUTTON I could acheive this by just setting the button COLORS like this:
[code=fw:1ui5cw57]<div class="fw" id="{CB}" style="font-family: monospace;">COLORS <span style="color: #000000;">{</span> |oBtnF| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! oBtnF:<span style="color: #000000;">lActive</span>, CLR_WHITE, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oBtnF:<span style="color: #000000;">lMouseOver</span>, CLR_HGREEN, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oBtnF:<span style="color: #000000;">lPressed</span>, CLR_HRED, CLR_WHITE <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span></div>[/code:1ui5cw57]
Thanks for any help, because I have been looking in SOURCE\CLASSES\btnbmp.prg and can't find a way to doit automatically using SetColor()...
|
BtnBmp (SOLVED)
|
You can change the Button-textcolor on any other Control-action :
[img:2tg87y05]http://www.pflegeplus.com/pictures/btncolor.jpg[/img:2tg87y05]
// --------------------
FUNCTION SHOW_BTN(oWndMain)
@ 200, 200 BTNBMP oBtnA OF oWndMain ;
SIZE 80, 80 PIXEL ;
NOBORDER ;
ADJUST ;
PROMPT "&Exit" ;
FILENAME c_path + "\Images\Button1.Bmp" ;
ACTION oWndMain:End() ;
FONT oFont[2] ;
CENTER
oBtnA:lTransparent := .t.
oBtnA:cToolTip = { "Exit Dialog","Exit", 1, CLR_BLACK, 14089979 }
[color=#0000FF:2tg87y05]oBtnA:SetColor( 16776960, )[/color:2tg87y05] // Startup
// ------------------
From the Explorerbar ( Mainwindow )
( The Buttons [color=#0000FF:2tg87y05]oBtnA.., oBtnB..., [/color:2tg87y05]defined as STATIC )
oExBar = TExplorerBar():New(150, 0, 150, 830, oWndMain)
oPanel1 = oExBar:AddPanel( "One", c_path + "\Images\people.bmp" )
oPanel1:AddLink( "First item", { |o| [color=#0000FF:2tg87y05]oBtnA:SetColor( 65535, ), oBtnA:Refresh() [/color:2tg87y05]}, ;
c_path + "\Images\additem.bmp")
oPanel1:AddLink( "Second item", { |o| [color=#0000FF:2tg87y05]oBtnA:SetColor( 11009871, ), oBtnA:Refresh()[/color:2tg87y05] }, ;
c_path + "\Images\copy.bmp")
oPanel1:lSpecial = .T.
oPanel1:oFont := oFont[1]
RETURN NIL
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
BtnBmp (SOLVED)
|
Thanks Uwe for taking the time to answer, and sorry for not posting this message before, but I was able to get the changes that I needed by doing what I explain in the following post:
[url:1nm8xziv]http://forums.fivetechsupport.com/viewtopic.php?f=22&t=22328#p118911[/url:1nm8xziv]
Thanks for your help, your insight is always welcome!!!!
|
BtnBmp - how to get id number of focused button?
|
[code:31jkmdju]
FOR nM := 1 TO 12
cM := str0(nM,2)
dDay := ctod('01.'+cM+"."+cYear)
FOR nD := 1 TO 31
aKolor := aKol(nD,cKld&cM)
IF month(dDay)==nM
oBtn1:=tBtnBmp():Redefine((nM*1000)+nD,,,,,,{|| msgInfo(KardSay(focused_button_id))},oDlg,,,,KardSay(focused_button_id),str(nD,2)+":"+aTab[dow(dDay)],oFont)
oBtn1:SetColor(aKolor[1],aKolor[2])
ENDIF
dDay++
NEXT
NEXT
[/code:31jkmdju]
oDlg is dialog with button for each day
aKol return different array of color fo every day of a weak
I wish display info by using tooltip and msgInfo. How can i get id number of focused btnBmp?
regards Eugeniusz
|
BtnBmp - how to get id number of focused button?
|
Can you build a reduced and self-contained sample to experiment with?
EMG
|
BtnBmp - how to get id number of focused button?
|
Eugeniusz,
Change the variable focused_button_id into a function call:
[code:ipkxqjxr]
function focused_button_id( oDlg )
local nAt := AScan( oDlg:aControls, { | o | o:lFocused } )
return If( nAt != 0, oDlg:aControls[ nAt ]:nId, 0 )
[/code:ipkxqjxr]
|
BtnBmp - how to get id number of focused button?
|
Antonio
as usualy Your help is great and every button reports now its id number.
But what i have to do to display this number as cTooltip (it display id=0)?
regards Eugeniusz.
|
BtnBmp - how to get id number of focused button?
|
Eugeniusz,
Do you mean this ? In your loop:
[code:2vtzqusu]
oBtn1:=tBtnBmp():Redefine((nM*1000)+nD,,,,,,{|| msgInfo(KardSay(focused_button_id))},oDlg,,,,KardSay(focused_button_id),str(nD,2)+":"+aTab[dow(dDay)],oFont)
oBtn1:SetColor(aKolor[1],aKolor[2])
oBtn1:cToolTip := Str( oBtn1:nId )
[/code:2vtzqusu]
|
BtnBmp - how to get id number of focused button?
|
Yes - second KardSay()
Eugeniusz
|
BtnBmp - how to get id number of focused button?
|
Eugeniusz,
oBtn1:cToolTip := Str( oBtn1:nId )
Is it ok ?
|
BtnBmp - how to get id number of focused button?
|
Antonio,
Yes, it works - it's to simple .
Thank You.
Eugeniusz
|
BtnBmp 9.04 enhancements !
|
Automatic support for Alpha Channel in bitmaps, rounded corners, much better text and image display, many enhancements. Many thanks to Master Daniel for his great help <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Please notice how the images have "colored" reflexes thanks to Alpha channel support:
[img:2shqw9bd]http://img24.imageshack.us/img24/1935/65088789.png[/img:2shqw9bd]
|
BtnBmp 9.04 enhancements !
|
Dear Mr.Antonio,
Superb !!! Looks really great.
Regards
Anser
|
BtnBmp 9.04 enhancements !
|
Great Job. I'm waiting to use it.
Dutch
|
BtnBmp 9.04 enhancements !
|
Would this mean ButtonBmp would also have this feature?
|
BtnBmp 9.04 enhancements !
|
Hua,
> Would this mean ButtonBmp would also have this feature?
Yes! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
BtnBmp 9.04 enhancements !
|
Gret! <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> I always got confused between the two and not sure what the difference are.
|
BtnBmp 9.04 enhancements !
|
Hua,
Class TButtonBmp is based on Windows standard buttons, so it has Windows themes support.
They look like Windows buttons but use images. Now they can use Alpha channel bitmaps too! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
BtnBmp 9.04 mejoras!
|
Soporte automatico para canal Alpha en bitmaps, esquinas redondeadas, pintado mejorado de texto e imagen, muchas mejoras. Gracias al Maestro Daniel por su gran ayuda <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Fijaros en que las imágenes tienen reflejos "coloreados" gracias al soporte de Alpha channel:
[img:20lsbcuv]http://img24.imageshack.us/img24/1935/65088789.png[/img:20lsbcuv]
|
BtnBmp 9.04 mejoras!
|
Antonio..
Las mejoras son solo para la BtnBmp, o hay alguna otra clase mas incluida.. como la tBitmap, tImage...
Seria genial usarlos en las tImageList, tRebar.. tendrias un gran cambio en cuanto a presentacion visual se refiere.. muy moderno, actual... como para competir con cualquier otro visual.
Si es asi.... da por cierto que me actualizo inmediatamente a la 9.04, he estado esperando por algun "cambio" importante, y como se vienen 2 desarrollos grandes desde cero.. seria ideal.
Saludos.
Desde Chile
Adolfo
|
BtnBmp 9.04 mejoras!
|
Adolfo,
De momento solo en TBtnBmp.
Hay que publicar una versión 9.04 cuanto antes para que los ACTIVEX se usen bien con la nueva capacidad de usar objetos OleAuto, y que asi no haya que rehacer código.
Aparte de esos, hay más cambios importantes <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
BtnBmp : Text Alignments
|
We know that by using the clause LEFT/RIGHT/TOP/BOTTOM while creating a bitmap, the prompt is aligned opposite to the bitmap.
Now there is a way to make finer adjustments in the alignment of text, right/center/left by adding a space on left,right or both sides of the prompt
[url=https://imageshack.com/i/pmQH3nGQp:3a6foaft][img:3a6foaft]http://imagizer.imageshack.us/v2/xq90/922/QH3nGQ.png[/img:3a6foaft][/url:3a6foaft]
"Prompt" --> Default alignment
"Prompt " --> Left Alignment
" Prompt" --> Right Alignment
" Prompt " --> Center (horizontally) Alignment.
Following sample, demonstrates the usage.
[code=fw:3a6foaft]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> BtnText1<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg, oBtn, oFont<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-16</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">460</span>,<span style="color: #000000;">460</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"BTNBMP TEXT ALIGNMENTS"</span><br /><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">BTNBMP</span> oBtn FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\t</span>ask.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Default"</span> + CRLF + <span style="color: #ff0000;">"Alignment"</span> <span style="color: #0000ff;">LEFT</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">60</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">100</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">BTNBMP</span> oBtn FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\c</span>opy.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Left"</span> + CRLF + <span style="color: #ff0000;">"Alignment "</span> <span style="color: #0000ff;">LEFT</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">60</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">180</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">BTNBMP</span> oBtn FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\p</span>aste.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" Center"</span> + CRLF + <span style="color: #ff0000;">"Alignment "</span> <span style="color: #0000ff;">LEFT</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">60</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">240</span> <span style="color: #0000ff;">BTNBMP</span> oBtn FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\t</span>ask.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Default"</span> + CRLF + <span style="color: #ff0000;">"Alignment"</span> <span style="color: #0000ff;">RIGHT</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">60</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">100</span>,<span style="color: #000000;">240</span> <span style="color: #0000ff;">BTNBMP</span> oBtn FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\c</span>opy.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" Right"</span> + CRLF + <span style="color: #ff0000;">"Alignment"</span> <span style="color: #0000ff;">RIGHT</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">60</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">180</span>,<span style="color: #000000;">240</span> <span style="color: #0000ff;">BTNBMP</span> oBtn FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\p</span>aste.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" Center"</span> + CRLF + <span style="color: #ff0000;">"Alignment "</span> <span style="color: #0000ff;">RIGHT</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">60</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">260</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BTNBMP</span> oBtn FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\t</span>ask.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Left "</span> TOP ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">128</span>,<span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">260</span>,<span style="color: #000000;">165</span> <span style="color: #0000ff;">BTNBMP</span> oBtn FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\c</span>opy.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Default"</span> TOP ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">128</span>,<span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">260</span>,<span style="color: #000000;">312</span> <span style="color: #0000ff;">BTNBMP</span> oBtn FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\p</span>aste.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" Right"</span> TOP ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">128</span>,<span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">360</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BTNBMP</span> oBtn FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\t</span>ask.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Left "</span> BOTTOM ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">128</span>,<span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">360</span>,<span style="color: #000000;">165</span> <span style="color: #0000ff;">BTNBMP</span> oBtn FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\c</span>opy.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Default"</span> BOTTOM ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">128</span>,<span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #000000;">2007</span><br /><br /> @ <span style="color: #000000;">360</span>,<span style="color: #000000;">312</span> <span style="color: #0000ff;">BTNBMP</span> oBtn FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\p</span>aste.bmp"</span> ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" Right"</span> BOTTOM ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">128</span>,<span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #000000;">2007</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:3a6foaft]
|
BtnBmp : Text Alignments
|
I have been doing that for columns in xbrowse. Otherwise the column line may sit right next to the first letter making it difficult to read. It's easy to do and makes the appearance better.
|
BtnBmp : Text Alignments
|
[quote="TimStone":2vm0dovy]I have been doing that for columns in xbrowse. Otherwise the column line may sit right next to the first letter making it difficult to read. It's easy to do and makes the appearance better.[/quote:2vm0dovy]
Do you mean to say that the default margin we provide is not enough? Do you suggest we provide more margin on the left?
If you can please explain we see how we can provide a better and clearer presentation by default
|
BtnBmp : Text Alignments
|
When we allow the columns to autosize, I found sometimes they would be tight on the headers and the first and/or last letters would not display cleanly.
So I added a space before and after each header, and it all worked perfectly.
Tim
|
BtnBmp New DATA aPromptClrs
|
Basically I want to have a Color of Text Set for events, similar to what cBmpFile1, cBmpFile2, cBmpFile3 and cBmpFile4 do, but even if only one Bmp file is set.
This way, if I set only one BMP, I still have the effect of something changing in the button when an event happens (Button Enabled, Mouse Over, Button Pressed, Button Disabled...
I think METHOD SetColor( nClrText, nClrPane ) can be used for that effect....
I am planning to Update some time the beginning of next year, but I will like to have something done before that, I think the class can be modified rather easily by some one with CLASS programming experience, I will try to do my self, but I don't want to corrupt the class, If someone can help, I think it may be of benefit for everyone.... Thanks!!!
|
BtnBmp New DATA aPromptClrs
|
I was able to obtain what I wanted, harcoding the following lines:
[code=fw:2z8nxxor]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #000000;">254</span> ::<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span>, ::<span style="color: #000000;">lMOver</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !::<span style="color: #000000;">lMOver</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_BLACK , ::<span style="color: #000000;">nClrText</span> := CLR_WHITE <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span> , ::<span style="color: #000000;">nClrText</span> := CLR_HRED , <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_YELLOW , ::<span style="color: #000000;">nClrText</span> := CLR_HGREEN <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #000000;">357</span> ::<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span>, ::<span style="color: #000000;">lMOver</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !::<span style="color: #000000;">lMOver</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_BLACK , ::<span style="color: #000000;">nClrText</span> := CLR_WHITE <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span> , ::<span style="color: #000000;">nClrText</span> := CLR_HRED , <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_YELLOW , ::<span style="color: #000000;">nClrText</span> := CLR_HGREEN <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #000000;">500</span> ::<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span>, ::<span style="color: #000000;">lMOver</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !::<span style="color: #000000;">lMOver</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_BLACK , ::<span style="color: #000000;">nClrText</span> := CLR_WHITE <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span> , ::<span style="color: #000000;">nClrText</span> := CLR_HRED , <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_YELLOW , ::<span style="color: #000000;">nClrText</span> := CLR_HGREEN <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #000000;">1287</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span>, ::<span style="color: #000000;">lMOver</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !::<span style="color: #000000;">lMOver</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_BLACK , ::<span style="color: #000000;">nClrText</span> := CLR_WHITE <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span> , ::<span style="color: #000000;">nClrText</span> := CLR_HRED , <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_YELLOW , ::<span style="color: #000000;">nClrText</span> := CLR_HGREEN <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hDC</span>,;<br /><br /><span style="color: #000000;">1311</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span>, ::<span style="color: #000000;">lMOver</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !::<span style="color: #000000;">lMOver</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_BLACK , ::<span style="color: #000000;">nClrText</span> := CLR_WHITE <span style="color: #000000;">)</span> , <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span> , ::<span style="color: #000000;">nClrText</span> := CLR_HRED , <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_YELLOW , ::<span style="color: #000000;">nClrText</span> := CLR_HGREEN <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hDC</span>,;<br /><br /><span style="color: #000000;">1318</span> nClr = <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> IsWindowEnabled<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !::<span style="color: #000000;">lMOver</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_BLACK , ::<span style="color: #000000;">nClrText</span> := CLR_WHITE <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span> , ::<span style="color: #000000;">nClrText</span> := CLR_HRED , <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_YELLOW , ::<span style="color: #000000;">nClrText</span> := CLR_HGREEN <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lDisColor</span>, CLR_HGRAY, ::<span style="color: #000000;">nClrTextDis</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #000000;">1172</span> nClr = <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> IsWindowEnabled<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !::<span style="color: #000000;">lMOver</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_BLACK , ::<span style="color: #000000;">nClrText</span> := CLR_WHITE <span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span> , ::<span style="color: #000000;">nClrText</span> := CLR_HRED , <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lCalcColor</span> = .t. , ::<span style="color: #000000;">nClrText</span> := CLR_YELLOW , ::<span style="color: #000000;">nClrText</span> := CLR_HGREEN <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lDisColor</span>, CLR_HGRAY , ::<span style="color: #000000;">nClrTextDis</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span></div>[/code:2z8nxxor]
::lCalcColor is a DATA I added to have a diferent color for the button where ::lCalcColor = .t.
It looks great....
[img:2z8nxxor]http://www.mayapos.com/FiveWin/boton4.png[/img:2z8nxxor]
I hope it will be SOFTCODED and included in a next Fivewin release before next year, something like
[code=fw:2z8nxxor]<div class="fw" id="{CB}" style="font-family: monospace;">@ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">OF</span> oDialog FILENAME <span style="color: #ff0000;">"Boton.bmp"</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Boton1"</span> PROMPTCOLORS ColorActive, ColorMouseOver, ColorPressed, ColorDissabled <span style="color: #0000ff;">FONT</span> oFont1<br /> </div>[/code:2z8nxxor]
THANKS FOR THAKING THIS UNTO CONSIDERATION...
|
BtnBmp New DATA aPromptClrs
|
Just in case it can be included in FiveWin, I made changes to btnbmp.prg FWH12.04
[img:t9qlcu3b]http://www.mayapos.com/FiveWin/btnbmp.png[/img:t9qlcu3b]
New Datas:
[size=150:t9qlcu3b]nClrActive
nClrMouseOver
nClrPressed
nClrDisabled[/size:t9qlcu3b]
I sent you the modified class by e-mail...
|
BtnBmp Question
|
Hi,
Just testing 9.05 and have found that on some of my BtnBmps the word tBtnBmp is printed over the BMP - how do you turn this off? Is there a global setting? This seems to only happen on larger buttons that use the center clause
Thanks in advance
Pete
|
BtnBmp Question
|
Hello Pete,
I use 9.05 as well.
With my new buttontools, I can test all possible combinations :
from Source, Resource, 2007 Style, Transparent, Border and no Border.
BMP on left, top, bottom, right and centered.
On different backgrounds : colors, gradient, brushes and images.
A center problem, I didn't notice.
[img:ypub4tgx]http://www.pflegeplus.com/pictures/btntools31.jpg[/img:ypub4tgx]
Try a [color=#FF0000:ypub4tgx]empty[/color:ypub4tgx] Prompt.
[code=fw:ypub4tgx]<div class="fw" id="{CB}" style="font-family: monospace;"><br />@ <span style="color: #000000;">47</span>, <span style="color: #000000;">73</span> <span style="color: #0000ff;">BTNBMP</span> oBtn5 <span style="color: #0000ff;">OF</span> oDlg1 ;<br /><span style="color: #0000ff;">SIZE</span> D_BUTTONH, D_BUTTONV ;<br />FILENAME c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>roject<span style="color: #000000;">\"</span> + D_BUTTON2 ;<br />ACTION MsgAlert( "</span>Button-<span style="color: #0000ff;">Click</span><span style="color: #ff0000;">", "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">5</span><span style="color: #ff0000;">" ) ;<br />PROMPT "</span><span style="color: #ff0000;">" ; <br />FONT oButtFont ;<br />CENTER<br />oBtn5:lTransparent = .t. <br />oBtn5:cTooltip := "</span>Button5<span style="color: #ff0000;">"<br />oBtn5:SetColor( 9208556, )<br /></span></div>[/code:ypub4tgx]
Best Resgards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
BtnBmp Question
|
Don't know if this makes a difference, but i am building the button from a resource using the following code:
[code=fw:3mgngznq]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtn89 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">225</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"AUDIT"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span>ViewInvAudit<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,oBtn89:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,p_rimeth:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> TOOLTIP <span style="color: #ff0000;">"Invoice Audit"</span> <span style="color: #0000ff;">CENTER</span></div>[/code:3mgngznq]
The button looks like this:
[img:3mgngznq]http://img199.imageshack.us/img199/5332/audit.png[/img:3mgngznq]
|
BtnBmp Question
|
Fixed - it's the prompt setting
[code=fw:bkzk2cnu]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtn89 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">225</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"AUDIT"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span>ViewInvAudit<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,oBtn89:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,p_rimeth:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> TOOLTIP <span style="color: #ff0000;">"Invoice Audit"</span> <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">""</span></div>[/code:bkzk2cnu]
This now removes the text.
Antonio, is there any way that this could be modified so that if the prompt is not passed, the text does not appear?
Pete
|
BtnBmp Question
|
Pete,
The Test :
[img:1teyk1yh]http://www.pflegeplus.com/pictures/btntools32.jpg[/img:1teyk1yh]
The Code :
[code=fw:1teyk1yh]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Transparent-Style :</span><br /><span style="color: #B900B9;">// -----------------------</span><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtn5 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">210</span> <span style="color: #0000ff;">OF</span> oDlg3 ;<br />FILENAME c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>roject<span style="color: #000000;">\"</span> + D_BUTTON2 ;<br />ACTION MsgAlert( "</span>Button-<span style="color: #0000ff;">Click</span><span style="color: #ff0000;">", "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">5</span><span style="color: #ff0000;">" ) ;<br />PROMPT "</span><span style="color: #ff0000;">" ;<br />FONT oButtFont ;<br />CENTER<br />oBtn5:lTransparent = .t. <br />oBtn5:cTooltip := "</span>Button5<span style="color: #ff0000;">"<br />oBtn5:SetColor( 9208556, )<br /><br />// 2007 - Style :<br />// ----------------<br />REDEFINE BTNBMP oBtn5 ID 210 OF oDlg4 2007 ;<br />FILENAME c_path + "</span>\project\<span style="color: #ff0000;">" + D_BUTTON2 ;<br />ACTION MsgAlert( "</span>Button-<span style="color: #0000ff;">Click</span><span style="color: #ff0000;">", "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">5</span><span style="color: #ff0000;">" ) ;<br />PROMPT "</span><span style="color: #ff0000;">" ;<br />FONT oButtFont ;<br />CENTER<br />oBtn5:cTooltip := "</span>Button5<span style="color: #ff0000;">"<br />oBtn5:SetColor( 9208556, )<br /></span></div>[/code:1teyk1yh]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
BtnBmp Question
|
Uwe,
What happens if you remove PROMPT "" - do you get the same problem as i have?
Pete
|
BtnBmp Question
|
Think i've got it now!!
In my RC, the caption property for my button had tBtnBmp in it - if i remove that, the text does not appear. Previous versions of FW must have ignored this information.
Pete
|
BtnBmp Question
|
Pete,
We are going to review it, thanks for your feedback <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
BtnBmp Question
|
Antonio,
Thinking about it, the way it is working is probably the way it should work. For example, if a text string/field/say is defined in the RC file and you don't redefine the say, the text appears as it is entered in the resource - maybe thats the way btnbmp should work?
Regards,
Pete
|
BtnBmp Question
|
Hello Pete,
do You have a solution for transparent Button-Bmp on a image-background ?
I tested all solutions : Colors, Gradients, Styles, Brushes are working.
With a Image-background, transparent doesn't work ( tested from source and resource ).
I want to use empty transparent buttons as hotspot-areas.
[img:30mxpcz4]http://www.pflegeplus.com/pictures/transbutt1.jpg[/img:30mxpcz4]
[code=fw:30mxpcz4]<div class="fw" id="{CB}" style="font-family: monospace;"><br />...<br />...<br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">600</span> <span style="color: #0000ff;">of</span> oWnd <span style="color: #0000ff;">FONT</span> oDlgFont ;<br /><span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Buttons from Source Transparent"</span> TRANSPARENT<br />...<br />...<br /><span style="color: #B900B9;">// ----- Transparent button with NOBORDER ---------</span><br /><br />@ <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span> <span style="color: #0000ff;">BTNBMP</span> oBtn1 <span style="color: #0000ff;">OF</span> oDlg1 ;<br /><span style="color: #0000ff;">SIZE</span> D_BUTTONH, D_BUTTONV ;<br />NOBORDER ;<br />FILENAME c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>roject<span style="color: #000000;">\"</span> + D_BUTTON1 ;<br />ACTION MsgAlert( "</span>Button-<span style="color: #0000ff;">Click</span><span style="color: #ff0000;">", "</span><span style="color: #0000ff;">Button</span> <span style="color: #000000;">1</span><span style="color: #ff0000;">" ) ;<br />PROMPT "</span>But<span style="color: #000000;">.1</span><span style="color: #ff0000;">" ;<br />FONT oButtFont ;<br />RIGHT <br />oBtn1:lTransparent = .t. <br />oBtn1:cTooltip := "</span>Button1<span style="color: #ff0000;">"<br />...<br />...<br />ACTIVATE DIALOG oDlg1 CENTERED NOWAIT ;<br />ON INIT oDlg1:Move( 100, 20, 430, 290, .f. ) ;<br />ON PAINT DL_IMAGE( hDC, oDlg1 )<br /><br />RETURN NIL<br /><br />//------------- IMAGE - Background -------------------- <br /><br />FUNCTION DL_IMAGE( hDC, oDlg ) <br />LOCAL oImage<br /><br />LOCAL nWidth := oDlg:nWidth()<br />LOCAL nHeight := oDlg:nHeight()<br /><br />DEFINE IMAGE oImage1 FILE c_path + "</span>\project\<span style="color: #ff0000;">" + D_LOGO <br />PalBmpDraw( hDC, 0, 0, oImage1:hBitmap, , nWIDTH, nHEIGHT, , .T. ) <br /><br />RETURN NIL<br /></span></div>[/code:30mxpcz4]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
BtnBmp Question
|
Hi Uwe,
I don't use transparent button-bmp - did you mean to ask the question to Antonio?
Regards,
Pete
|
BtnBmp and PopupMenu
|
I wish Open a PopupMenu on Btnbmp I tried with
:bRClicked := { | nRow, nCol, oBtn | ShowActions( nRow, nCol,n, oBtn ) }
and
:bAction := { | nRow, nCol, oBtn | ShowActions( nRow, nCol,n, oBtn ) }
But it make error
[code=fw:2jugmeab]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">70</span><br /> @ nRow, nCol <span style="color: #0000ff;">BTNBMP</span> aBtn<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> .....<br /> WITH OBJECT aBtn<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">Cargo</span> := n<br />:<span style="color: #000000;">bRClicked</span> := <span style="color: #000000;">{</span> | nRow, nCol, oBtn | ShowActions<span style="color: #000000;">(</span> nRow, nCol,n, oBtn <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> END<br />.....<br /><span style="color: #00C800;">Function</span> ShowActions<span style="color: #000000;">(</span> nrow, ncol, n, oControl <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> oMenuPopup<br /> <span style="color: #0000ff;">MENU</span> <span style="color: #0000ff;">POPUP</span> oMenuPopup<br /> <span style="color: #0000ff;">MenuItem</span> <span style="color: #ff0000;">"aaaaaaaaaaaa"</span><br /> <span style="color: #0000ff;">MenuItem</span> <span style="color: #ff0000;">"bbbbbbbbbbbbb"</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">POPUP</span> oMenuPopup <span style="color: #0000ff;">of</span> oControl <span style="color: #00C800;">AT</span> nrow, ncol<br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">NIL</span></div>[/code:2jugmeab]
Any solution Please
|
BtnBmp and PopupMenu
|
What error ?
|
BtnBmp and PopupMenu
|
with baction I not see the menupopup
with :bRClicked I Have this error
[code=fw:nde5ai7h]<div class="fw" id="{CB}" style="font-family: monospace;">Application<br />===========<br /> Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">C</span>:\Work\Errori\image_su_btnbmp\test.Exe <span style="color: #000000;">(</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">Size</span>: <span style="color: #000000;">3</span>,<span style="color: #000000;">655</span>,<span style="color: #000000;">168</span> bytes<br /> Compiler version: <span style="color: #000000;">Harbour</span> <span style="color: #000000;">3.2</span>.0dev <span style="color: #000000;">(</span>r1703231115<span style="color: #000000;">)</span><br /> FiveWin version: <span style="color: #000000;">FWH</span> <span style="color: #000000;">17.12</span><br /> C compiler version: <span style="color: #000000;">Borland</span>/Embarcadero C++ <span style="color: #000000;">7.0</span> <span style="color: #000000;">(</span><span style="color: #000000;">32</span>-bit<span style="color: #000000;">)</span><br /> Windows version: <span style="color: #000000;">6.2</span>, Build <span style="color: #000000;">9200</span> <br /><br /> Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">3</span> secs <br /> Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">21</span><span style="color: #000000;">-06</span><span style="color: #000000;">-2018</span>, <span style="color: #000000;">16</span>:<span style="color: #000000;">26</span>:<span style="color: #000000;">13</span><br /> Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1004</span> No exported <span style="color: #00C800;">method</span>: <span style="color: #000000;">HWND</span><br /> Args:<br /> <span style="color: #000000;">[</span> <span style="color: #000000;">1</span><span style="color: #000000;">]</span> = N <span style="color: #000000;">2</span><br /><br />Stack Calls<br />===========<br /> Called <span style="color: #0000ff;">from</span>: => HWND<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;">MENU</span>.PRG => TMENU:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">(</span> <span style="color: #000000;">1568</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">test</span>.prg => SHOWACTIONS<span style="color: #000000;">(</span> <span style="color: #000000;">121</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">test</span>.prg => <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>SHOW_BEACH<span style="color: #000000;">(</span> <span style="color: #000000;">66</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TBTNBMP:<span style="color: #000000;">RBUTTONDOWN</span><span style="color: #000000;">(</span> <span style="color: #000000;">2018</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;">1731</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">BTNBMP</span>.PRG => TBTNBMP:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">1883</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;">3356</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</div>[/code:nde5ai7h]
|
BtnBmp and PopupMenu
|
Now I tried with
[code=fw:bewglwas]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">10</span><br /> @ nRow, nCol <span style="color: #0000ff;">BTNBMP</span> aBtn<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #0000ff;">RESOURCE</span> OMB_LIBERO ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">84</span>,<span style="color: #000000;">64</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg FLAT TOP <span style="color: #0000ff;">COLOR</span> CLR_WHITE,CLR_GREEN NOBORDER <br /><br />WITH OBJECT aBtn<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">Cargo</span> := n <br /> :<span style="color: #000000;">bRClicked</span> := <span style="color: #000000;">{</span> | nRow, nCol, oBtn | EseguiButton<span style="color: #000000;">(</span>nrow, ncol, n, oBtn<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> END<br /> <span style="color: #00C800;">next</span> n<br /><br /><span style="color: #00C800;">FUNCTION</span> EseguiButton<span style="color: #000000;">(</span> nrow, ncol, n, oControl <span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">{</span> |n| Menu_popup<span style="color: #000000;">(</span> nrow, ncol, n, oControl <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Menu_Popup<span style="color: #000000;">(</span> nrow, ncol, n, oControl <span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> oMenuPop<br /> <span style="color: #0000ff;">MENU</span> oMenuPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2015</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Apri "</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Apri "</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">POPUP</span> oMenuPop <span style="color: #0000ff;">OF</span> oControl <span style="color: #00C800;">AT</span> nrow, ncol<br /> oControl:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:bewglwas]
but not make error and not show the menu popup
|
BtnBmp and PopupMenu
|
Please, search for "detached locals technicque", in forum
It is very possible that this is the problem
|
BtnBmp and PopupMenu
|
???????
|
BtnBmp and PopupMenu
|
First please implement a small fix in btnbmp.prg.
Locate the following lines in the method ShowPopUp()
[code=fw:3lzhzp8a]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> GetClassName<span style="color: #000000;">(</span> GetParent<span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> != <span style="color: #ff0000;">"TBAR"</span><br /> oWnd = oWndFromhWnd<span style="color: #000000;">(</span> GetParent<span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:3lzhzp8a]
Comment out all the 3 lines above.
Next, please try this program:
[code=fw:3lzhzp8a]<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 /><br /> <span style="color: #00C800;">local</span> oDlg, oFont, aBtn<span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">local</span> aBmp := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"attach.bmp"</span>, <span style="color: #ff0000;">"browse.bmp"</span>, <span style="color: #ff0000;">"calc.bmp"</span>, <span style="color: #ff0000;">"cascade.bmp"</span>, <span style="color: #ff0000;">"copy.bmp"</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> n, nRow, nCol<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">700</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br /><br /> nRow := <span style="color: #000000;">40</span><br /> nCol := <span style="color: #000000;">40</span><br /><br /> <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">5</span><br /> @ nRow, nCol <span style="color: #0000ff;">BTNBMP</span> aBtn<span style="color: #000000;">[</span> n <span style="color: #000000;">]</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;">\3</span>2x32<span style="color: #000000;">\"</span> + aBmp[ n ] ;<br /> PROMPT NtoCMonth( n ) ;<br /> SIZE 100,100 PIXEL OF oDlg TOP FLAT COLOR CLR_WHITE,CLR_GREEN NOBORDER ACTION ::ShowPopup()<br /><br /> aBtn[ n ]:Cargo := n<br /> aBtn[ n ]:oPopUp := { |oBtn| BtnPopMenu( oBtn ) }<br /><br /> nCol += 120<br /> next<br /><br /> ACTIVATE DIALOG oDlg CENTERED<br /> RELEASE FONT oFont<br /><br />return nil<br /><br />function BtnPopMenu( oBtn )<br /><br /> local oPop<br /> local n<br /><br /> MENU oPop POPUP 2007<br /> for n := oBtn:Cargo + 1 to 12<br /> MENUITEM NToCMonth( n )<br /> next<br /> ENDMENU<br /><br />return oPop<br /></span></div>[/code:3lzhzp8a]
[url=https://imageshack.com/i/pnWP4rFbp:3lzhzp8a][img:3lzhzp8a]https://imagizer.imageshack.com/v2/xq90/923/WP4rFb.png[/img:3lzhzp8a][/url:3lzhzp8a]
|
BtnBmp and PopupMenu
|
Thank
can we erase or not show the part where is the black Arrow ?
|
BtnBmp and PopupMenu
|
Please make this modification
[code=fw:31ljc1n2]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">5</span><br /> @ nRow, nCol <span style="color: #0000ff;">BTNBMP</span> aBtn<span style="color: #000000;">[</span> n <span style="color: #000000;">]</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;">\3</span>2x32<span style="color: #000000;">\"</span> + aBmp[ n ] ;<br /> PROMPT NtoCMonth( n ) ;<br /> SIZE 100,100 PIXEL OF oDlg TOP FLAT COLOR CLR_WHITE,CLR_GREEN NOBORDER ; // ACTION ::ShowPopup()<br /> ACTION ( ::oPopup := { |oBtn| BtnPopMenu( oBtn ) }, ;<br /> ::ShowPopUp(), ;<br /> ::oPopup := nil )<br /><br /> aBtn[ n ]:Cargo := n<br />// aBtn[ n ]:oPopUp := { |oBtn| BtnPopMenu( oBtn ) }<br /><br /> nCol += 120<br /> next<br /></span></div>[/code:31ljc1n2]
|
BtnBmp and PopupMenu
|
then when It show the menu it create the part with black arrow
on oldest release of my prg it not is showed
when I click on btnbmp it open a popupmenu near the btnbmp and I not see the part with black arrow
for my advice the black arrow can be usefull ony on a tbar control
[b:1slwa452]for now I resolved [/b:1slwa452] with rem on METHOD PaintPopupSection()
on future we can apologize a logic variable to show or not the popupsection when the btnbmp is not on tbar
[img:1slwa452]https://s8.postimg.cc/4ff0ggpsl/image.png[/img:1slwa452]
We suggest
if ::oPopup != nil .and. GetClassName( GetParent( Self:hWnd ) ) = "TBAR"
|
BtnBmp and oPopup
|
[img:28j7pp6g]https://mybergland.com/fwforum/mybtn.jpg[/img:28j7pp6g]
Hello friends,
I have expanded the TBtnBmp.
Now, when I insert a PopupMenu, I can select the width of the clickable area and use a bitmap instead of the PolyPolygon.
Best regards,
Otto
[code=fw:28j7pp6g]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> PaintPopupSection<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TBtnBmp<br /><br /> <span style="color: #00C800;">local</span> nWidth, nHeight, hDC<br /> <span style="color: #00C800;">local</span> hBlackBrush, hOldBrush<br /> <span style="color: #00C800;">local</span> hDarkPen, hLightPen, hOldPen<br /> <br /> <br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oPopup</span> != <span style="color: #00C800;">nil</span><br /> nHeight = ::<span style="color: #000000;">nHeight</span><br /> nWidth = ::<span style="color: #000000;">nWidth</span> <br /> hDC = ::<span style="color: #000000;">hDC</span><br /> <br /> <br /> hBlackBrush = GetStockObject<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//4</span><br /> hOldBrush = SelectObject<span style="color: #000000;">(</span> hDC, hBlackBrush <span style="color: #000000;">)</span><br /> <br /> FW_DrawImage<span style="color: #000000;">(</span> hDC, <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\a</span>lphabmp<span style="color: #000000;">\i</span>chat.bmp"</span>, <span style="color: #000000;">{</span>::<span style="color: #000000;">nHeight</span><span style="color: #000000;">-30</span>, ::<span style="color: #000000;">nWidth</span><span style="color: #000000;">-25</span>, ::<span style="color: #000000;">nHeight</span> - <span style="color: #000000;">10</span>, ::<span style="color: #000000;">nWidth</span><span style="color: #000000;">-5</span><span style="color: #000000;">}</span>, .t. <span style="color: #000000;">)</span><br /> <br /> <br /> <span style="color: #B900B9;">/* <br /> PolyPolygon( hDC, { { nWidth - ::nWPop + If( ::lPressed, 1, 0 ),;<br /> nHeight / 2 - 1 + If( ::lPressed, 1, 0 ) },;<br /> { nWidth - 7 + If( ::lPressed, 1, 0 ), nHeight / 2 + 1 + ;<br /> If( ::lPressed, 1, 0 ) },;<br /> { nWidth - 5 + If( ::lPressed, 1, 0 ), nHeight / 2 - 1 + ;<br /> If( ::lPressed, 1, 0 ) },;<br /> { nWidth - ::nWPop + If( ::lPressed, 1, 0 ), nHeight / 2 - 1 + ;<br /> If( ::lPressed, 1, 0 ) } } )<br />*/</span><br /><br /><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBorder</span> .or. ::<span style="color: #000000;">lPressed</span> .or. ::<span style="color: #000000;">lMOver</span><br /> hDarkPen = CreatePen<span style="color: #000000;">(</span> PS_SOLID, <span style="color: #000000;">1</span>, GetSysColor<span style="color: #000000;">(</span> COLOR_BTNSHADOW <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> hLightPen = CreatePen<span style="color: #000000;">(</span> PS_SOLID, <span style="color: #000000;">1</span>, GetSysColor<span style="color: #000000;">(</span> COLOR_BTNHIGHLIGHT <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> hOldPen = SelectObject<span style="color: #000000;">(</span> hDC, hLightPen <span style="color: #000000;">)</span><br /> MoveTo<span style="color: #000000;">(</span> hDC, nWidth - <span style="color: #000000;">(</span> ::<span style="color: #000000;">nWPop</span> + <span style="color: #000000;">3</span> <span style="color: #000000;">)</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> LineTo<span style="color: #000000;">(</span> hDC, nWidth - <span style="color: #000000;">(</span> ::<span style="color: #000000;">nWPop</span> + <span style="color: #000000;">3</span> <span style="color: #000000;">)</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, nHeight - <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> SelectObject<span style="color: #000000;">(</span> hDC, hDarkPen <span style="color: #000000;">)</span><br /> MoveTo<span style="color: #000000;">(</span> hDC, nWidth - <span style="color: #000000;">(</span> ::<span style="color: #000000;">nWPop</span> + <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> LineTo<span style="color: #000000;">(</span> hDC, nWidth - <span style="color: #000000;">(</span> ::<span style="color: #000000;">nWPop</span> + <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lPressed</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, nHeight - <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> SelectObject<span style="color: #000000;">(</span> hDC, hOldPen <span style="color: #000000;">)</span><br /> DeleteObject<span style="color: #000000;">(</span> hDarkPen <span style="color: #000000;">)</span><br /> DeleteObject<span style="color: #000000;">(</span> hLightPen <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> SelectObject<span style="color: #000000;">(</span> hDC, hOldBrush <span style="color: #000000;">)</span><br /> DeleteObject<span style="color: #000000;">(</span> hBlackBrush <span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br /> </div>[/code:28j7pp6g]
|
BtnBmp and oPopup
|
Dear Otto,
thank you for sharing it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
BtnBmp and oPopup
|
>FW_DrawImage( hDC, "c:\fwh\bitmaps\alphabmp\ichat.bmp", {::nHeight-30, ::nWidth-25, ::nHeight - 10, ::nWidth-5}, .t. )
for me it's no good
perhaps...
[code=fw:1lb2wu73]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">data</span> hBmpPop</div>[/code:1lb2wu73]
on METHOD Paint() CLASS TBtnBmp
[code=fw:1lb2wu73]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">if</span> ::<span style="color: #000000;">oPopup</span> != <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">hBmpPop</span> != <span style="color: #000000;">0</span><br /> DrawBitmap<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">hBmpPop</span>, aRect<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">+5</span>, aRect<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span><span style="color: #000000;">-15</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">PaintPopupSection</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">endif</span></div>[/code:1lb2wu73]
[b:1lb2wu73]instead of[/b:1lb2wu73]
[code=fw:1lb2wu73]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oPopup</span> != <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">PaintPopupSection</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span></div>[/code:1lb2wu73]
but before we must load ::hBmpPop on New method
[code=fw:1lb2wu73]<div class="fw" id="{CB}" style="font-family: monospace;">::<span style="color: #000000;">hBmpPop</span> := ::<span style="color: #000000;">LoadBmp</span><span style="color: #000000;">(</span> cBtnPop <span style="color: #000000;">)</span></div>[/code:1lb2wu73]
See on my class TBtnClr how I made
|
BtnBmp and oPopup
|
I agree with Silvio, it wasn't good.
Estoy de acuerdo con Silvio, no fue bueno.
Regards, saludos.
|
BtnBmp and oPopup
|
Hello,
That was just a suggestion.
Here we need new data variables.
Then everyone can load the ICON they want.
Again, it should only serve as a suggestion to extend the class.
It's like comparing apples and oranges to modify a class for personal use or to make it universally applicable. I can only do the former.
Best regards,
Otto
|
BtnBmp caption
|
To AllI have noticed with 810 and 811 that the caption on a BtnBmp by default is now located at the BOTTOM of the button .. Previously it was centered in the button ..Is there a new clause to 'center' the caption ??Rick Lipkin[code:2norjv50]REDEFINE BTNBMP oBTN9 PROMPT cADPROMPT ID 128 of oEMPL[/code:2norjv50]
|
BtnBmp caption
|
Use the recurse editor... propiedad ESTYLE - ALINEADO VERTICAL (center, left, right, bottom)Excuseme my english... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
|
BtnBmp changed behavior?
|
Hi.
On a BtnBmp I have what it seems to be like the word "SerDefine" written over the bmp-button. This must be do to a change on the btnbmp class for I did not have this problem before. Furthermore my btnbmps are no longer transparent. See image:
[img:1freflm1]http://ssfl.dynalias.com/temp_files/2010-10-14_1245.png[/img:1freflm1]
How do I get rid of "SerDefine" and make my btnbmp transparent again?
Reinaldo.
|
BtnBmp changed behavior?
|
Ok. I found the source of the "selfdefine" text that was painting on top of the btnbmp.
But so far I haven't figure out why the btnbmp isn't transparent. Look a the exit door above. Notice the gradient is not being applied to its background.
oh- and another thing is that the btnbmp is now "raised". With my previous fwh version it wasn't.
I'm especially concern about the btnbmp not being transparent.
Any ideas?
Reinaldo.
|
BtnBmp changed behavior?
|
Reinaldo,
I suspect this and the dialog flickering are both due to changes made to try to handle tranparency and themes. See this thread:
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=19966">viewtopic.php?f=3&t=19966</a><!-- l -->
There are 18 possible combinations that need to be tested and resolved if needed.
Regards,
James
|
BtnBmp changed behavior?
|
James;
I think my emails are not reaching you. Can you write to me so that I can reply? reinaldo dot crespo
at gmail of course.
Reinaldo.
|
BtnBmp changed behavior?
|
Reinaldo,
I have the same email address I have always had (since the 80's)-- [jbott at compuserve dot com]. I can also be reached at [jbott at gointellitech dot com].
I did find one email from you that I missed and I have responded. Did you send others?
Regards,
James
|
BtnBmp changed behavior?
|
Reinaldo,
Please post here the RC for that dialog, the source code that you use for it and the bitmaps, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
BtnBmp changed behavior?
|
Antonio;
Hi.
First this is the code:
[code=fw:14hsld8j]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> aoBtns<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">301</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Save32"</span> TOOLTIP <span style="color: #ff0000;">"Save to Disk"</span> NOBORDER ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span>!empty<span style="color: #000000;">(</span> odbf:<span style="color: #000000;">VarType</span> <span style="color: #000000;">)</span> .or. !NoBlankRecord<span style="color: #000000;">(</span> odbf, <span style="color: #ff0000;">"Type"</span> <span style="color: #000000;">)</span> .or. !odbf:<span style="color: #000000;">isadd</span><span style="color: #000000;">)</span> .and. ;<br /> <span style="color: #000000;">(</span> iif<span style="color: #000000;">(</span> odbf:<span style="color: #000000;">IsAdd</span>, odbf:<span style="color: #000000;">append</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">)</span>, ;<br /> odbf:<span style="color: #000000;">save</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, odbf:<span style="color: #000000;">IsAdd</span> := .f., .t. <span style="color: #000000;">)</span>, ;<br /> obrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, odlg:<span style="color: #000000;">end</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> aoBtns<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">302</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Exit32"</span> TOOLTIP <span style="color: #ff0000;">"Exit"</span> NOBORDER <span style="color: #0000ff;">ACTION</span> odlg:<span style="color: #000000;">end</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> aeval<span style="color: #000000;">(</span> aoBtns, <span style="color: #000000;">{</span> |e| e:<span style="color: #000000;">ltransparent</span> := .t., e:<span style="color: #000000;">oCursor</span> := ocursor <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> </div>[/code:14hsld8j]
Exit32.bmp is here:
[url:14hsld8j]http://ssfl.dynalias.com/temp_files/exit32.bmp[/url:14hsld8j]
Save32.bmp is here:
[url:14hsld8j]http://ssfl.dynalias.com/temp_files/save32.bmp[/url:14hsld8j]
This is a screenshot of the app built using an older fwh + bcc55 + xharb 0.99.6. Notice the bmps are transparent.
[img:14hsld8j]http://ssfl.dynalias.com/temp_files/2010-10-15_1536.png[/img:14hsld8j]
This is a screenshot of the app built using current fwh + bcc582 + xharb 1.2.1_6741. Look at the exit door.
[img:14hsld8j]http://ssfl.dynalias.com/temp_files/2010-10-15_1548.png[/img:14hsld8j]
Furthermore, when you place the cursor just over the btnbmp, on the newer version the button raises with a 3dlook. Not good especially when you have btnbmps that are not squared. TsButtons are working perfectly. The problem is only with btnbmps.
Thank you for your help.
Reinaldo.
|
BtnBmp changed behavior?
|
One of the things I had to do was change all of my buttons in the rc to Owner Draw or use the TBtnBmp add in control for Borland workshop.
|
BtnBmp changed behavior?
|
Hey Gale;
Thank you.
I have a college buddy in Houston.
Is that the Dialog or the btnbmp control that I should change to owner draw?
I'm using Resource Builder to manage resources. Can't find an owner draw property.... ?
Reinaldo.
|
BtnBmp changed behavior?
|
Reinaldo,
Please post the RC section for that dialog box, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
BtnBmp changed behavior?
|
Hi.
The RC section for the dialog is:
[code=fw:3kb00abf]<div class="fw" id="{CB}" style="font-family: monospace;">REVENUECODES <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">6</span>, <span style="color: #000000;">15</span>, <span style="color: #000000;">225</span>, <span style="color: #000000;">150</span><br /><span style="color: #0000ff;">STYLE</span> DS_SETFONT |DS_MODALFRAME |WS_OVERLAPPED |WS_VISIBLE |WS_CAPTION <br />CAPTION <span style="color: #ff0000;">"Revenue Code Detail"</span><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, <span style="color: #000000;">0</span><br />BEGIN<br /> CONTROL <span style="color: #ff0000;">""</span>,<span style="color: #000000;">502</span>,<span style="color: #ff0000;">"STATIC"</span>,SS_BLACKFRAME |WS_CHILD |WS_VISIBLE ,<span style="color: #000000;">5</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">212</span>,<span style="color: #000000;">100</span><br /> CONTROL <span style="color: #ff0000;">""</span>,<span style="color: #000000;">101</span>,<span style="color: #ff0000;">"EDIT"</span>,ES_NOHIDESEL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP ,<span style="color: #000000;">64</span>,<span style="color: #000000;">15</span>,<span style="color: #000000;">36</span>,<span style="color: #000000;">12</span><br /> CONTROL <span style="color: #ff0000;">""</span>,<span style="color: #000000;">102</span>,<span style="color: #ff0000;">"EDIT"</span>,ES_NOHIDESEL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP ,<span style="color: #000000;">64</span>,<span style="color: #000000;">28</span>,<span style="color: #000000;">144</span>,<span style="color: #000000;">12</span><br /> CONTROL <span style="color: #ff0000;">""</span>,<span style="color: #000000;">103</span>,<span style="color: #ff0000;">"EDIT"</span>,ES_NOHIDESEL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP ,<span style="color: #000000;">64</span>,<span style="color: #000000;">41</span>,<span style="color: #000000;">63</span>,<span style="color: #000000;">12</span><br /> CONTROL <span style="color: #ff0000;">""</span>,<span style="color: #000000;">104</span>,<span style="color: #ff0000;">"EDIT"</span>,ES_NOHIDESEL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP ,<span style="color: #000000;">64</span>,<span style="color: #000000;">54</span>,<span style="color: #000000;">63</span>,<span style="color: #000000;">12</span><br /> CONTROL <span style="color: #ff0000;">""</span>,<span style="color: #000000;">105</span>,<span style="color: #ff0000;">"EDIT"</span>,ES_NOHIDESEL |ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP ,<span style="color: #000000;">64</span>,<span style="color: #000000;">67</span>,<span style="color: #000000;">63</span>,<span style="color: #000000;">12</span><br /> CONTROL <span style="color: #ff0000;">"Rev-Code"</span>,<span style="color: #000000;">65535</span>,<span style="color: #ff0000;">"STATIC"</span>,SS_RIGHT |WS_CHILD ,<span style="color: #000000;">6</span>,<span style="color: #000000;">17</span>,<span style="color: #000000;">54</span>,<span style="color: #000000;">8</span><br /> CONTROL <span style="color: #ff0000;">"Description"</span>,<span style="color: #000000;">65535</span>,<span style="color: #ff0000;">"STATIC"</span>,SS_RIGHT |WS_CHILD ,<span style="color: #000000;">6</span>,<span style="color: #000000;">31</span>,<span style="color: #000000;">54</span>,<span style="color: #000000;">8</span><br /> CONTROL <span style="color: #ff0000;">"GL-Acc IN"</span>,<span style="color: #000000;">65535</span>,<span style="color: #ff0000;">"STATIC"</span>,SS_RIGHT |WS_CHILD ,<span style="color: #000000;">6</span>,<span style="color: #000000;">44</span>,<span style="color: #000000;">54</span>,<span style="color: #000000;">8</span><br /> CONTROL <span style="color: #ff0000;">"GL-Acc OUT"</span>,<span style="color: #000000;">65535</span>,<span style="color: #ff0000;">"STATIC"</span>,SS_RIGHT |WS_CHILD ,<span style="color: #000000;">6</span>,<span style="color: #000000;">56</span>,<span style="color: #000000;">54</span>,<span style="color: #000000;">8</span><br /> CONTROL <span style="color: #ff0000;">"Serv-Code"</span>,<span style="color: #000000;">65535</span>,<span style="color: #ff0000;">"STATIC"</span>,SS_RIGHT |WS_CHILD ,<span style="color: #000000;">6</span>,<span style="color: #000000;">68</span>,<span style="color: #000000;">54</span>,<span style="color: #000000;">8</span><br /> CONTROL <span style="color: #ff0000;">""</span>,<span style="color: #000000;">301</span>,<span style="color: #ff0000;">"TBTNBMP"</span>,WS_CHILD |0xF0B,<span style="color: #000000;">142</span>,<span style="color: #000000;">116</span>,<span style="color: #000000;">36</span>,<span style="color: #000000;">30</span><br /> CONTROL <span style="color: #ff0000;">""</span>,<span style="color: #000000;">302</span>,<span style="color: #ff0000;">"TBTNBMP"</span>,WS_CHILD |0xF0B,<span style="color: #000000;">182</span>,<span style="color: #000000;">116</span>,<span style="color: #000000;">36</span>,<span style="color: #000000;">30</span><br /> CONTROL <span style="color: #ff0000;">"Edit5"</span>,<span style="color: #000000;">106</span>,<span style="color: #ff0000;">"EDIT"</span>,ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,<span style="color: #000000;">64</span>,<span style="color: #000000;">80</span>,<span style="color: #000000;">63</span>,<span style="color: #000000;">14</span><br /> CONTROL <span style="color: #ff0000;">"Cost Ratio"</span>,<span style="color: #000000;">1</span>,<span style="color: #ff0000;">"STATIC"</span>,SS_RIGHT |WS_CHILD |WS_GROUP |WS_VISIBLE ,<span style="color: #000000;">20</span>,<span style="color: #000000;">83</span>,<span style="color: #000000;">39</span>,<span style="color: #000000;">8</span><br />END<br /> </div>[/code:3kb00abf]
Reinaldo.
|
BtnBmp changed behavior?
|
Reinaldo,
What is 0xF0B ?
CONTROL "",301,"TBTNBMP",WS_CHILD |0xF0B,142,116,36,30
|
BtnBmp changed behavior?
|
Antonio;
Hi.
I'm not sure. I'm managing these resources using Resource Builder. I'm thinking it was added by it. I removed it and recompiled the app, but still get the same result.
Reinaldo.
|
BtnBmp changed behavior?
|
Reinaldo
Please try modify this "ELSEIF" inside btnbmp.prg
(line 1276)
[code=fw:11ez49nz]<div class="fw" id="{CB}" style="font-family: monospace;"> elseif IsAppThemed<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .or. !::<span style="color: #000000;">lTransparent</span><br /> PalBtnPaint<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hPalette4</span>, ::<span style="color: #000000;">hPalette1</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">lAdjust</span> .and. empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hBitmap1</span>,::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">lAdjust</span> .and. empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hPalette1</span>,::<span style="color: #000000;">hPalette2</span><span style="color: #000000;">)</span>,;<br /> ::<span style="color: #000000;">hBitmap3</span>, ::<span style="color: #000000;">hPalette3</span>, ::<span style="color: #000000;">lPressed</span>, ::<span style="color: #000000;">lAdjust</span>, ::<span style="color: #000000;">lBorder</span>,;<br /> ::<span style="color: #000000;">oPopup</span> != <span style="color: #00C800;">nil</span>,;<br /> ::<span style="color: #000000;">nClrPane</span>, <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> == <span style="color: #ff0000;">"..."</span>, ::<span style="color: #000000;">cCaption</span>,<span style="color: #000000;">)</span> , ::<span style="color: #000000;">nLayout</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oFont</span> != <span style="color: #00C800;">nil</span>, ::<span style="color: #000000;">oFont</span>:<span style="color: #000000;">hFont</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span>, ::<span style="color: #000000;">lMOver</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hDC</span>,;<br /> Upper<span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">ClassName</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> != <span style="color: #ff0000;">"TBAR"</span> <span style="color: #000000;">)</span></div>[/code:11ez49nz]
New code
[code=fw:11ez49nz]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> elseif IsAppThemed<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">if</span> !::<span style="color: #000000;">lTransparent</span><br /> PalBtnPaint<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hBitmap4</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lMOver</span> .and. !Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap4</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hPalette4</span>, ::<span style="color: #000000;">hPalette1</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">lAdjust</span> .and. empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hBitmap1</span>,::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">lAdjust</span> .and. empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap2</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hPalette1</span>,::<span style="color: #000000;">hPalette2</span><span style="color: #000000;">)</span>,;<br /> ::<span style="color: #000000;">hBitmap3</span>, ::<span style="color: #000000;">hPalette3</span>, ::<span style="color: #000000;">lPressed</span>, ::<span style="color: #000000;">lAdjust</span>, ::<span style="color: #000000;">lBorder</span>,;<br /> ::<span style="color: #000000;">oPopup</span> != <span style="color: #00C800;">nil</span>,;<br /> ::<span style="color: #000000;">nClrPane</span>, <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> == <span style="color: #ff0000;">"..."</span>, ::<span style="color: #000000;">cCaption</span>,<span style="color: #000000;">)</span> , ::<span style="color: #000000;">nLayout</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oFont</span> != <span style="color: #00C800;">nil</span>, ::<span style="color: #000000;">oFont</span>:<span style="color: #000000;">hFont</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span>, ::<span style="color: #000000;">lMOver</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">hDC</span>,;<br /> Upper<span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">ClassName</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> != <span style="color: #ff0000;">"TBAR"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> hBmpOld = SelectObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hBmp <span style="color: #000000;">)</span><br /> nZeroZeroClr = GetPixel<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;">)</span><br /> SelectObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hBmpOld <span style="color: #000000;">)</span><br /> nOldClr = SetBkColor<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> TransBmp<span style="color: #000000;">(</span> hBmp, nBmpWidth, nBmpHeight, nZeroZeroClr, ::<span style="color: #000000;">hDC</span>,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lAdjust</span>, nAdjust, nBmpLeft + nAdjust <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lAdjust</span>, nAdjust, nBmpTop + nAdjust <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>::<span style="color: #000000;">lAdjust</span>, ::<span style="color: #000000;">nWidth</span>, nBmpWidth <span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lAdjust</span>, ::<span style="color: #000000;">nHeight</span>, nBmpHeight <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> SetBkColor<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nOldClr <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span> <br /> <span style="color: #00C800;">else</span><br /> </div>[/code:11ez49nz]
|
BtnBmp changed behavior?
|
Daniel;
You got it fixed!
Thank you.
Reinaldo.
|
BtnBmp con Alpha Channel
|
Les presento otra posible contribucion, nuevamente expongo el prototipo de lo que seria el cambio...
Como se ha comentado el tema sobre Alpha Channel empiezo a implementarlo para las clases de FW...
la idea general, como al igual que usamos la clausula TRANSPARENT, he agregado una clausula ALPHA, para expresar que vamos a usar las caracteristicas de un bitmap con Alpha Channel, esta caracteristica necesita una cantidad de transparencia ( 0-255 ), he agregado una clasula LEVEL para determinar en porcentajes esa transparencia ( 0-100% ), no usamos 0-255 solo un numero que exprese el porcentaje.
la clase TBTNBMP por los momentos usa 3 imagenes ( 1-Status Normal, 2-Boton Oprimido, 3-Boton Deshabilitado ), para el proximo build tendra una 4 imagen que se usara cuando el mouse este ensima del boton...
por el uso de todas estas imagenes he individualizado la transparencias de los mismos,
ejemplo
@ x,y btnbmp.... ALPHA LEVEL 0,10,10,0 seria la forma de agregarles el porcentaje de transparencia a cada imagen por default seria 0% transparencia...
Sin mas palabras les deje un ejemplo
estoy atento a las opiniones y sugerencias
[url:1iefgvxz]http://www.sitasoft.com/fivewin/test/testbtb2.rar[/url:1iefgvxz]
[code=fw:1iefgvxz]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Slider.ch"</span><br /><br />procedure main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oDlgw<br /><span style="color: #00C800;">local</span> oBot01<br /><span style="color: #00C800;">local</span> oBar, oBotBar0, oBotBar1 <br /><span style="color: #00C800;">local</span> nVar1 := <span style="color: #000000;">80</span> <span style="color: #B900B9;">// transparence porcent</span><br /><span style="color: #00C800;">local</span> oSlide<br /><span style="color: #00C800;">local</span> lChk1 := .f.<br /><span style="color: #00C800;">local</span> lChk2 := .f.<br /><br /><br />SetBalloon<span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">dialog</span> oDlgw <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Test BTNBMP Alpha Channel"</span> <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;">600</span>,<span style="color: #000000;">700</span> <span style="color: #0000ff;">pixel</span><br /><br /><br /> @ <span style="color: #000000;">50</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">BTNBMP</span> oBot01 <span style="color: #0000ff;">OF</span> oDlgw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">80</span> tooltip <span style="color: #ff0000;">"BTNBMP With Alpha Channel"</span> ;<br /> file <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\e</span>xplorer.bmp"</span>,<span style="color: #00C800;">nil</span>,<span style="color: #00C800;">nil</span>,<span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\i</span>mac.bmp"</span> alpha level nVar1,,,<span style="color: #000000;">20</span><br /> <br /> @ <span style="color: #000000;">180</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">checkbox</span> lChk1 <span style="color: #0000ff;">prompt</span> <span style="color: #ff0000;">"Adjust Image "</span> <span style="color: #0000ff;">of</span> oDlgw <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">change</span> <span style="color: #000000;">(</span> oBot01:<span style="color: #000000;">lAdjust</span> := lChk1, oBot01:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">200</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">checkbox</span> lChk2 <span style="color: #0000ff;">prompt</span> <span style="color: #ff0000;">"2007 Style "</span> <span style="color: #0000ff;">of</span> oDlgw <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">change</span> <span style="color: #000000;">(</span> oBot01:<span style="color: #000000;">l2007</span> := lChk2, oBot01:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <br /> @ <span style="color: #000000;">50</span>, <span style="color: #000000;">300</span> SLIDER oSlide <span style="color: #0000ff;">VAR</span> nVar1 <span style="color: #0000ff;">OF</span> oDlgw ;<br /> <span style="color: #0000ff;">VERTICAL</span> ;<br /> <span style="color: #0000ff;">RIGHT</span> DIRECTION ;<br /> RANGE <span style="color: #000000;">1</span>, <span style="color: #000000;">100</span> ;<br /> MARKS <span style="color: #000000;">1</span>;<br /> EXACT;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">(</span> oBot01:<span style="color: #000000;">aLevel</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> := nVar1, oBot01:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">42</span>, <span style="color: #000000;">160</span> <span style="color: #0000ff;">PIXEL</span><br /> <br /> <br /> <br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">dialog</span> oDlgw <br /><br /><span style="color: #00C800;">return</span></div>[/code:1iefgvxz]
|
BtnBmp con Alpha Channel
|
Daniel,
Solamente decir que sería una aportación mas que excelente.
gracias por tu disposición.
|
BtnBmp desde código y recursos
|
Colegas, he generado dos diálogos, uno por recursos y otro por código. Utilizo la clase BTnBmp pero su apariencia difieren si es por código o por recursos.
[img:1lbjwcyr]http://i63.tinypic.com/53kcjb.png[/img:1lbjwcyr]
Este es el código
[code=fw:1lbjwcyr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//código</span><br /> @ <span style="color: #000000;">188</span>, <span style="color: #000000;">205</span> <span style="color: #0000ff;">BtnBmp</span> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"&Guardar"</span> <span style="color: #0000ff;">Size</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">22</span> <span style="color: #0000ff;">Pixel</span> <span style="color: #0000ff;">Of</span> oDlg Flat<span style="color: #B900B9;">//NoBorder</span><br /> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> : <span style="color: #000000;">l2013</span> := <span style="color: #00C800;">TRUE</span><br /> @ <span style="color: #000000;">188</span>, <span style="color: #000000;">280</span> <span style="color: #0000ff;">BtnBmp</span> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"&Cerrar"</span> <span style="color: #0000ff;">Size</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">22</span> <span style="color: #0000ff;">Pixel</span> <span style="color: #0000ff;">Of</span> oDlg Flat <span style="color: #0000ff;">Action</span> oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> : <span style="color: #000000;">l2013</span> := <span style="color: #00C800;">TRUE</span><br /><br /><span style="color: #B900B9;">//recursos</span><br /><br /> <span style="color: #0000ff;">Redefine</span> <span style="color: #0000ff;">BtnBmp</span> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">Id</span> <span style="color: #000000;">202</span> <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"&Cerrar"</span> <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Center</span> <span style="color: #0000ff;">Action</span> oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">Redefine</span> <span style="color: #0000ff;">BtnBmp</span> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">Id</span> <span style="color: #000000;">201</span> <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"&Guardar"</span> <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Center</span> <span style="color: #0000ff;">Action</span> GuardaExtras<span style="color: #000000;">(</span> cObs, nTipo, cOtro, dDesde, dHasta, nMotivo, nDiaHoras, oQryL, oDlg, oBrwL <span style="color: #000000;">)</span><br /> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> : <span style="color: #000000;">l2013</span> := <span style="color: #00C800;">TRUE</span><br /> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> : <span style="color: #000000;">l2013</span> := <span style="color: #00C800;">TRUE</span><br /><br /> </div>[/code:1lbjwcyr]
Me falta definir algún parámetro en el caso de código ? Uso FWH 17.01. Desde ya muchas gracias.
Saludos
|
BtnBmp desde código y recursos
|
+1
|
BtnBmp desde código y recursos
|
y Con l2007? y porque no usas solo Recursos?
|
BtnBmp desde código y recursos
|
Hay un bug que no reporté, si lo hago desde recursos el dialogo se abre detrás del folder y como estoy muy apurado decidí hacerlo por código. pero supongo que los controles deberían comportarse de igual manera desde recursos que desde código.
Saludos
|
BtnBmp desde código y recursos
|
[quote:1hvicdzb]
el dialogo se abre detrás del folder
[/quote:1hvicdzb]
Investigue las propiedades del diálogo. Ponga una imagen.
|
BtnBmp desde código y recursos
|
Karinha, ahora no puedo. Debería rehacer la rutina para generar ese error y como te dije estoy apurado para entregar este trabajo. No bien tenga tiempo haré un autocontenido con el error y lo postearé por aquí.
Saludos
|
BtnBmp desde código y recursos
|
[quote="horacio":2xpwig4r]Colegas, he generado dos diálogos, uno por recursos y otro por código. Utilizo la clase BTnBmp pero su apariencia difieren si es por código o por recursos.
[img:2xpwig4r]http://i63.tinypic.com/53kcjb.png[/img:2xpwig4r]
Este es el código
[code=fw:2xpwig4r]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//código</span><br /> @ <span style="color: #000000;">188</span>, <span style="color: #000000;">205</span> <span style="color: #0000ff;">BtnBmp</span> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"&Guardar"</span> <span style="color: #0000ff;">Size</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">22</span> <span style="color: #0000ff;">Pixel</span> <span style="color: #0000ff;">Of</span> oDlg Flat<span style="color: #B900B9;">//NoBorder</span><br /> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> : <span style="color: #000000;">l2013</span> := <span style="color: #00C800;">TRUE</span><br /> @ <span style="color: #000000;">188</span>, <span style="color: #000000;">280</span> <span style="color: #0000ff;">BtnBmp</span> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"&Cerrar"</span> <span style="color: #0000ff;">Size</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">22</span> <span style="color: #0000ff;">Pixel</span> <span style="color: #0000ff;">Of</span> oDlg Flat <span style="color: #0000ff;">Action</span> oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> : <span style="color: #000000;">l2013</span> := <span style="color: #00C800;">TRUE</span><br /><br /><span style="color: #B900B9;">//recursos</span><br /><br /> <span style="color: #0000ff;">Redefine</span> <span style="color: #0000ff;">BtnBmp</span> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">Id</span> <span style="color: #000000;">202</span> <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"&Cerrar"</span> <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Center</span> <span style="color: #0000ff;">Action</span> oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">Redefine</span> <span style="color: #0000ff;">BtnBmp</span> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">Id</span> <span style="color: #000000;">201</span> <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"&Guardar"</span> <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Center</span> <span style="color: #0000ff;">Action</span> GuardaExtras<span style="color: #000000;">(</span> cObs, nTipo, cOtro, dDesde, dHasta, nMotivo, nDiaHoras, oQryL, oDlg, oBrwL <span style="color: #000000;">)</span><br /> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> : <span style="color: #000000;">l2013</span> := <span style="color: #00C800;">TRUE</span><br /> oBtn<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> : <span style="color: #000000;">l2013</span> := <span style="color: #00C800;">TRUE</span><br /><br /> </div>[/code:2xpwig4r]
Me falta definir algún parámetro en el caso de código ? Uso FWH 17.01. Desde ya muchas gracias.
Saludos[/quote:2xpwig4r]
Hola Horacio,
Como le haces para generar esas ventanas con ese estilo ?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.