topic
stringlengths
1
63
text
stringlengths
1
577k
Button con 2 renglones
Distinguido En texto asi: @1,1 BTNBMP oBMP PROMPT "Linea1"+CRLF+"Linea2" SIZE 80,30 PIXEL ACTION Funcion() Saludos Adhemar
Button con grafica e testo
Salve,mi pare di avere visto in giro qualche classe/programma che permette di creare botton con sia grafica che testo.Avete qualcosa da segnalarmi in proposito ?GrazieRomeo/ZingoniFWH 2.4
Button con grafica e testo
Chiaramente non voglio usare la classe BTNBMP in quanto permette si di scrivere il testo, ma in modo centrale e quindi si sovrappone alla grafica.Vorrei magari potere disporre il testo in basso o a dx o a sx del bottone, insomma non mischiarlo con la grafica.Romeo/Zingoni
Button con grafica e testo
La classe buttonbmp fornita con FWH (non la tbtnbmp) ti permette di allineare il testo a destra o a sinistra dell'immagine se ricordo bene (io la uso ma allineo sempre il testo a dx utilizzando la clausola TEXTRIGHT)
Button con grafica e testo
[quote="Romeo":1wx1sxtr]Chiaramente non voglio usare la classe BTNBMP in quanto permette si di scrivere il testo, ma in modo centrale e quindi si sovrappone alla grafica. Vorrei magari potere disporre il testo in basso o a dx o a sx del bottone, insomma non mischiarlo con la grafica. Romeo/Zingoni[/quote:1wx1sxtr]Sto guardando adesso una toolbar che ho fatto un po' di tempo fa usando i BTNBMP e il testo non risulta sovrapposto alla grafica bensì il disegno è nella parte alta e il testo in quella bassa del pulsante.EMG
Button con grafica e testo
ok la btnbmp funziona bene.Grazie
Button de ButtonBar desactivado
Saludos foreros, Cuando uso una ToolBar, y algún boton esta deshabilitado, se visualiza con su texto y gráfico en gris. [img:1pvr19ue]http://imageshack.com/a/img837/1047/7de0.jpg[/img:1pvr19ue] Pero al usar una ButtonBar solo el texto tiene aspecto deshabilitado, alguna forma para que tambien el gráfico quede en gris. [img:1pvr19ue]http://imageshack.com/a/img839/8344/co46.jpg[/img:1pvr19ue] FWH 14.02 HB 3.2.0 BCC 5.8.2
Button de ButtonBar desactivado
Hola Biel! El tercer parametro de los bmp o recursos que le pases es el del estado para deshabilitado. [code=fw:2vhgzk1u]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\V</span>istaNormal.bmp"</span>,<span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\V</span>istaClibBajo.bmp"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\V</span>istaDeshabilitado.bmp"</span>, <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Open a previous project"</span>  <span style="color: #0000ff;">ACTION</span> MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Open Project"</span>, <span style="color: #ff0000;">"Stop"</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:2vhgzk1u]
Button de ButtonBar desactivado
Ok muchas gracias !!. Ya veo el funcionamiento, por una parte te da la versatilidad de poder definir el bmp que quieras, pero por la otra te obliga a tener que definirlo obligatoriamente si quieres efecto deshabilitado. Revisando el funcionamiento de la clase, he intentado adaptarlo a como me gustaria que funcionase. La idea es que si no se define el bitmap para deshabilitado, automaticamente use el bitmap1 en escala de grises(bueno no exactamente escala de grises). He modificado el método loadbitmaps de la clase BtnBmp, y si no se define el tercer bmp, creo una copia en memoria del primero, cambiando los bits con color por el gris y manteniendo el blanco. El efecto es el deseado, y es suficiente definir un bmp. [img:tqycvhz1]http&#58;//imageshack&#46;com/a/img845/6750/xna7&#46;jpg[/img:tqycvhz1] [code=fw:tqycvhz1]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">".<span style="color: #000000;">\i</span>mg<span style="color: #000000;">\r</span>mvfilter.bmp"</span>   <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Quitar filtro"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>oQry:<span style="color: #000000;">SetWhere</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">''</span><span style="color: #000000;">&#41;</span>,lFil:=.F.,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">WHEN</span> lFil</div>[/code:tqycvhz1]
Button de ButtonBar desactivado
Biel, [quote:1a22rcv8]He modificado el método loadbitmaps de la clase BtnBmp, y si no se define el tercer bmp, creo una copia en memoria del primero, cambiando los bits con color por el gris y manteniendo el blanco. El efecto es el deseado, y es suficiente definir un bmp[/quote:1a22rcv8] Es una mejora muy interesante. Si la publicas la incluimos en FWH, gracias <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Button de ButtonBar desactivado
[quote="Antonio Linares":muchu9ks]Biel, Es una mejora muy interesante. Si la publicas la incluimos en FWH, gracias <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:muchu9ks] Sin problema Antonio <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> , te hago llegar la clase por correo.
Button de ButtonBar desactivado
Biel, Muchas gracias <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Button disabled looks different on folder and buttonbar
Hello, Working on a use-login-system I noticed some problems Why disabled buttons are showing with a different look ? In case it is not possible to show the normal disabled-style of BTNBMP inside a buttonbar, I have to change the image like in metrobuttons ( disabled ) and using a NIL-action [img:9uepos2k]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Btndisabl1&#46;jpg[/img:9uepos2k] A sample-button needs to be shown DISABLED ( used on a BUTTONBAR ) [code=fw:9uepos2k]<div class="fw" id="{CB}" style="font-family: monospace;"><br />@ <span style="color: #000000;">5</span>, <span style="color: #000000;">710</span> <span style="color: #0000ff;">BTNBMP</span> oBBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">17</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">OF</span> oBar ;<br /><span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">82</span>, <span style="color: #000000;">72</span> <span style="color: #0000ff;">PIXEL</span> ;<br />BORDER ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Speichern"</span> ;<br />FILENAME c_Pfad1 + <span style="color: #ff0000;">"Save.Bmp"</span> ;<br /><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> lSpeichern := .T., ;<br />                  DBSELECTAREA<span style="color: #000000;">&#40;</span> cMonat <span style="color: #000000;">&#41;</span>, ;<br />                  V_SAVE<span style="color: #000000;">&#40;</span>nPage, cMonat<span style="color: #000000;">&#41;</span>, ;<br />                  oBrw1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDatP<span style="color: #000000;">&#91;</span><span style="color: #000000;">74</span><span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />          oBrw2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />          V_GET<span style="color: #000000;">&#40;</span>cMonat<span style="color: #000000;">&#41;</span>, ;<br />          oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span> nPage <span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br /><span style="color: #0000ff;">FONT</span> oFontSys  ;<br />TOP<br />oBBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">17</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrGrad</span> := <span style="color: #000000;">&#123;</span> | lMouseOver | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lMouseOver,;<br />        <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">112</span><span style="color: #000000;">&#93;</span>, aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">110</span><span style="color: #000000;">&#93;</span>, aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">111</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span>, ;<br />        <span style="color: #000000;">&#123;</span> aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">112</span><span style="color: #000000;">&#93;</span>, aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">111</span><span style="color: #000000;">&#93;</span>, aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">110</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>, ;<br />        <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">116</span><span style="color: #000000;">&#93;</span>, aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">114</span><span style="color: #000000;">&#93;</span>, aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">115</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span>, ;<br />        <span style="color: #000000;">&#123;</span> aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">116</span><span style="color: #000000;">&#93;</span>, aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">115</span><span style="color: #000000;">&#93;</span>, aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">114</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />oBBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">17</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cToolTip</span> =  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Datensatz"</span> + CRLF + <span style="color: #ff0000;">"Speichern"</span>,<span style="color: #ff0000;">"SPEICHERN"</span>, <span style="color: #000000;">1</span>, CLR_BLACK, <span style="color: #000000;">14089979</span> <span style="color: #000000;">&#125;</span><br />oBBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">17</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">&#41;</span><br /> </div>[/code:9uepos2k] regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Button disabled looks different on folder and buttonbar
Disabled look of TBtnBmp should be the same whether it is on window, buttonbar, or on a folder.
Button disabled looks different on folder and buttonbar
I added BtnBmp to a existing sample < TESTBTB.prg >with the same effect [img:vniklgzl]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Btndisabl2&#46;jpg[/img:vniklgzl] [code=fw:vniklgzl]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />procedure main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oDlgw<br /><span style="color: #00C800;">local</span> oBot01, oBot02, oBot03, oBot04<br /><span style="color: #00C800;">local</span> lWhen := .f.<br /><span style="color: #00C800;">local</span> oFont<br /><span style="color: #00C800;">local</span> oBar, oBotBar1, oBotBar2, oBotBar3, oBotBar4, oBotBar5, oBotBar6, oBotBar7, oBotBar0<br /><span style="color: #00C800;">local</span> ahOver := PalBmpRead<span style="color: #000000;">&#40;</span> , <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>utt1upL.bmp"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> ahOldBmp := array<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> bGrad<br /><br />bGrad := <span style="color: #000000;">&#123;</span> | lInvert | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lInvert, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>/<span style="color: #000000;">2</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">219</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">244</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">207</span><span style="color: #000000;">-50</span>, <span style="color: #000000;">221</span><span style="color: #000000;">-25</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />        <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>/<span style="color: #000000;">2</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">201</span><span style="color: #000000;">-50</span>, <span style="color: #000000;">217</span><span style="color: #000000;">-25</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">231</span>, <span style="color: #000000;">242</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>  ;<br />      <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>/<span style="color: #000000;">2</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">219</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">244</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">207</span><span style="color: #000000;">-50</span>, <span style="color: #000000;">221</span><span style="color: #000000;">-25</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />        <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>/<span style="color: #000000;">2</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">201</span><span style="color: #000000;">-50</span>, <span style="color: #000000;">217</span><span style="color: #000000;">-25</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">231</span>, <span style="color: #000000;">242</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>  ;<br />      <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />SetBalloon<span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">window</span> oDlgw <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Test BTNBMP"</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;">750</span> <span style="color: #0000ff;">pixel</span><br /><br /><span style="color: #0000ff;">define</span> <span style="color: #0000ff;">buttonbar</span> oBar <span style="color: #0000ff;">of</span> oDlgw <span style="color: #0000ff;">size</span> <span style="color: #000000;">110</span>, <span style="color: #000000;">40</span> <span style="color: #000000;">2007</span><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;">"ARIAL"</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">0</span><br /><br />  <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> oBotBar0 <span style="color: #0000ff;">of</span> oBar file <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>ff.bmp"</span>,<span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>n.bmp"</span>,<span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\d</span>is.bmp"</span>,<span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\e</span>ne.bmp"</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Files"</span> <span style="color: #0000ff;">left</span><br />  <br />  <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> oBotBar1 <span style="color: #0000ff;">of</span> oBar file <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>ff.bmp"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>n.bmp"</span>,<span style="color: #00C800;">nil</span>,<span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\e</span>ne.bmp"</span> ;<br />  tooltip <span style="color: #ff0000;">"USO ::lBoxSelect DESACTIVADO"</span> <br />  <br />  <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> oBotBar2 <span style="color: #0000ff;">of</span> oBar file <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>ff.bmp"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>n.bmp"</span>,<span style="color: #00C800;">nil</span>,<span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\e</span>ne.bmp"</span> noborder;<br />  tooltip <span style="color: #ff0000;">"USO ::lBoxSelect ACTIVADO"</span><br /><br />  <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> oBotBar3 <span style="color: #0000ff;">of</span> oBar file <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>utt1upD.bmp"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>utt1do.bmp"</span>,<span style="color: #00C800;">nil</span>,<span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>utt1upL.bmp"</span> noborder;<br />  tooltip <span style="color: #ff0000;">"USO ::lBoxSelect DESACTIVADO"</span> <br /><br /><span style="color: #B900B9;">//----------- TESTING DISABLED -----------</span><br /><br />  <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> oBotBar4 <span style="color: #0000ff;">of</span> oBar file <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>ara.bmp"</span> <span style="color: #0000ff;">adjust</span>;<br />  tooltip <span style="color: #ff0000;">"Con ADJUST"</span><br /><br /> <span style="color: #B900B9;">// Works</span><br /><br />  @ <span style="color: #000000;">0</span>, <span style="color: #000000;">570</span> <span style="color: #0000ff;">BTNBMP</span> oBotBar5 <span style="color: #0000ff;">OF</span> oBar ;<br />  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> ;<br />  BORDER ;<br />  <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"E&nd"</span> ;<br />  FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>ara.bmp"</span>  <br /><br /> <span style="color: #B900B9;">// doesn*t work</span><br /><br />  @ <span style="color: #000000;">0</span>, <span style="color: #000000;">650</span> <span style="color: #0000ff;">BTNBMP</span> oBotBar6 <span style="color: #0000ff;">OF</span> oBar ;<br />  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span> ;<br />  BORDER ;<br />  <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"E&nd"</span> ;<br />  FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>ara.bmp"</span>  <br /><br />  oBotBar4:<span style="color: #000000;">Disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// works</span><br /><br />  oBotBar6:<span style="color: #000000;">Disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// doesn*t work </span><br /><br /><span style="color: #B900B9;">// -----------</span><br /><br />  oBotBar0:<span style="color: #000000;">bClrGrad</span> := <span style="color: #000000;">&#123;</span> | lInvert | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lInvert, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>/<span style="color: #000000;">3</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">253</span>, <span style="color: #000000;">222</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">231</span>, <span style="color: #000000;">151</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />        <span style="color: #000000;">&#123;</span> <span style="color: #000000;">2</span>/<span style="color: #000000;">3</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">215</span>,  <span style="color: #000000;">84</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">233</span>, <span style="color: #000000;">162</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>  ;<br />      <span style="color: #000000;">&#125;</span>, ;<br />      <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>/<span style="color: #000000;">2</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">219</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">244</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">207</span><span style="color: #000000;">-50</span>, <span style="color: #000000;">221</span><span style="color: #000000;">-25</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />        <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>/<span style="color: #000000;">2</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">201</span><span style="color: #000000;">-50</span>, <span style="color: #000000;">217</span><span style="color: #000000;">-25</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">231</span>, <span style="color: #000000;">242</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>  ;<br />      <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />  oBotBar1:<span style="color: #000000;">bClrGrad</span> := bGrad<br />  oBotBar2:<span style="color: #000000;">bClrGrad</span> := bGrad<br />  oBotBar3:<span style="color: #000000;">bClrGrad</span> := bGrad<br />  <br /><br />  oBotBar1:<span style="color: #000000;">lBoxSelect</span> := .f.<br />  oBotBar3:<span style="color: #000000;">lBoxSelect</span> := .f.<br /><br />  @ <span style="color: #000000;">100</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;">200</span>, <span style="color: #000000;">70</span> <span style="color: #0000ff;">WHEN</span> lWhen ;<br />   <span style="color: #0000ff;">font</span> oFont file <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>ff.bmp"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>n.bmp"</span>,<span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\D</span>IS.BMP"</span> <span style="color: #0000ff;">right</span> <br />  <br />  @ <span style="color: #000000;">250</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">BTNBMP</span> oBot02 <span style="color: #0000ff;">OF</span> oDlgw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">70</span> noborder <span style="color: #0000ff;">ADJUST</span> TRANSPARENT;<br />  file  <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>utt1upD.bmp"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>utt1do.bmp"</span>,<span style="color: #00C800;">nil</span>,<span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>utt1upL.bmp"</span> <span style="color: #0000ff;">font</span> oFont;<br />  <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>lWhen := !lWhen<span style="color: #000000;">&#41;</span>, oBot01:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"&Test"</span> <span style="color: #000000;">&#41;</span>, oBot01:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oBot01:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />  tooltip <span style="color: #ff0000;">"Presione para Activar/Desactivar Boton Anterior"</span><br /><br />  @ <span style="color: #000000;">350</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">BTNBMP</span> oBot03 <span style="color: #0000ff;">OF</span> oDlgw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">90</span>, <span style="color: #000000;">70</span> noborder ;<br />  file  <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>utt3up.bmp"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>utt3do.bmp"</span> <span style="color: #0000ff;">adjust</span> tooltip <span style="color: #ff0000;">"Activa/Descativa 1er boton de la barra"</span>;<br />  <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> ! IsWindowEnabled<span style="color: #000000;">&#40;</span> oBotBar0:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, oBotBar0:<span style="color: #000000;">enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBotBar0:<span style="color: #000000;">disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />  @ <span style="color: #000000;">450</span>, <span style="color: #000000;">5</span> <span style="color: #0000ff;">BTNBMP</span> oBot04 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Test &2"</span> <span style="color: #0000ff;">OF</span> oDlgw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">70</span> <span style="color: #0000ff;">WHEN</span> lWhen ;<br />  file  <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>utt2up.bmp"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>utt2do.bmp"</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\d</span>is.bmp"</span> <span style="color: #0000ff;">adjust</span> <span style="color: #0000ff;">font</span> ofont <br /><br />  oBot02:<span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">&#123;</span>|| ahOldBmp<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := oBot02:<span style="color: #000000;">hBitmap1</span>, ;<br />                          ahOldBmp<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> := oBot02:<span style="color: #000000;">hPalette1</span>,;<br />                          oBot02:<span style="color: #000000;">hBitmap1</span> := ahOver<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>,;<br />                          oBot02:<span style="color: #000000;">hPalette1</span> := ahOver<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>,;<br />                          oBot02:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                          <br />  oBot02:<span style="color: #000000;">bLostFocus</span> := <span style="color: #000000;">&#123;</span>||oBot02:<span style="color: #000000;">hBitmap1</span> := ahOldBmp<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>,;<br />                          oBot02:<span style="color: #000000;">hPalette1</span> := ahOldBmp<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>,;<br />                          afill<span style="color: #000000;">&#40;</span> ahOldBmp, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span>,;<br />                          oBot02:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />  oBot01:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> CLR_BLACK, CLR_CYAN <span style="color: #000000;">&#41;</span><br />  <br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">window</span> oDlgw <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">init</span> oBot02:<span style="color: #000000;">setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span><br /> </div>[/code:vniklgzl]
Button disabled looks different on folder and buttonbar
Btnbmp disabled on folderpages is showing only a grey area open a dialog NOWAIT I need the button shown DISABLED and ENABLE again on dialog close. [img:1aibz3jl]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Btndisabl3&#46;jpg[/img:1aibz3jl] any idea ? regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Button disabled looks different on folder and buttonbar
Uwe You don't need to define a second ( disabled ) bitmap parameter ... just use your current bitmap and FiveWin manages the Disabled parameter. Rick Lipkin
Button disabled looks different on folder and buttonbar
Rick, there is NO extra bitmap. After calling the dialog ( NOWAIT ), STEUER_B(oBtn2), the button is disabled. REDEFINE BTNBMP oBtn2 OF oFld:aDialogs[ 1 ] ; ID 210 PIXEL ; BORDER ; PROMPT " &Steuer " + " Berater " ; FILENAME c_Pfad1 + "Excel1.Bmp" ; ACTION ( STEUER_B(oBtn2), [color=#FF0000:jla8jcgk][b:jla8jcgk]oBtn2:Disable()[/b:jla8jcgk][/color:jla8jcgk] , DBSELECTAREA(cMUmsName) ) ; FONT oFontSys ; LEFT oBtn2:bClrGrad := { | lMouseOver | If( ! lMouseOver,; { { aVal[112], aVal[110], aVal[111] }, ; { aVal[112], aVal[111], aVal[110] } }, ; { { aVal[116], aVal[114], aVal[115] }, ; { aVal[116], aVal[115], aVal[114] } } ) } oBtn2:cToolTip = { "Steuer-berater" + CRLF + "Daten","STEUERBERATER", 1, CLR_BLACK, 14089979 } oBtn2:SetColor( 0, ) ------------------------------------------ [b:jla8jcgk]I found the reason [/b:jla8jcgk]: it doesn't work using defined colors with [color=#FF0000:jla8jcgk][b:jla8jcgk]oBtn2:bClrGrad [/b:jla8jcgk][/color:jla8jcgk] I changed to style 2007 : REDEFINE BTNBMP oBtn2 OF oFld:aDialogs[ 1 ] ; ID 210 PIXEL [color=#0000FF:jla8jcgk][b:jla8jcgk]2007[/b:jla8jcgk][/color:jla8jcgk] ; BORDER ; [img:jla8jcgk]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Btndisabl5&#46;jpg[/img:jla8jcgk] regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Button disabled looks different on folder and buttonbar
Uwe I use 2007 as well .. then add the Gradient as the last parameter .. doing it much like you but I use the GRADIENT parameter instead of the gradient codeblock.. [code=fw:3caqgroj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBTN1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">113</span>           ;<br />       <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"ADD16"</span> ;<br />       <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Add"</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #000000;">2007</span>;<br />       <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> _UserView<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"A"</span>,oRsUser,oBtn1,oBtn2,oBtn3,oBtn4,oBtn5,oBtn6 <span style="color: #000000;">&#41;</span>,; <span style="color: #B900B9;">// add</span><br />                oLBX:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span> oLbx:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .F. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />       GRADIENT GreyButtonGrad<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:3caqgroj] [code=fw:3caqgroj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//-------------------</span><br />Func GreyButtonGrad<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// 2010 grey button skin</span><br /><br /><span style="color: #00C800;">Local</span> bGrad<br /><br />bGrad := <span style="color: #000000;">&#123;</span> | lInvert | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lInvert, ;<br />         <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">207</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">207</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>, ;<br />         <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>/<span style="color: #000000;">3</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">253</span>, <span style="color: #000000;">222</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">231</span>, <span style="color: #000000;">151</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />         <span style="color: #000000;">&#123;</span> <span style="color: #000000;">2</span>/<span style="color: #000000;">3</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">215</span>,  <span style="color: #000000;">84</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">233</span>, <span style="color: #000000;">162</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span> bGrad <span style="color: #000000;">&#41;</span><br /> </div>[/code:3caqgroj] Rick Lipkin
Button disabled looks different on folder and buttonbar
Mr Uwe Please add 2007 clause to all BTNBMP defines and see. You should be able to see grayed bitmaps. Also add GDIP clause for better grayed painting. I confirm that grayed bitmap painting is not working on BtnBmp whether on buttonbar or outside a) when large images are used ( which need to be resized to fit the button size). and (b) when not having 2007 (or 2010,etc) styles. We shall look into the issue and resolve it. Till then if you are using larger images, please add 2007 clause to all btnbmps whether or not you assign your own gradients. I also advise using GDIP clause for better gray painting.
Button disabled looks different on folder and buttonbar
Test program: [code=fw:3gt7u1ka]<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;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oFont, oBtn, oFld<br />   <span style="color: #00C800;">local</span> cBmpFile    := <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;">\q</span>uit.bmp"</span><br />   <span style="color: #00C800;">local</span> cBmpLarge   := <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;">\a</span>ndroid.bmp"</span><br />   <span style="color: #00C800;">local</span> cBmpFull    := <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>lga1.jpg"</span><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;">"TAHOA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span> BOLD<br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">800</span>,<span style="color: #000000;">700</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;">"PAINTING GRAY BUTTONS"</span><br /><br />   @  <span style="color: #000000;">20</span>,<span style="color: #000000;">100</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"NORMAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">CENTER</span><br />   @  <span style="color: #000000;">20</span>,<span style="color: #000000;">270</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"2007"</span>   <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">CENTER</span><br />   @  <span style="color: #000000;">20</span>,<span style="color: #000000;">440</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"2007 & GDI+"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">CENTER</span><br /><br />   @ <span style="color: #000000;">120</span>, <span style="color: #000000;">00</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"NORMAL"</span> + CRLF + <span style="color: #ff0000;">"SIZE"</span> + CRLF + <span style="color: #ff0000;">"BITMAPS"</span>      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">60</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">CENTER</span><br />   @ <span style="color: #000000;">310</span>, <span style="color: #000000;">00</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"LARGE"</span> + CRLF + <span style="color: #ff0000;">"BITMAPS"</span> + CRLF + <span style="color: #ff0000;">"RESIZED"</span>    <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">60</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">CENTER</span><br />   @ <span style="color: #000000;">500</span>, <span style="color: #000000;">00</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"FULLSIZE"</span> + CRLF + <span style="color: #ff0000;">"IMAGES"</span> + CRLF + <span style="color: #ff0000;">"RESIZED"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">60</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">CENTER</span><br /><br />   @  <span style="color: #000000;">60</span>,<span style="color: #000000;">100</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Enabled"</span>  FILE cBmpFile    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</span>,<span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br />   @ <span style="color: #000000;">150</span>,<span style="color: #000000;">100</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Disabled"</span> FILE cBmpFile    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</span>,<span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">WHEN</span> .F.<br /><br />   @  <span style="color: #000000;">60</span>,<span style="color: #000000;">270</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Enabled"</span>  FILE cBmpFile    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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 />   @ <span style="color: #000000;">150</span>,<span style="color: #000000;">270</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Disabled"</span> FILE cBmpFile    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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> <span style="color: #0000ff;">WHEN</span> .F.<br /><br />   @  <span style="color: #000000;">60</span>,<span style="color: #000000;">440</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Enabled"</span>  FILE cBmpFile    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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> GDIP<br />   @ <span style="color: #000000;">150</span>,<span style="color: #000000;">440</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Disabled"</span> FILE cBmpFile    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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> GDIP <span style="color: #0000ff;">WHEN</span> .F.<br /><br />   @ <span style="color: #000000;">250</span>,<span style="color: #000000;">100</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Enabled"</span>  FILE cBmpLarge    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</span>,<span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br />   @ <span style="color: #000000;">340</span>,<span style="color: #000000;">100</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Disabled"</span> FILE cBmpLarge    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</span>,<span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">WHEN</span> .F.<br /><br />   @ <span style="color: #000000;">250</span>,<span style="color: #000000;">270</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Enabled"</span>  FILE cBmpLarge    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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 />   @ <span style="color: #000000;">340</span>,<span style="color: #000000;">270</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Disabled"</span> FILE cBmpLarge    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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> <span style="color: #0000ff;">WHEN</span> .F.<br /><br />   @ <span style="color: #000000;">250</span>,<span style="color: #000000;">440</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Enabled"</span>  FILE cBmpLarge    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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> GDIP<br />   @ <span style="color: #000000;">340</span>,<span style="color: #000000;">440</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Disabled"</span> FILE cBmpLarge    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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> GDIP <span style="color: #0000ff;">WHEN</span> .F.<br /><br />   @ <span style="color: #000000;">440</span>,<span style="color: #000000;">100</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Enabled"</span>  FILE cBmpFull    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</span>,<span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br />   @ <span style="color: #000000;">530</span>,<span style="color: #000000;">100</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Disabled"</span> FILE cBmpFull    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</span>,<span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">WHEN</span> .F.<br /><br />   @ <span style="color: #000000;">440</span>,<span style="color: #000000;">270</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Enabled"</span>  FILE cBmpFull    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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 />   @ <span style="color: #000000;">530</span>,<span style="color: #000000;">270</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Disabled"</span> FILE cBmpFull    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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> <span style="color: #0000ff;">WHEN</span> .F.<br /><br />   @ <span style="color: #000000;">440</span>,<span style="color: #000000;">440</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Enabled"</span>  FILE cBmpFull    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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> GDIP<br />   @ <span style="color: #000000;">530</span>,<span style="color: #000000;">440</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Disabled"</span> FILE cBmpFull    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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> GDIP <span style="color: #0000ff;">WHEN</span> .F.<br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> <span style="color: #000000;">&#40;</span> ;<br />      oDlg:<span style="color: #000000;">Line</span><span style="color: #000000;">&#40;</span>  <span style="color: #000000;">50</span>,<span style="color: #000000;">00</span>, <span style="color: #000000;">50</span>,<span style="color: #000000;">800</span> <span style="color: #000000;">&#41;</span>, ;<br />      oDlg:<span style="color: #000000;">Line</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">240</span>,<span style="color: #000000;">00</span>,<span style="color: #000000;">240</span>,<span style="color: #000000;">800</span> <span style="color: #000000;">&#41;</span>, ;<br />      oDlg:<span style="color: #000000;">Line</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">430</span>,<span style="color: #000000;">00</span>,<span style="color: #000000;">430</span>,<span style="color: #000000;">800</span> <span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#41;</span><br /><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 /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:3gt7u1ka] [url=https&#58;//imageshack&#46;com/i/plimUEq1p:3gt7u1ka][img:3gt7u1ka]http&#58;//imagizer&#46;imageshack&#46;us/v2/xq90/921/imUEq1&#46;png[/img:3gt7u1ka][/url:3gt7u1ka] The problem is with non-2007 style buttons with larger images requiring resizing. Also grayed text is not visible on some backgrounds. The behavior is the same on buttonbars, windows, dialogs and folders/folderex. We shall fix these asap.
Button disabled looks different on folder and buttonbar
Fixed and the fix is available in FWH 17.03. Results after fixing [url=https&#58;//imageshack&#46;com/i/pnoDSZulp:37ekujm0][img:37ekujm0]http&#58;//imagizer&#46;imageshack&#46;us/v2/xq90/923/oDSZul&#46;png[/img:37ekujm0][/url:37ekujm0] Using GDIP clause has a definite advantage. This fix can be applied to earlier versions of btnbmp.prg. Please locate the following code towards the end of METHOD PaintBitmap() [code=fw:37ekujm0]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #B900B9;">// following &nbsp;3 lines are important for backward compatibility 2015-02-29</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lGray .and. !<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span> .or. ::<span style="color: #000000;">l2013</span> .or. ::<span style="color: #000000;">l2015</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; BtnDisable<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;</div>[/code:37ekujm0] Please substitute these lines with this revised code: [code=fw:37ekujm0]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #B900B9;">// following &nbsp;3 lines are important for backward compatibility 2015-02-29</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Lines 2 to 4 in the condition are added 2017-03-02 : FWH 17.03</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lGray .and. !<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">l2007</span> .or. ::<span style="color: #000000;">l2010</span> .or. ::<span style="color: #000000;">l2013</span> .or. ::<span style="color: #000000;">l2015</span> <span style="color: #000000;">&#41;</span> .and. ;<br />&nbsp; &nbsp; &nbsp; ! ::<span style="color: #000000;">lGDIP</span> .and. ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> GetBmpHeight<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBmp</span> <span style="color: #000000;">&#41;</span> <= <span style="color: #000000;">&#40;</span> aBmpRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> - aBmpRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; GetBmpWidth<span style="color: #000000;">&#40;</span> &nbsp;::<span style="color: #000000;">hBmp</span> <span style="color: #000000;">&#41;</span> <= <span style="color: #000000;">&#40;</span> aBmpRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> - aBmpRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; BtnDisable<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp;</div>[/code:37ekujm0] Please apply the fix and check the results.
Button disabled looks different on folder and buttonbar
Rao Is the use of PIXEL needed with the GDIP clause ? [code=fw:3qq3fl15]<div class="fw" id="{CB}" style="font-family: monospace;"><br />@ <span style="color: #000000;">440</span>,<span style="color: #000000;">440</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Enabled"</span>  FILE cBmpFull    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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> GDIP<br />@ <span style="color: #000000;">530</span>,<span style="color: #000000;">440</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Disabled"</span> FILE cBmpFull    <span style="color: #0000ff;">LEFT</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</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> GDIP <span style="color: #0000ff;">WHEN</span> .F.<br /> </div>[/code:3qq3fl15] What changes would your make for the btnbmp code below ? Thanks Rick Lipkin [code=fw:3qq3fl15]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBTN1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">113</span>           ;<br />       <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"ADD16"</span> ;<br />       <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Add"</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #000000;">2007</span>;<br />       <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> _UserView<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"A"</span>,oRsUser,oBtn1,oBtn2,oBtn3,oBtn4,oBtn5,oBtn6 <span style="color: #000000;">&#41;</span>,; <span style="color: #B900B9;">// add</span><br />                oLBX:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span> oLbx:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .F. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />       GRADIENT GreyButtonGrad<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:3qq3fl15] [code=fw:3qq3fl15]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//-------------------</span><br />Func GreyButtonGrad<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// 2010 grey button skin</span><br /><br /><span style="color: #00C800;">Local</span> bGrad<br /><br />bGrad := <span style="color: #000000;">&#123;</span> | lInvert | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lInvert, ;<br />         <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">207</span>, <span style="color: #000000;">207</span>, <span style="color: #000000;">207</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>, ;<br />         <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>/<span style="color: #000000;">3</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">253</span>, <span style="color: #000000;">222</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">231</span>, <span style="color: #000000;">151</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />         <span style="color: #000000;">&#123;</span> <span style="color: #000000;">2</span>/<span style="color: #000000;">3</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">215</span>,  <span style="color: #000000;">84</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">233</span>, <span style="color: #000000;">162</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /> </div>[/code:3qq3fl15]
Button disabled looks different on folder and buttonbar
PIXEL clause is required to indicate that the nRow and nCol values in "@ nRow,nCol" are in pixels. Your REDEFINE command is okay as it is. If you prefer GDIP rendering, please add the clause GDIP anywhere in the command. If we specify the clause GDIP, the image is read and rendered using GDI+. But before that please apply the fix posted above. OT: We need to make our application work with monitors of different resolutions and it is better to code the coordinates and sizes relative to the screen size and orientation than to use Resources.
Button disabled looks different on folder and buttonbar
Mr Nages, i have a problem to insert the value 2010 or 2013 or 2015 I saw on include I have this [code=fw:15izhnof]<div class="fw" id="{CB}" style="font-family: monospace;">#xcommand @ <nRow>, <nCol> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #000000;">&#91;</span><oBtn><span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <resource: <span style="color: #0000ff;">NAME</span>, <span style="color: #0000ff;">RESNAME</span>, RESOURCE> <cResName1> ;<br />                <span style="color: #000000;">&#91;</span>,<cResName2><span style="color: #000000;">&#91;</span>,<cResName3><span style="color: #000000;">&#91;</span>,<cResName4><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <file: <span style="color: #000000;">FILE</span>, FILENAME, DISK, BITMAP> <cBmpFile1> ;<br />                <span style="color: #000000;">&#91;</span>,<cBmpFile2><span style="color: #000000;">&#91;</span>,<cBmpFile3><span style="color: #000000;">&#91;</span>,<cBmpFile4><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">SIZE</span> <nWidth>, <nHeight> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">ACTION</span> <uAction,...> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <of:<span style="color: #0000ff;">OF</span>, <span style="color: #0000ff;">WINDOW</span>, DIALOG> <oWnd> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">MESSAGE</span> <cMsg> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">WHEN</span> <uWhen> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <adjust: <span style="color: #000000;">ADJUST</span>> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <lUpdate: <span style="color: #000000;">UPDATE</span>> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">PROMPT</span> <cPrompt> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">FONT</span> <oFont> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> TOOLTIP <cToolTip> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <lNoBorder: <span style="color: #000000;">NOBORDER</span>> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <lFlat: <span style="color: #000000;">FLAT</span>> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <layout: <span style="color: #0000ff;">CENTER</span>, TOP, <span style="color: #0000ff;">LEFT</span>, BOTTOM, RIGHT> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <l2007: <span style="color: #000000;">2007</span>> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <lTrans: <span style="color: #000000;">TRANSPARENT</span>> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <lNoRound: <span style="color: #000000;">NOROUND</span>> <span style="color: #000000;">&#93;</span>;<br />             <span style="color: #000000;">&#91;</span> GRADIENT <bGradColors> <span style="color: #000000;">&#93;</span>;<br />             <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">COLOR</span> <nClrFore> <span style="color: #000000;">&#91;</span>,<nClrBack><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <pixel: <span style="color: #000000;">PIXEL</span>> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <design: <span style="color: #000000;">DESIGN</span>> <span style="color: #000000;">&#93;</span> ;<br />             <span style="color: #000000;">&#91;</span> <lGDIP: <span style="color: #000000;">GDIP</span>, GDIPLUS> <span style="color: #000000;">&#93;</span>;<br />      => ;<br />         <span style="color: #000000;">&#91;</span> <oBtn> := <span style="color: #000000;">&#93;</span> TBtnBmp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <nRow>, <nCol>, <nWidth>, <nHeight>,;<br />            <cResName1>, <cResName2>, <cBmpFile1>, <cBmpFile2>,;<br />            <span style="color: #000000;">&#91;</span><span style="color: #000000;">&#123;</span>|Self|<uAction><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#93;</span>, <oWnd>, <cMsg>, <<span style="color: #000000;">&#123;</span>uWhen<span style="color: #000000;">&#125;</span>>, <.<span style="color: #0000ff;">adjust</span>.>,;<br />            <.lUpdate.>, <cPrompt>, <oFont>, <span style="color: #000000;">&#91;</span><cResName3><span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#91;</span><cBmpFile3><span style="color: #000000;">&#93;</span>,;<br />            !<.lNoBorder.>, <span style="color: #000000;">&#91;</span> Upper<span style="color: #000000;">&#40;</span><<span style="color: #000000;">&#40;</span>layout<span style="color: #000000;">&#41;</span>><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span>, <.l2007.>,<span style="color: #000000;">&#91;</span><cResName4><span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#91;</span><cBmpFile4><span style="color: #000000;">&#93;</span>, ;<br />            <.lTrans.>, <cToolTip>, !<.lNoRound.>, <bGradColors>, <.<span style="color: #0000ff;">pixel</span>.>, <.design.>, <.lFlat.>, ;<br />            <span style="color: #000000;">&#91;</span><nClrFore><span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#91;</span><nClrBack><span style="color: #000000;">&#93;</span>, <.lGDIP.> <span style="color: #000000;">&#41;</span></div>[/code:15izhnof] and if I try to set the button with obtn1:l2015:=.t. or obtn1:l2013:=.t. or obtn1:l2010 :=.t. is allways the same color any solution please ?
Button in Dialog not themed 7.05
On the latest FWH release, with the latest xHarbour, running in Vista. On a dialog, my buttons are the old boxy type although the rest of the dialog box sets to the Windows Vista theme. These are regular dialog buttons not bitmap buttons. Why not the rounded theme buttons ? Example: In the program code: REDEFINE BUTTON ID 710 of oDiw ACTION ( oInv:save( ), oDiw:update( ), oLbxin:setfocus( ) ); MESSAGE "Save any changes made to the current inventory item" And in the RC: CONTROL "&Save", 710, "Button", WS_TABSTOP, 580, 96, 50, 12 Previously we had themed buttons ... Tim <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> NOW THAT I LOOK MORE CLOSELY I also see that the edit fields are also the boxy squared off version. Didn't we have all of these working cleanly with themes in the past ( rounded like in all the other programs ) or am I just imagining that ?
Button in Dialog not themed 7.05
Tim, Please check that you are including WindowsXP.Manifest file in your resources, to get themes support
Button in Dialog not themed 7.05
Thats the first thing I checked ... and it is there. The Dialog box and background is fine. The edit fields are dark boxes and the buttons are square boxes ...
Button in Dialog not themed 7.05
OK ... in the .RC file there is also a reference to the manifest ... or their should be. However, I had updated the file using the Pelles resource compiler, and it eliminated that reference. I added it in with a text editor and got my themes back. Its a shame we don't have a stable resource compiler, 32 bit, Vista compatible.
Button in Dialog not themed 7.05
Tim There was an earlier post on a resource ( free ) editor from Resedit .. I have not used it in production .. here is the link if you would like to download and try. <!-- m --><a class="postlink" href="http://www.resedit.net/">http://www.resedit.net/</a><!-- m --> Rick Lipkin SC Dept of Health, USA
Button in GET problem
Hello,Consider sample "GetBtn.prg".Now, change line 5 from:[code:1oa0245c]local oWnd, cTest &#58;= "Hello world!"[/code:1oa0245c]to[code:1oa0245c]local oWnd, cTest &#58;= "Hello world! "[/code:1oa0245c]Notice that cTest is now longer. This makes that cTest will scroll in the GET.Notice that the carret and the scrolling text goes behind the button.Patrick
Button in GET problem
Patrick,The BUTTON is created as a child control of the GET, so you have to give the GET enough width so the text and the button don't overlay.
Button in GET problem
[quote="Antonio Linares":28ya3sr8]The BUTTON is created as a child control of the GET, so you have to give the GET enough width so the text and the button don't overlay.[/quote:28ya3sr8]So you can only use a button in a GET when the text its in the GET? Most of my gets are horizontal scrollable.Like for example a customer name, it can be 10 char's or 87. So, most of the width's of the GET's are smaller than the text that can fit them and thus almost all of them are horizontal scrollable.Patrick
Button in GET problem
Patrick,The only way to get such behavior would be to find how to reduce the GET client area used to paint the text (if possible!).Lets google for it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Button in GET problem
This seems as a possible solution: WM_NCCALCSIZE<!-- m --><a class="postlink" href="http://msdn.microsoft.com/en-us/library/ms632634(VS.85">http://msdn.microsoft.com/en-us/library/ms632634(VS.85</a><!-- m -->).aspx
Button in GET problem
Google is great <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --><!-- m --><a class="postlink" href="http://www.gipsysoft.com/articles/BuddyButton/">http://www.gipsysoft.com/articles/BuddyButton/</a><!-- m -->
Button in GET problem
[quote="Antonio Linares":1eko1prr]Google is great <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> <!-- m --><a class="postlink" href="http://www.gipsysoft.com/articles/BuddyButton/">http://www.gipsysoft.com/articles/BuddyButton/</a><!-- m -->[/quote:1eko1prr]Haha, great! Just what we need! <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) -->Patrick
Button in GET problem
Hello Antonio,[img:2c657b22]http&#58;//geocities&#46;yahoo&#46;com&#46;br/qiinformatica2000/getbtn&#46;PNG[/img:2c657b22]You can adjust this?Thank´sRossine.
Button in GET problem
Hey Rossine,[quote:286se09n][img:286se09n]http&#58;//geocities&#46;yahoo&#46;com&#46;br/qiinformatica2000/getbtn&#46;PNG[/img:286se09n]You can adjust this? [/quote:286se09n]This is exact what we are talking about here. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->Patrick
Button in GET problem
Patrick,>Most of my gets are horizontal scrollable. As a user I would hate that. You can't see all the data; you have to scroll each GET one at a time.Here is what Alan Cooper has to say about horizontal scrolling, in his book "About Face The Essentials of User Interaction Design." He is talking about listboxes, but I think the same applies to edit boxes.[quote:7tstmfo6]Listboxes can also be made to scroll horizontally. This feature allows the programmer to put extra long text into the listbox with a minimum of effort. It offers nothing to the user. Scrolling a list of text horizontally is a terrible thing, and it should never ever need to be done. ... The purpose of computers is to eliminate strain from the lives of humans.[/quote:7tstmfo6]It sounds like you are trying to put too many GETs on the same screen. Perhaps you could solve this using tabs and splitting them up into different tab panes. If you display each GET fully, and it takes two tabs, then the user can see all the data with only one click. The current design would require dozens of clicks and arrow movements to see all the data.Regards,James
Button in GET problem
Hello James,[quote="James Bott":3grwf6lc]>Most of my gets are horizontal scrollable. As a user I would hate that. You can't see all the data; you have to scroll each GET one at a time.[/quote:3grwf6lc]I disagree. Lets say you have an address line on your form. You never know how many characters you need for a address line. So, you make the GET that holds the address line extra wide? Hmm.. design-wise? Not a good decision I think.Anyway. If you want to use horizontal scrollable GET's or not, I still think the Caret of the GET should NOT go behind the button in the GET.<!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) -->Patrick
Button in GET problem
Patrick,We are already working on it to provide a fix asap using those urls info <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->James advise is very clever, but we understand that the GET has to properly work on those circunstances too.
Button in GET problem
Patrick:I use the BtnGet class and that problem I have solved with the MULTI-LINE property YESPls, try this, I hope this can help you.Best regards
Button in GET problem
Patrick,>I disagree. Lets say you have an address line on your form. You never know how many characters you need for a address line. So, you make the GET that holds the address line extra wide? Hmm.. design-wise? Not a good decision I think.Well, it doesn't really matter what you or I think (as programmers), it matters what the users think. Your answer reiterates what Alan Cooper said, that it is easier for the programmer but not for the user. You seem to only be looking at it from an ease of programming view.I have never had a problem making an address line wide enough. Also, I always add an extra line too.[url=http&#58;//www&#46;freeimagehosting&#46;net/image&#46;php?38dcb68301&#46;jpg:kgmes416][img:kgmes416]http&#58;//www&#46;freeimagehosting&#46;net/uploads/th&#46;38dcb68301&#46;jpg[/img:kgmes416][/url:kgmes416]Have you ever seen another program with a screenful of scrolling GETs?As a user I might tolerate one or two scrolling GETs but not a whole screenful of them.Why don't you ask some of your users what they think?Regards,James
Button in GET problem
Hello,I have the same design as James.But many times users ask why the line I that long and you can’t fill in more than a certain number of characters.Sure you have to make the line a bit longer. There is a difference if there are many W’s or M’s or only I’s in a name.But reading the thread I thought why don’t one make a standard length and in stead of scrolling a dynamical resize of the get?I will try this.Regards,Otto
Button in GET problem
Hi allI agree with James that horizontally scrolling GETs are ugly and confusing for the end user. They waste time during data input. Its interesting that if one is using xBase data files the problem shouldn't normally exist given that the data base itself will have finite field sizes. But of course SQL Server type data bases have varchar fields and if you are using say XML as a backend no limits apply. Even so I think there are reasonable limits one can apply. In the case of an address you can provide a perfectly serviceable address even if in some rare instances a little bit of abbreviation or shortening may be required. Also to a certain extent you are only shifting the issue here. I have never yet seen a horizontally scrolling window faced envelope. From a system design point of view I believe that you are better off facing an issue such as this at the point of data entry so that the user knows what she or he enters is what will be used / visible and not cut off by either being hidden by an envelope window, only partly shown in a report etc. Like James I offer an extra line for an address.Having said all that I understand that everyone is entitled to try to produce code that works the way that they think is the best and heaven help us if everyone agreed with me! But I would recommend strongly against horizontally scrolling GETs.REgardsDoug(xProgrammer)
Button in GET problem
[quote="Antonio Linares":3kc3u3ix]We are already working on it to provide a fix asap using those urls info <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:3kc3u3ix]Thank you Antonio. <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) -->Patrick
Button in GET problem
Hey James,[quote="James Bott":m2l0dfff]>I disagree. Lets say you have an address line on your form. You never know how many characters you need for a address line. So, you make the GET that holds the address line extra wide? Hmm.. design-wise? Not a good decision I think. Well, it doesn't really matter what you or I think (as programmers), it matters what the users think. Your answer reiterates what Alan Cooper said, that it is easier for the programmer but not for the user. You seem to only be looking at it from an ease of programming view.[/quote:m2l0dfff] Well, I have been developing End Users applications for 25 years now. I only develop what my users ask. And I'm Nr1 in my country on accounting software. So.. <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) --> [quote:m2l0dfff]I have never had a problem making an address line wide enough. Also, I always add an extra line too. [url=http&#58;//www&#46;freeimagehosting&#46;net/image&#46;php?38dcb68301&#46;jpg:m2l0dfff][img:m2l0dfff]http&#58;//www&#46;freeimagehosting&#46;net/uploads/th&#46;38dcb68301&#46;jpg[/img:m2l0dfff][/url:m2l0dfff][/quote:m2l0dfff]Hey, nice looking screen! Ok, now lets say my email address is "michele.van.den.aakhoornlaan@sweertsmichele-bvba.com" How is this going to fit in your email GET? [quote:m2l0dfff]Have you ever seen another program with a screenful of scrolling GETs?[/quote:m2l0dfff]I see a horizontal scrolling GET as a extra users freindly way of letting the user type in LONGER text than I as a programmer forsee. Its a PLUS! <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> [quote:m2l0dfff]As a user I might tolerate one or two scrolling GETs but not a whole screenful of them.[/quote:m2l0dfff]As a user I would call my developer and ask him WHY it is that my email does not fit in to the FIXED lenght GET the developer provided me. Why would we LIMIT the user in typing ONLY the digits we let them to? [quote:m2l0dfff]Why don't you ask some of your users what they think?[/quote:m2l0dfff]Believe me James, I do! <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) -->No hard feelings. Lets just conclude that we have a different opinion on this subject. For sure, I do respect your view.BTW, this is my customer form:[img:m2l0dfff]http&#58;//www&#46;xHarbour&#46;net/klant&#46;jpg[/img:m2l0dfff]Patrick[/img]
Button in GET problem
Patrick,OK, after seeing your screen perhaps I misunderstood what you were describing. I thought that you were saying that all your GETs were too short for the typical entry so one could not see the entire entry for any of the GETs. This would be very frustrating.Now, it looks like yours are only used on the very rare occasion. Is that true?I am not sure how you store this data. Do you just have very long fields for everything? And as Doug said, how do you deal with this on reports, etc? Do you truncate the long data if it won't fit?I am aware of your background and your product and I have great respect for you too, Patrick. And, I do think that bringing up controversial topics like this can benefit everyone. I always hope people challenge my views too, so I (and others) may benefit.Best Regards,James
Button in GET problem
I tried something like that but somewhere is a mistake I can’t find out:@ 2, 2 GET oGet VAR cTest SIZE nWidth, 22 ON CHANGE (nLaenge := oGet:GetWidth(ALLTRIM(cTest)),;Iif(nLaenge > nWidth,( oGet:nWidth( nLaenge + 5 ),oGet:refresh() ,))Regards,Otto
Button in Window/Dialog Title bar
Hi Everybody, Is it possible to place a button in the title bar of either a window or a dialog? Thanks, Jeff
Button labels changing font size
I encountered a strange problem with FWH 12.04 that does not exist in previous versions. On my main( ) program, I create a window with a button bar ( oBar ). When I open a dialog, I will hide() the bar. When I return from the dialog, I again show( ) the bar. With the release of 12.04, I noticed that the font size changes when I retrieve the bar, and it is larger. I went back to older versions of my software and this clearly does not exist. Any thoughts on this, and an idea on how to resolve it ? Thanks.
Button labels changing font size
Has anyone else seen this occur in 12.04 ?
Button labels changing font size
Can you post a little sample showing the problem? EMG
Button labels changing font size
Actually, no. It doesn't lend itself to that. The steps are: 1) In the Main( ) window, a button bar is created, called oReBar. Buttons are added to it. 2) When a dialog is ACTIVATEd, ON INIT includes oReBar:Hide( ). 3) When a dialog is closed, oReBar:Show( ) is issued. 4) In past versions, the bar was displayed and the label font never changed 5) With 12.04, when the Show( ) is issued, the bar returns, but with a larger font. 6) This is consistent with ALL dialog calls. Tim
Button labels changing font size
Hello Tim, I couldn't detect any problem : [img:3407gz9q]http&#58;//www&#46;pflegeplus&#46;com/pictures/BBart1&#46;jpg[/img:3407gz9q] [code=fw:3407gz9q]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">static</span> oWnd, cPath, oBar, oBrush, oCursorHand<br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> hDCo, oButt1, oButt2, oButt3, oButt4, oButt5, oButt6<br /><span style="color: #00C800;">LOCAL</span> oButtFont1, oButtFont2, oButtFont3<br /><br />c_path := GETCURDIR<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <br />oButtFont1 := TFont<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Arial"</span>,,<span style="color: #000000;">-18</span>,.F.,.F.,,,,.F.<span style="color: #000000;">&#41;</span><br />oButtFont2 := TFont<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Arial"</span>,,<span style="color: #000000;">-18</span>,.F.,.T.,,,,.F.<span style="color: #000000;">&#41;</span><br />oButtFont3 := TFont<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Arial"</span>,,<span style="color: #000000;">-18</span>,.F.,.T.,,,,.T.<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oCursorHand HAND<br />SetBalloon<span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// Color</span><br /><span style="color: #B900B9;">// -------</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush  <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">14853684</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Testing Buttonbar"</span>  ;<br /><span style="color: #0000ff;">MENU</span> TMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">BRUSH</span> oBrush<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">80</span> 3DLOOK <span style="color: #000000;">2007</span> TOP<br /><span style="color: #B900B9;">// 1) In the Main( ) window, a button bar is created, called oReBar. Buttons are added to it.</span><br /><span style="color: #B900B9;">// 2) When a dialog is ACTIVATEd, ON INIT includes oReBar:Hide( ).</span><br /><span style="color: #B900B9;">// 3) When a dialog is closed, oReBar:Show( ) is issued.</span><br /><span style="color: #B900B9;">// 4) In past versions, the bar was displayed and the label font never changed</span><br /><span style="color: #B900B9;">// 5) With 12.04, when the Show( ) is issued, the bar returns, but with a larger font.</span><br /><span style="color: #B900B9;">// 6) This is consistent with ALL dialog calls.</span><br /><br />oBar:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><br />oBar:<span style="color: #000000;">bClrGrad</span> = <span style="color: #000000;">&#123;</span> | lInvert | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lInvert, ;<br />   <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.90</span>,<span style="color: #000000;">14853684</span>,<span style="color: #000000;">16314573</span> <span style="color: #000000;">&#125;</span>, ;<br />     <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.90</span>,<span style="color: #000000;">16314573</span>,<span style="color: #000000;">14853684</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>, ;<br />   <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.90</span>,<span style="color: #000000;">14853684</span>,<span style="color: #000000;">14853684</span> <span style="color: #000000;">&#125;</span>, ;<br />     <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.90</span>,<span style="color: #000000;">14853684</span>,<span style="color: #000000;">14853684</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oButt1 <span style="color: #0000ff;">OF</span> oBar FILE c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>roject<span style="color: #000000;">\E</span>XPLORER.BMP"</span> ;<br /><span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Button 1"</span> ; <br /><span style="color: #0000ff;">ACTION</span> D_START<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Button 1"</span> <br /><br />oButt1:<span style="color: #000000;">cToolTip</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">" "</span> + CRLF + <span style="color: #ff0000;">"Button 1"</span>, <span style="color: #ff0000;">"1. Button"</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">128</span> <span style="color: #000000;">&#125;</span><br />oButt1:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">128</span> <span style="color: #000000;">&#41;</span><br />oButt1:<span style="color: #000000;">SetFont</span><span style="color: #000000;">&#40;</span>  oButtFont1 <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oButt2 <span style="color: #0000ff;">OF</span> oBar FILE c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>roject<span style="color: #000000;">\T</span>RASH.BMP"</span> ;<br /><span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Button 2"</span> ; <br /><span style="color: #0000ff;">ACTION</span> MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Button 1"</span>,<span style="color: #ff0000;">"Attention"</span> <span style="color: #000000;">&#41;</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Button 2"</span> <br /><br />oButt2:<span style="color: #000000;">cToolTip</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">" "</span> + CRLF + <span style="color: #ff0000;">"Button 2"</span>, <span style="color: #ff0000;">"2. Button"</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">128</span> <span style="color: #000000;">&#125;</span><br />oButt2:<span style="color: #000000;">SetFont</span><span style="color: #000000;">&#40;</span>  oButtFont2 <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oButt3 <span style="color: #0000ff;">OF</span> oBar FILE c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>roject<span style="color: #000000;">\V</span>ISA.BMP"</span> ;<br /><span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Button 3"</span> ; <br /><span style="color: #0000ff;">ACTION</span> MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Button 3"</span>,<span style="color: #ff0000;">"Attention"</span> <span style="color: #000000;">&#41;</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Button 3"</span> <br /><br />oButt3:<span style="color: #000000;">cToolTip</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">" "</span> + CRLF + <span style="color: #ff0000;">"Button 3"</span>, <span style="color: #ff0000;">"3. Button"</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">128</span> <span style="color: #000000;">&#125;</span><br />oButt3:<span style="color: #000000;">SetFont</span><span style="color: #000000;">&#40;</span>  oButtFont3 <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oButt4 <span style="color: #0000ff;">OF</span> oBar FILE c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>roject<span style="color: #000000;">\I</span>CHAT.BMP"</span> ;<br /><span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Button 4"</span> ; <br /><span style="color: #0000ff;">ACTION</span> MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Button 4"</span>,<span style="color: #ff0000;">"Attention"</span> <span style="color: #000000;">&#41;</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Button 4"</span> <br /><br />oButt4:<span style="color: #000000;">cToolTip</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">" "</span> + CRLF + <span style="color: #ff0000;">"Button 4"</span>, <span style="color: #ff0000;">"4. Button"</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">128</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oButt5 <span style="color: #0000ff;">OF</span> oBar FILE c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>roject<span style="color: #000000;">\P</span>ENDRIVE.BMP"</span> ;<br /><span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Button 5"</span> ; <br /><span style="color: #0000ff;">ACTION</span> MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Button 5"</span>,<span style="color: #ff0000;">"Attention"</span> <span style="color: #000000;">&#41;</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Button 5"</span> <br /><br />oButt5:<span style="color: #000000;">cToolTip</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">" "</span> + CRLF + <span style="color: #ff0000;">"Button 5"</span>, <span style="color: #ff0000;">"5. Button"</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">128</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oButt6 <span style="color: #0000ff;">OF</span> oBar FILE c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>roject<span style="color: #000000;">\S</span>top.bmp"</span>  <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Close"</span> ; <br /><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Close"</span> <br /><br />oButt6:<span style="color: #000000;">cToolTip</span> := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">" "</span> + CRLF + <span style="color: #ff0000;">"Close Bartest"</span>, <span style="color: #ff0000;">"Close"</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">128</span> <span style="color: #000000;">&#125;</span><br /><br />AEval<span style="color: #000000;">&#40;</span> oWnd:<span style="color: #000000;">aControls</span>, <span style="color: #000000;">&#123;</span> | o | o:<span style="color: #000000;">oCursor</span> := oCursorHand <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"Bar-Test"</span> ;<br /><span style="color: #0000ff;">CENTERED</span> CLOCK KEYBOARD <span style="color: #000000;">2007</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br /><br />oBrush:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oButtFont1:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oButtFont2:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oButtFont3:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// -------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> D_START<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> oDlg1<br /><br /><span style="color: #00C800;">LOCAL</span> oDlgFont := TFont<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Arial"</span>,,<span style="color: #000000;">-12</span>,.F.,.F.,,,,.F.<span style="color: #000000;">&#41;</span><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;">200</span>, <span style="color: #000000;">300</span>  <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Dialog-test"</span> <span style="color: #0000ff;">FONT</span> oDlgFont <span style="color: #0000ff;">OF</span> oWnd ;<br /><span style="color: #0000ff;">PIXEL</span> TRANSPARENT<br /><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg1 <span style="color: #0000ff;">CENTERED</span>  ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oBar:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,  oDlg1:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">300</span>, <span style="color: #000000;">500</span>, <span style="color: #000000;">400</span>, .f. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br /><br />oDlgFont:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oBar:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:3407gz9q] Best Regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Button labels changing font size
Uwe Along those same lines .. I am seeing my Buttonbar with version 1203 just become un-responsive when I click on a button from a MDI buttonbar to a mdichild .. close the mdichild and from time to time the oBar seems like it is disabled and I have not disabled it in the mdichild. The only thing different in this button bar is the MDI bar has groups associated with it and when you run OwnView() associated with oPopUtl menu .. when the program returns control from OwnView() which is a mdichild .. oBar becomes un-responsive... you can click the X close and any menu option from the BuildMenu function works.. just oBar is dead. I have not yet worked up a small example .. just curious if anyone else has experienced this behavoir? Thanks Rick Lipkin [code=fw:udn9t4sn]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----- main menu -------//</span><br /><br />xMESSAGE :=  <span style="color: #ff0000;">"User  "</span>+xLOGIN+<span style="color: #ff0000;">"    Rights  "</span>+cRIGHTS+        ;<br />      <span style="color: #ff0000;">"     Default= "</span>+cDEFA+<span style="color: #ff0000;">"      Rdd= "</span>+cRDD+            ;<br />      <span style="color: #ff0000;">"     Revision  "</span>+DTOC<span style="color: #000000;">&#40;</span>dEXE<span style="color: #000000;">&#41;</span>+;<br />      <span style="color: #ff0000;">"  -r"</span>+str<span style="color: #000000;">&#40;</span>nSCR1,<span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" x "</span>+STR<span style="color: #000000;">&#40;</span>nSCR2,<span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oICO <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"PMO"</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWindMain                                      ;<br />   <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">28</span>,<span style="color: #000000;">78</span>                                         ;<br />   <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"PMO Strategic Projects Vital Signs"</span>                ;<br />   <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">&#40;</span>cOLDDEFA,dEXE,cRDD,nSCR1,nSCR2,lFROMLINK,xPROJECTEID,oWindMain<span style="color: #000000;">&#41;</span>;<br />   <span style="color: #0000ff;">ICON</span> oICO                                                 ;<br />   <span style="color: #0000ff;">MDI</span><br /><br />  <span style="color: #0000ff;">DEFINE</span> BITMAP oBMAP FILENAME <span style="color: #000000;">&#40;</span>cOLDDEFA+<span style="color: #ff0000;">"<span style="color: #000000;">\P</span>MO.BMP"</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">of</span> oWindMain<br />                                      <span style="color: #B900B9;">// 56, 64</span><br />  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oWindMain <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">56</span>,<span style="color: #000000;">58</span> <span style="color: #000000;">2010</span><br />  *     oBar:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><br />  oBar:<span style="color: #000000;">bClrGrad</span> = <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.10</span>,<span style="color: #000000;">15724527</span>,<span style="color: #000000;">7303023</span> <span style="color: #000000;">&#125;</span>, ;<br />                       <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.10</span>,<span style="color: #000000;">7303023</span>,<span style="color: #000000;">15724527</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oButt1 <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> _ProjBrow<span style="color: #000000;">&#40;</span>oWindMain, lFROMLINK, xPROJECTEID, oBar <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  ;<br />              <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"compas"</span>,;<br />                       <span style="color: #ff0000;">"DCompas"</span>,;<br />                       <span style="color: #ff0000;">"DCompas"</span>;<br />              <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Projects"</span> ;<br />              TOOLTIP <span style="color: #ff0000;">"Project Management Information"</span><br /><br />  <span style="color: #B900B9;">//--------  group --</span><br />  <span style="color: #0000ff;">MENU</span> oPopRpt1 <span style="color: #0000ff;">POPUP</span><br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"PMO Project Status Report"</span> FileName <span style="color: #000000;">&#40;</span>cDefa+<span style="color: #ff0000;">"<span style="color: #000000;">\I</span>cons<span style="color: #000000;">\F</span>OLDEROPEN.bmp"</span><span style="color: #000000;">&#41;</span> ;<br />              <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> _ProjList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"PMO Delinquent Reminder Reporting"</span> FileName <span style="color: #000000;">&#40;</span>cDefa+<span style="color: #ff0000;">"<span style="color: #000000;">\I</span>cons<span style="color: #000000;">\F</span>OLDERCLOSED.bmp"</span><span style="color: #000000;">&#41;</span>;<br />              <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> _ProjDelq<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"PMO Delinquent Reporting Generation"</span> FileName <span style="color: #000000;">&#40;</span>cDefa+<span style="color: #ff0000;">"<span style="color: #000000;">\I</span>cons<span style="color: #000000;">\F</span>OLDERDETAIL.bmp"</span><span style="color: #000000;">&#41;</span>;<br />              <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Under Construction"</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"PMO Delinquent Reporting Generation"</span> FileName <span style="color: #000000;">&#40;</span>cDefa+<span style="color: #ff0000;">"<span style="color: #000000;">\I</span>cons<span style="color: #000000;">\F</span>OLDERCLOSED.bmp"</span><span style="color: #000000;">&#41;</span>;<br />              <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>_Delinq<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />  <span style="color: #0000ff;">ENDMENU</span><br /><br /><br />  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oButt2 <span style="color: #0000ff;">of</span> oBar   ;<br />              <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"reports"</span>,;<br />                       <span style="color: #ff0000;">"DReports"</span>,;<br />                       <span style="color: #ff0000;">"DReports"</span>;<br />              <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Reports"</span> ;<br />              <span style="color: #0000ff;">ACTION</span> oButt2:<span style="color: #000000;">ShowPopup</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>GROUP;<br />              <span style="color: #0000ff;">MENU</span> oPopRpt1 ;<br />              TOOLTIP <span style="color: #ff0000;">"Reports"</span><br /><br /><br />  <span style="color: #B900B9;">//--------  group --</span><br />  <span style="color: #0000ff;">MENU</span> oPopUtl <span style="color: #0000ff;">POPUP</span><br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"System Parameters"</span> FileName <span style="color: #000000;">&#40;</span>cDefa+<span style="color: #ff0000;">"<span style="color: #000000;">\I</span>cons<span style="color: #000000;">\F</span>OLDEROPEN.bmp"</span><span style="color: #000000;">&#41;</span> ;<br />              <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> _OwnView<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"E"</span>, oWindMain <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"User and  Project Mgr Information"</span> FileName <span style="color: #000000;">&#40;</span>cDefa+<span style="color: #ff0000;">"<span style="color: #000000;">\I</span>cons<span style="color: #000000;">\F</span>OLDERCLOSED.bmp"</span><span style="color: #000000;">&#41;</span>;<br />              <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> _userbrow<span style="color: #000000;">&#40;</span> oWindMain <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Sponsor and Customer Information"</span> FileName <span style="color: #000000;">&#40;</span>cDefa+<span style="color: #ff0000;">"<span style="color: #000000;">\I</span>cons<span style="color: #000000;">\F</span>OLDERDETAIL.bmp"</span><span style="color: #000000;">&#41;</span>;<br />              <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> _Spbrow<span style="color: #000000;">&#40;</span> oWindMain <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Frequency Indicator Information"</span> FileName <span style="color: #000000;">&#40;</span>cDefa+<span style="color: #ff0000;">"<span style="color: #000000;">\I</span>cons<span style="color: #000000;">\F</span>OLDERCLOSED.bmp"</span><span style="color: #000000;">&#41;</span>;<br />              <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> _FreqBrow<span style="color: #000000;">&#40;</span> oWindMain <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Role Information"</span> FileName <span style="color: #000000;">&#40;</span>cDefa+<span style="color: #ff0000;">"<span style="color: #000000;">\I</span>cons<span style="color: #000000;">\F</span>OLDERDETAIL.bmp"</span><span style="color: #000000;">&#41;</span>;<br />              <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> _Rolebrow<span style="color: #000000;">&#40;</span> oWindMain <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Master Strategic Goals"</span> FileName <span style="color: #000000;">&#40;</span>cDefa+<span style="color: #ff0000;">"<span style="color: #000000;">\I</span>cons<span style="color: #000000;">\F</span>OLDERDETAIL.bmp"</span><span style="color: #000000;">&#41;</span>;<br />              <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> _Mg_brow<span style="color: #000000;">&#40;</span> oWindMain <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />  <span style="color: #0000ff;">ENDMENU</span><br /><br />  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oButt3 <span style="color: #0000ff;">of</span> oBar   ;<br />              <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"utility"</span>,;<br />                       <span style="color: #ff0000;">"DUtility"</span>,;<br />                       <span style="color: #ff0000;">"DUtility"</span>;<br />              <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Utilities"</span> ;<br />              <span style="color: #0000ff;">ACTION</span> oButt3:<span style="color: #000000;">ShowPopup</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>GROUP;<br />              <span style="color: #0000ff;">MENU</span> oPopUtl ;<br />              TOOLTIP <span style="color: #ff0000;">"Utilities and Setup Parameters"</span><br /><br />  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oButt4 <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oWindMain:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  ;<br />              <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"quit"</span>;<br />              <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Quit"</span> ;<br />              TOOLTIP <span style="color: #ff0000;">"Quit and Close this Program"</span><br /><br /><br />  SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWindMain    ;<br />      <span style="color: #0000ff;">to</span> xMESSAGE CLOCK <span style="color: #000000;">2010</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWindMain     ;<br />   <span style="color: #0000ff;">MAXIMIZED</span> ;<br />   <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> xTEXT = <span style="color: #ff0000;">"/NL"</span>, ,PalBmpDraw<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>, oBMAP:<span style="color: #000000;">hBitmap</span>, oBMAP:<span style="color: #000000;">hPalette</span>, nSCR1, nSCR2 <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />   <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> xTEXT = <span style="color: #ff0000;">"/NL"</span>, , MSGLOGO<span style="color: #000000;">&#40;</span> cDEFA+<span style="color: #ff0000;">"<span style="color: #000000;">\S</span>PLASH.BMP"</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, ;<br />             <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> nSCR1 < <span style="color: #000000;">1024</span>, _ResMessage<span style="color: #000000;">&#40;</span>nSCR1, nSCR2<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>,;<br />             <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> lFIRST = .T., _OwnView<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"A"</span>, oWindMain<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>,;<br />             <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> lFROMLINK = .T., _ProjBrow<span style="color: #000000;">&#40;</span> oWINDMain, lFROMLINK, xPROJECTEID <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>,;<br />             <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> lSENDMAIL = .T., SendMail<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,  <span style="color: #000000;">&#41;</span>, oWINDMain:<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,  oWINDMain:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />   <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> IIF<span style="color: #000000;">&#40;</span> !lExitPgm, ExitPgm<span style="color: #000000;">&#40;</span> .T.,@lExitPgm <span style="color: #000000;">&#41;</span> , .F. <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /><br /><br /> </div>[/code:udn9t4sn]
Button labels changing font size
Here is a small section of how I implemented this ... [code=fw:3gemqrtd]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />        <span style="color: #B900B9;">// Now open the window and apply settings</span><br />        <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> mlsTitle <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;">800</span>, <span style="color: #000000;">1150</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#41;</span><br /><br />        oWnd:<span style="color: #000000;">SetIcon</span><span style="color: #000000;">&#40;</span> oWIcon <span style="color: #000000;">&#41;</span><br />        oWnd:<span style="color: #000000;">oFont</span> := oMfont<br />        oWnd:<span style="color: #000000;">nHelpID</span> := <span style="color: #000000;">19</span><br />        WNDCENTER<span style="color: #000000;">&#40;</span> oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Center the window on the screen</span><br /><br />        <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oReBar <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>,<span style="color: #000000;">60</span>  <span style="color: #000000;">2007</span><br />        <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oReBar <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"ORDER"</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Order"</span> <span style="color: #0000ff;">ACTION</span> PRO100M<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#41;</span> ;<br />            TOOLTIP <span style="color: #ff0000;">"Workorders"</span> <span style="color: #0000ff;">FONT</span> oBfont<br />        <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oReBar <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"HRHIST"</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"History"</span> <span style="color: #0000ff;">ACTION</span> PRO7500<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#41;</span>;<br />            TOOLTIP <span style="color: #ff0000;">"Service History"</span> <span style="color: #0000ff;">FONT</span> oBfont<br />        <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oReBar <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"INVENT"</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Parts"</span> <span style="color: #0000ff;">ACTION</span> PRO2100<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#41;</span>;<br />            TOOLTIP <span style="color: #ff0000;">"Inventory Editor"</span> <span style="color: #0000ff;">FONT</span> oBfont GROUP<br />        <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oReBar <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"LOSTSALE"</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Lost"</span> <span style="color: #0000ff;">ACTION</span> PRO2810<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#41;</span>;<br />            TOOLTIP <span style="color: #ff0000;">"Lost Sales"</span> <span style="color: #0000ff;">FONT</span> oBfont<br />        <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oReBar <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"CLIENT"</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Client"</span> <span style="color: #0000ff;">ACTION</span> PRO3100<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#41;</span> ;<br />            TOOLTIP <span style="color: #ff0000;">"Client Editor"</span> <span style="color: #0000ff;">FONT</span> oBfont GROUP<br />        <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oReBar <span style="color: #0000ff;">RESOURCE</span> sBmp<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">PROMPT</span> sLbl<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ACTION</span> PRO3200<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#41;</span> ;<br />            TOOLTIP sLbl<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" Editor"</span> <span style="color: #0000ff;">FONT</span> oBfont<br /><br />            ....  Additional coded buttons <span style="color: #00C800;">continue</span> here<br /><br />        <span style="color: #B900B9;">// Activate the window</span><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> MainWinBckgrnd<span style="color: #000000;">&#40;</span> hDC, oWnd <span style="color: #000000;">&#41;</span>  <span style="color: #0000ff;">VALID</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Do you want to quit ? "</span>, <span style="color: #ff0000;">"Exiting "</span><span style="color: #000000;">&#41;</span> <br /> </div>[/code:3gemqrtd] From this main window, I call Dialogs which hide this button bar, then show it upon exiting. This is to keep clients from trying to activate the main buttons. These are the font definitions used in the above: DEFINE FONT oMfont NAME cSysFont SIZE 0,-12 BOLD DEFINE FONT oBfont NAME "Arial" SIZE 0,-10 BOLD
Button labels changing font size
Tim, Please replace this line: oWnd:oFont := oMfont with: oWnd:SetFont( oMfont ) as Fonts use (internal) counters to reuse them. If you assign it as you were doing it, the counter is not increased, but it is decreased when an object using the font ends, and then it reaches a point where you are instructing FWH to end the font too. The larger font you see is the system default font when yours is no longer valid.
Button labels changing font size
Thank you. Its working fine now.
Button labels changing font size
Well, I guess it is NOT working fine now. Here is the problem. If I simply open a dialog, then the error does not occur. HOWEVER, if I then set the focus to an xBrowse, and scroll down it, then leave the dialog, the problem appears. I checked the file carefully, and there is no re-definition of that font object. Tim
Button labels changing font size
Bumping this up ... it is still unresolved ( see last comment please ). Thanks !
Button labels changing font size
Tim, How do you create oMfont ?
Button labels changing font size
oMFont is declared as a Public in the MAIN() module It is set only once, and never changed, using: cSysFont := GetSysFont( ) DEFINE FONT oMfont NAME cSysFont SIZE 0,-12 BOLD All dialogs then have FONT oMFont in their statement. Tim
Button labels changing font size
Tim, Are you calling oMFont:End() somewhere in your code ? Class TFont objects use a counter, so they can be shared among several objects (dialogs, controls, etc). When the counter (cCount) reaches zero then the font is really released. If your font gets released (thats why it changes) then it means that there are extra calls to :End(). You can check MsgInfo( oMFont:nCount ) from some places in your code, to see if it keeps constant or decreases. As a workaround you can manualy increase it: oMFont:nCount += 5 // or any other value
Button labels changing font size
I will track that. Nope .. I don't issue oMfont:end() anywhere ... Thanks for the info. Tim
Button on a cell in xbrowse
Hi everyone I need to put a Button calling xAction on a cell in xBrowse I have an array like this 1 - Normal - DoNormal() 2 - Special - DoSpecial() 3.- Green - DoGreen() I need to put a button on 3rd column to call the action, Number of Items vary, names of actions also, I can control it with no problem, but I need to call the action thru a Button in the xBrowse Any help will be apreciated From Chile Adolfo
Button on a cell in xbrowse
This will give a buttun : [code=fw:1u0vf5ic]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   WITH OBJECT oData<br /><br />      WITH OBJECT :<span style="color: #000000;">oCol</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span><br />         :<span style="color: #000000;">nEditType</span>     := EDIT_GET_BUTTON<br />         :<span style="color: #000000;">bClrSel</span>          := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_HGRAY <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><br />         :<span style="color: #000000;">bEditBlock</span>    := <span style="color: #000000;">&#123;</span> |r,c,oCol| yourfunction<span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />      ENDWITH<br />      :<span style="color: #000000;">bClrEdits</span>        := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_YELLOW <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">bClrRowFocus</span>     := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">185</span>,<span style="color: #000000;">220</span>,<span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br /> </div>[/code:1u0vf5ic]
Button on a cell in xbrowse
[code=fw:3buekwif]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nEditType</span> := EDIT_BUTTON<br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">&#123;</span> |nRow,nCol,oCol,nKey| YourAction<span style="color: #000000;">&#40;</span> nRow, nCol, oCol, nKey <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:3buekwif] nRow,nCol: row and col of the click oCol : Column Object nKey : Key code if the action is triggered by pressing a key Return value of the codeblock: a) NIL: If the codeblock returns nil, XBrowse does not take any action on its own. b) uVal: If the codeblock returns any value other than nil, XBrowse assigns that value to the column and saves it. If the intention of the programmer is to modify the value of the column, the correct way is the return the new value and not to modify the value by the programmer himself. EDIT_BUTTON Vs EDIT_GET_BUTTON: EDIT_BUTTON: Only action possible by the user is to invoke the Action by clicking the button or pressing Enter EDIT_GET_BUTTON: User can either enter a value or click the button to invoke the action.
Button on a cell in xbrowse
Very good for option, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
Button on a cell in xbrowse
Thanks.. ...trying it
Button on the xbrowse column
Hi, all ! Can I put a button on the xbrowse column header ?
Button on the xbrowse column
You can put a bitmap though not a button. You can use bLClickHeader to check the key and take action
Button on the xbrowse column
Mr. Rao thank you for your help. Yes, the button on the column header (a la Excel) would be more convenient. But if this is not possible I will use bitmap
Button tooltips
Antonio Any progress on showing tooltips for buttons ? Thanks Richard
Button tooltips
Richard, We expect to have them ready for next build
Button transparency
The buttons on a gradient-brushed dialog have a outsided rectangle with the color from the 0,0 point of the dialog and shows not transparency. Any solution? [img:3u0pal5h]http&#58;//byte-one&#46;com/button&#46;jpg[/img:3u0pal5h]
Button transparency
Günther, there was a discussion some month ago, the conclusion was, as far as I can remember, that this is normal windows behavior. Some MS-programs show this effect too.
Button without focus
I need to create a button that appears the number in the Edit / Combo active (focus) and the focus remains on the Edit / As. For example button "1", When I click on this button will display the number 1 in the Edit / Combo active (Just like when using the keyboard Windows Mobile). thanks, Fabio Souza
Button without focus
Fabio, You can give the focus to any control doing: oControl:SetFocus() i.e.: oGet:SetFocus()
Button without focus
Hi Fabio, This might also help. I had to have a larger input screen for numbers in my application. The code below allows the user to click a number then the focus automatically switches to the next get. [code=fw:10yhwrf0]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> SixBorg<span style="color: #000000;">&#40;</span>nRecordNum<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> nBorg1:=<span style="color: #000000;">0</span>, nBorg2:=<span style="color: #000000;">0</span>, oBORG, oSayBorg, cBorgTitle, aBorgItems:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>, oCbx<br />   <span style="color: #00C800;">LOCAL</span> cBorg1:=<span style="color: #ff0000;">""</span>, cBorg2:=<span style="color: #ff0000;">""</span>, oGet1, oGet2, nGetFocus<br />   <span style="color: #0000ff;">Define</span> <span style="color: #0000ff;">Dialog</span> oBORG <span style="color: #0000ff;">from</span> <span style="color: #000000;">5</span>,<span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">26</span> <span style="color: #0000ff;">Title</span> <span style="color: #ff0000;">"Enter BORG"</span> <span style="color: #0000ff;">STYLE</span> nStyle<br />      @ <span style="color: #000000;">0.5</span>,<span style="color: #000000;">2</span>  <span style="color: #0000ff;">say</span> oSayBorg <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Dyspnea"</span> <span style="color: #0000ff;">of</span> oBorg <span style="color: #0000ff;">COLOR</span> RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>,RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">255</span>,<span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">25</span>,<span style="color: #000000;">10</span><br />      @ <span style="color: #000000;">0.5</span>,<span style="color: #000000;">9</span>  <span style="color: #0000ff;">say</span> oSayBorg <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Fatigue"</span> <span style="color: #0000ff;">of</span> oBorg <span style="color: #0000ff;">COLOR</span> RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>,RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">255</span>,<span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span>   <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">25</span>,<span style="color: #000000;">10</span><br />      @ <span style="color: #000000;">1.5</span>,<span style="color: #000000;">2</span> <span style="color: #0000ff;">Get</span> oGet1 <span style="color: #0000ff;">var</span> nBORG1 <span style="color: #0000ff;">of</span> oBORG <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99.9"</span> <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span>nGetFocus :=<span style="color: #000000;">1</span>,.t.<span style="color: #000000;">&#41;</span><br />      @ <span style="color: #000000;">1.5</span>,<span style="color: #000000;">7</span> <span style="color: #0000ff;">Get</span> oGet2 <span style="color: #0000ff;">var</span> nBORG2 <span style="color: #0000ff;">of</span> oBORG <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99.9"</span> <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span>nGetFocus :=<span style="color: #000000;">2</span>,.t.<span style="color: #000000;">&#41;</span><br />        <br />        @ <span style="color: #000000;">3</span>,<span style="color: #000000;">1</span>   <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"0"</span>   <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> iif<span style="color: #000000;">&#40;</span>nGetFocus=<span style="color: #000000;">1</span>,<span style="color: #000000;">&#40;</span>nBorg1:=<span style="color: #000000;">0</span>,oGet2:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>nBorg2:=<span style="color: #000000;">0</span>,oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,oBorg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        @ <span style="color: #000000;">3</span>,<span style="color: #000000;">5</span>   <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"0.5"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> iif<span style="color: #000000;">&#40;</span>nGetFocus=<span style="color: #000000;">1</span>,<span style="color: #000000;">&#40;</span>nBorg1:=<span style="color: #000000;">0.5</span>,oGet2:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>nBorg2:=<span style="color: #000000;">0.5</span>,oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,oBorg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        @ <span style="color: #000000;">3</span>,<span style="color: #000000;">9</span>   <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"1"</span>   <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> iif<span style="color: #000000;">&#40;</span>nGetFocus=<span style="color: #000000;">1</span>,<span style="color: #000000;">&#40;</span>nBorg1:=<span style="color: #000000;">1</span>,oGet2:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>nBorg2:=<span style="color: #000000;">1</span>,oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,oBorg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        @ <span style="color: #000000;">3</span>,<span style="color: #000000;">13</span>  <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"2"</span>   <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> iif<span style="color: #000000;">&#40;</span>nGetFocus=<span style="color: #000000;">1</span>,<span style="color: #000000;">&#40;</span>nBorg1:=<span style="color: #000000;">2</span>,oGet2:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>nBorg2:=<span style="color: #000000;">2</span>,oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,oBorg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />        @ <span style="color: #000000;">3.9</span>,<span style="color: #000000;">1</span>  <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"3"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> iif<span style="color: #000000;">&#40;</span>nGetFocus=<span style="color: #000000;">1</span>,<span style="color: #000000;">&#40;</span>nBorg1:=<span style="color: #000000;">3</span>,oGet2:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>nBorg2:=<span style="color: #000000;">3</span>,oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,oBorg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        @ <span style="color: #000000;">3.9</span>,<span style="color: #000000;">5</span>  <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"4"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> iif<span style="color: #000000;">&#40;</span>nGetFocus=<span style="color: #000000;">1</span>,<span style="color: #000000;">&#40;</span>nBorg1:=<span style="color: #000000;">4</span>,oGet2:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>nBorg2:=<span style="color: #000000;">4</span>,oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,oBorg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        @ <span style="color: #000000;">3.9</span>,<span style="color: #000000;">9</span>  <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"5"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> iif<span style="color: #000000;">&#40;</span>nGetFocus=<span style="color: #000000;">1</span>,<span style="color: #000000;">&#40;</span>nBorg1:=<span style="color: #000000;">5</span>,oGet2:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>nBorg2:=<span style="color: #000000;">5</span>,oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,oBorg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        @ <span style="color: #000000;">3.9</span>,<span style="color: #000000;">13</span> <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"6"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> iif<span style="color: #000000;">&#40;</span>nGetFocus=<span style="color: #000000;">1</span>,<span style="color: #000000;">&#40;</span>nBorg1:=<span style="color: #000000;">6</span>,oGet2:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>nBorg2:=<span style="color: #000000;">6</span>,oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,oBorg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />        @ <span style="color: #000000;">4.9</span>,<span style="color: #000000;">1</span>  <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"7"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> iif<span style="color: #000000;">&#40;</span>nGetFocus=<span style="color: #000000;">1</span>,<span style="color: #000000;">&#40;</span>nBorg1:=<span style="color: #000000;">7</span>,oGet2:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>nBorg2:=<span style="color: #000000;">7</span>,oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,oBorg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        @ <span style="color: #000000;">4.9</span>,<span style="color: #000000;">5</span>  <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"8"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> iif<span style="color: #000000;">&#40;</span>nGetFocus=<span style="color: #000000;">1</span>,<span style="color: #000000;">&#40;</span>nBorg1:=<span style="color: #000000;">8</span>,oGet2:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>nBorg2:=<span style="color: #000000;">8</span>,oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,oBorg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        @ <span style="color: #000000;">4.9</span>,<span style="color: #000000;">9</span>  <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"9"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> iif<span style="color: #000000;">&#40;</span>nGetFocus=<span style="color: #000000;">1</span>,<span style="color: #000000;">&#40;</span>nBorg1:=<span style="color: #000000;">9</span>,oGet2:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>nBorg2:=<span style="color: #000000;">9</span>,oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,oBorg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />        @ <span style="color: #000000;">4.9</span>,<span style="color: #000000;">13</span> <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"10"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">Action</span> <span style="color: #000000;">&#40;</span> iif<span style="color: #000000;">&#40;</span>nGetFocus=<span style="color: #000000;">1</span>,<span style="color: #000000;">&#40;</span>nBorg1:=<span style="color: #000000;">10</span>,oGet2:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>nBorg2:=<span style="color: #000000;">10</span>,oGet1:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,oBorg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />      @ <span style="color: #000000;">2</span>,<span style="color: #000000;">6</span>   <span style="color: #0000ff;">BUTTON</span> oBtnBorgOK <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"OK"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">25</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">of</span> oBORG <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>UpdateSixBORG<span style="color: #000000;">&#40;</span>nRecordNum, nBorg1, nBorg2<span style="color: #000000;">&#41;</span>,oBORG:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />      oBORG:<span style="color: #0000ff;">Center</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">Activate</span> <span style="color: #0000ff;">Dialog</span> oBORG NOMODAL<br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /> </div>[/code:10yhwrf0]
Button without focus
After searching the forum I found two solutions The first is using a fake __keyboard and the other is manipulating the data with a function. See below: First Solution with a "fake" __keyboard(): [code=fw:1nwuerwc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> oFocusGet<br /><br /><span style="color: #000000;">&#40;</span>...<span style="color: #000000;">&#41;</span><br /><br />@ <span style="color: #000000;">14</span>,<span style="color: #000000;">02</span> <span style="color: #0000ff;">Say</span> <span style="color: #ff0000;">"Prod:"</span> <span style="color: #0000ff;">OF</span> oWndProdutos <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">7.5</span> <span style="color: #0000ff;">PIXEL</span><br />@ <span style="color: #000000;">13</span>,<span style="color: #000000;">17</span> <span style="color: #0000ff;">GET</span> oGetProduto <span style="color: #0000ff;">VAR</span> cProduto <span style="color: #0000ff;">OF</span> oWndProdutos PICT <span style="color: #ff0000;">"@!"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">38</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span><br />oGetProduto:<span style="color: #000000;">bGotFocus</span>  := <span style="color: #000000;">&#123;</span>|| oFocusGet := oGetProduto <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #000000;">&#40;</span>...<span style="color: #000000;">&#41;</span><br /><br />@ <span style="color: #000000;">36.5</span>,<span style="color: #000000;">01</span> <span style="color: #0000ff;">BUTTON</span> oBtn1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"1"</span> <span style="color: #0000ff;">OF</span> oWndProdutos <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">13</span>,<span style="color: #000000;">11</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oFocusGet:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, SetStateKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">49</span>, .T.<span style="color: #000000;">&#41;</span>, SetStateKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">49</span>, .F.<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />@ <span style="color: #000000;">36.5</span>,<span style="color: #000000;">16</span> <span style="color: #0000ff;">BUTTON</span> oBtn2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"2"</span> <span style="color: #0000ff;">OF</span> oWndProdutos <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">13</span>,<span style="color: #000000;">11</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oFocusGet:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, SetStateKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">49</span>, .T.<span style="color: #000000;">&#41;</span>, SetStateKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">49</span>, .F.<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />@ <span style="color: #000000;">36.5</span>,<span style="color: #000000;">31</span> <span style="color: #0000ff;">BUTTON</span> oBtn2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"3"</span> <span style="color: #0000ff;">OF</span> oWndProdutos <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">13</span>,<span style="color: #000000;">11</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oFocusGet:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, SetStateKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">51</span>, .T.<span style="color: #000000;">&#41;</span>, SetStateKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">49</span>, .F.<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #000000;">&#40;</span>...<span style="color: #000000;">&#41;</span><br /><br />@ <span style="color: #000000;">49</span>,<span style="color: #000000;">91</span>  <span style="color: #0000ff;">BUTTON</span> oBtnBack <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"<-"</span> <span style="color: #0000ff;">OF</span> oWndProdutos <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">13</span>,<span style="color: #000000;">11</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oGetProduto:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, SetStateKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">8</span>, .T.<span style="color: #000000;">&#41;</span>, SetStateKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">8</span>, .F.<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />*************************<br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <aygshell.h><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> SETSTATEKEY <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />  <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> hb_parl<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      keybd_event<span style="color: #000000;">&#40;</span> hb_parvnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, 0x45, KEYEVENTF_EXTENDEDKEY | <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>;<br />  <span style="color: #00C800;">else</span><br />      keybd_event<span style="color: #000000;">&#40;</span> hb_parvnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:1nwuerwc] The Second Solution using a Function: [code=fw:1nwuerwc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> oFocusGet<br /><br /><span style="color: #000000;">&#40;</span>...<span style="color: #000000;">&#41;</span><br /><br />@ <span style="color: #000000;">14</span>,<span style="color: #000000;">02</span> <span style="color: #0000ff;">Say</span> <span style="color: #ff0000;">"Prod:"</span> <span style="color: #0000ff;">OF</span> oWndProdutos <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">7.5</span> <span style="color: #0000ff;">PIXEL</span><br />@ <span style="color: #000000;">13</span>,<span style="color: #000000;">17</span> <span style="color: #0000ff;">GET</span> oGetProduto <span style="color: #0000ff;">VAR</span> cProduto <span style="color: #0000ff;">OF</span> oWndProdutos PICT <span style="color: #ff0000;">"@!"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">38</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span><br />oGetProduto:<span style="color: #000000;">bGotFocus</span>  := <span style="color: #000000;">&#123;</span>|| oFocusGet := oGetProduto <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #000000;">&#40;</span>...<span style="color: #000000;">&#41;</span><br /><br />@ <span style="color: #000000;">36.5</span>,<span style="color: #000000;">01</span> <span style="color: #0000ff;">BUTTON</span> oBtn1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"1"</span> <span style="color: #0000ff;">OF</span> oWndProdutos <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">13</span>,<span style="color: #000000;">11</span> <span style="color: #0000ff;">ACTION</span> DigVal<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">&#41;</span> <br />@ <span style="color: #000000;">36.5</span>,<span style="color: #000000;">16</span> <span style="color: #0000ff;">BUTTON</span> oBtn2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"2"</span> <span style="color: #0000ff;">OF</span> oWndProdutos <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">13</span>,<span style="color: #000000;">11</span> <span style="color: #0000ff;">ACTION</span> DigVal<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"2"</span><span style="color: #000000;">&#41;</span><br />@ <span style="color: #000000;">36.5</span>,<span style="color: #000000;">31</span> <span style="color: #0000ff;">BUTTON</span> oBtn2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"3"</span> <span style="color: #0000ff;">OF</span> oWndProdutos <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">13</span>,<span style="color: #000000;">11</span> <span style="color: #0000ff;">ACTION</span> DigVal<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"3"</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #000000;">&#40;</span>...<span style="color: #000000;">&#41;</span><br /><br />@ <span style="color: #000000;">49</span>,<span style="color: #000000;">91</span>  <span style="color: #0000ff;">BUTTON</span> oBtnBack <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"<-"</span> <span style="color: #0000ff;">OF</span> oWndProdutos <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">13</span>,<span style="color: #000000;">11</span> <span style="color: #0000ff;">ACTION</span> DigVal<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"<"</span><span style="color: #000000;">&#41;</span> <br /><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> DigVal<span style="color: #000000;">&#40;</span>cValor<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> cBuffer <br /><br /> cBuffer := Alltrim<span style="color: #000000;">&#40;</span>oGetFocus:<span style="color: #000000;">cText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /> <span style="color: #00C800;">If</span> cValor == <span style="color: #ff0000;">"<"</span>  <span style="color: #B900B9;">//Delete</span><br />    cBuffer := Alltrim<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">Substr</span><span style="color: #000000;">&#40;</span>cBuffer, <span style="color: #000000;">1</span>, oFocusGet:<span style="color: #000000;">nPos</span> <span style="color: #000000;">-2</span><span style="color: #000000;">&#41;</span> + <span style="color: #0000ff;">Substr</span><span style="color: #000000;">&#40;</span>cBuffer, oFocusGet:<span style="color: #000000;">nPos</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /> <span style="color: #00C800;">Else</span><br />   cBuffer += cValor<br /> <span style="color: #00C800;">Endif</span><br /><br /> oGetFocus:<span style="color: #000000;">cText</span><span style="color: #000000;">&#40;</span>cBuffer<span style="color: #000000;">&#41;</span><br /> oGetFocus:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> .T.<br /> </div>[/code:1nwuerwc] Best Regards, Fabio Souza
Button-Actions added to new Class VTitle FWH 9.07
Hello, I started with the new Vtitle-Class and added Button-Actions : [img:1vfnnxan]http&#58;//www&#46;pflegeplus&#46;com/pictures/Vtitle10&#46;jpg[/img:1vfnnxan] As a Standard, it is not included. I used [color=#FF0000:1vfnnxan]oTitle:bLDblClick[/color:1vfnnxan] from TControl and selected the 4 Positions ( Top, Left, Right, Bottom ) of the different Images. How it works : I know the Click-Position < nRow > and < nCol > Next scanning the Images and check if the Click-Position is inside the Image-Area. If YES, I start a Action for this Button. The working Function with all Image-Values I need for the Calculation : [code=fw:1vfnnxan]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> BTN_ACTION<span style="color: #000000;">&#40;</span> nRow, nCol, oTitle, oDlg <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> nAt, aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br /><br /><span style="color: #B900B9;">// Scanning all Images of the Title and saving the Values to a Array</span><br /><span style="color: #B900B9;">// ---------------------------------------------------------------------------</span><br /><span style="color: #00C800;">FUNCTION</span> BTN_ACTION<span style="color: #000000;">&#40;</span> nRow, nCol, oTitle, oDlg <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> nAt, aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br /><br /><span style="color: #00C800;">FOR</span> nAt := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #B900B9;">// Img-Height</span><br />   aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := nBmpHeight<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span><span style="color: #000000;">&#91;</span> nAt, 0x03 <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #B900B9;">// Img-Width</span><br />   aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> := nBmpWidth<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span><span style="color: #000000;">&#91;</span> nAt, 0x03 <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <br />   <span style="color: #B900B9;">// Img-Top</span><br />   aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> := oTitle:<span style="color: #000000;">aImgs</span><span style="color: #000000;">&#91;</span> nAt, 0x01 <span style="color: #000000;">&#93;</span><br />   <span style="color: #B900B9;">// Img-Left</span><br />   aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> := oTitle:<span style="color: #000000;">aImgs</span><span style="color: #000000;">&#91;</span> nAt, 0x02 <span style="color: #000000;">&#93;</span> <span style="color: #B900B9;">// Img-Left</span><br /><br />   <span style="color: #B900B9;">// only for Tests</span><br />   <span style="color: #B900B9;">// msgalert( aPOS[Len( oTitle:aImgs )][1], LTRIM(STR(nAt)) + " Height" )</span><br />   <span style="color: #B900B9;">// msgalert( aPOS[Len( oTitle:aImgs )][2], LTRIM(STR(nAt)) + " Width" )</span><br />   <span style="color: #B900B9;">// msgalert( aPOS[Len( oTitle:aImgs )][3], LTRIM(STR(nAt)) + " Top" )</span><br />   <span style="color: #B900B9;">// msgalert( aPOS[Len( oTitle:aImgs )][4], LTRIM(STR(nAt)) + " Left" )</span><br /><br />   <span style="color: #00C800;">IF</span> aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <= nRow .and. ; <span style="color: #B900B9;">// Top <= Row-Click</span><br />      aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> + aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> >= nRow .and. ; <span style="color: #B900B9;">// Top + Height > Row-Click</span><br />      aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> <= nCol .and. ;  <span style="color: #B900B9;">// Left <= Row-Click</span><br />      aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> + aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> >= nCol <span style="color: #B900B9;">// Left + Width > Col-Click</span><br />      MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"I am Button : "</span> + LTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>nAt<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">"Attention"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">NEXT</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:1vfnnxan] Working with the Function : [code=fw:1vfnnxan]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> TEST_TITLE<span style="color: #000000;">&#40;</span>oWnd,oBrush1,oFont1<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> oDlg, oTitle, hDC, oButt1<br /><br />aDLG := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.60</span>, <span style="color: #000000;">16752190</span>, <span style="color: #000000;">16777215</span> <span style="color: #000000;">&#125;</span>, ;  <br />                 <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.60</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">16752190</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>    <br /><br />nMainStyle = nOR<span style="color: #000000;">&#40;</span> WS_OVERLAPPED | WS_VISIBLE <span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">15</span>, <span style="color: #000000;">15</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">320</span>, <span style="color: #000000;">580</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">PIXEL</span> <br /><br />@ <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span>  <span style="color: #0000ff;">TITLE</span> oTitle <span style="color: #0000ff;">size</span> <span style="color: #000000;">242</span>, <span style="color: #000000;">115</span> <span style="color: #0000ff;">of</span> oDlg SHADOW BOTTOMLEFT SHADOWSIZE <span style="color: #000000;">10</span><br /><br />oTitle:<span style="color: #000000;">aGrdBack</span> := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">8553215</span>, <span style="color: #000000;">16777215</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />*oTitle:<span style="color: #000000;">lTransparent</span> := .T.<br /><br />@  <span style="color: #000000;">20</span>, <span style="color: #000000;">60</span>  TITLETEXT <span style="color: #0000ff;">OF</span> oTitle <span style="color: #0000ff;">TEXT</span> <span style="color: #ff0000;">"FIVEWIN 9.07"</span>  <span style="color: #0000ff;">FONT</span> oFont1 <span style="color: #0000ff;">BRUSH</span> oBrush1<br /><br />@  <span style="color: #000000;">85</span>, <span style="color: #000000;">40</span> TITLEIMG <span style="color: #0000ff;">OF</span> oTitle BITMAP <span style="color: #ff0000;">"explorer.BMP"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">50</span> REFLEX ANIMA<br /><br />@  <span style="color: #000000;">85</span>, <span style="color: #000000;">140</span> TITLEIMG <span style="color: #0000ff;">OF</span> oTitle BITMAP <span style="color: #ff0000;">"keys.bmp"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>, <span style="color: #000000;">30</span> REFLEX TRANSPARENT <br /><br />@  <span style="color: #000000;">85</span>,  <span style="color: #000000;">240</span> TITLEIMG <span style="color: #0000ff;">OF</span> oTitle BITMAP <span style="color: #ff0000;">"explorer.BMP"</span>    <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">50</span> ANIMA LEVEL <span style="color: #000000;">100</span><br /><br />@  <span style="color: #000000;">85</span>, <span style="color: #000000;">340</span>  TITLEIMG  <span style="color: #0000ff;">OF</span> oTitle BITMAP <span style="color: #ff0000;">"explorer.bmp"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">50</span> REFLEX TRANSPARENT ANIMA<br /><br />oTitle:<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">&#123;</span> | nRow, nCol | BTN_ACTION<span style="color: #000000;">&#40;</span> nRow, nCol, oDlg <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />oTitle:<span style="color: #000000;">nShadowIntensity</span> = <span style="color: #000000;">70</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;">ON</span> <span style="color: #0000ff;">INIT</span> DLG_GRAD<span style="color: #000000;">&#40;</span> oDlg, .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// -------------  DIALOG-GRADIENT for transparent SAY  -------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> DLG_GRAD<span style="color: #000000;">&#40;</span> oDlg, lDir<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> hDC, hBmp, hBmpOld, nWidth, nHeight, oBrush<br /><br /><span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span><br />      nHeight := <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>lDir,oDlg:<span style="color: #000000;">nHeight</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />      nWidth  := <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>lDir,<span style="color: #000000;">1</span>,oDlg:<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#41;</span><br />       hDC = CreateCompatibleDC<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      hBmp = CreateCompatibleBitMap<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hDC</span>, nWidth, nHeight <span style="color: #000000;">&#41;</span><br />      hBmpOld = SelectObject<span style="color: #000000;">&#40;</span> hDC, hBmp <span style="color: #000000;">&#41;</span><br />      GradientFill<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, nHeight, nWidth, aDLG, lDir <span style="color: #000000;">&#41;</span><br />      DeleteObject<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />      oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> = hBmp<br />      oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> = CreatePatternBrush<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />      SelectObject<span style="color: #000000;">&#40;</span> hDC, hBmpOld <span style="color: #000000;">&#41;</span><br />      oDlg:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:1vfnnxan] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Button-Actions added to new Class VTitle FWH 9.07
I tested Titles with different Dialog-Backgrounds. There seems to be a Shadow-problem with Image-Background. All other Backgrounds are working. [img:ttqpjhp0]http&#58;//www&#46;pflegeplus&#46;com/pictures/Vtitle11&#46;jpg[/img:ttqpjhp0] Best regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Button-Actions added to new Class VTitle FWH 9.07
Uwe, Nice contribution <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> We should implement it as a new method of the Class TTitle We are going to check the shadow issue, thanks
Button-Actions added to new Class VTitle FWH 9.07
Antonio, Can Give you an idea ? I made on my Painttitle class also animation bitmaps.....
Button-Actions added to new Class VTitle FWH 9.07
Antonio, all Tests with [color=#FF0000:3l3c8mr0]oTitle:lTransparent := .T.[/color:3l3c8mr0] Image-Background : [img:3l3c8mr0]http&#58;//www&#46;pflegeplus&#46;com/pictures/vtitle12&#46;jpg[/img:3l3c8mr0] Testing all possible Combinations : [code=fw:3l3c8mr0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> START_DLG<span style="color: #000000;">&#40;</span>oWnd,oBrush1,oFont1<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> oDlg, oTitle, hDC, oButt1<br /><br />aDLG := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.60</span>, <span style="color: #000000;">16752190</span>, <span style="color: #000000;">16777215</span> <span style="color: #000000;">&#125;</span>, ;  <br />                 <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.60</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">16752190</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>    <br /><br />nMainStyle = nOR<span style="color: #000000;">&#40;</span> WS_OVERLAPPED | WS_VISIBLE <span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">15</span>, <span style="color: #000000;">15</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">320</span>, <span style="color: #000000;">580</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">STYLE</span> nMainStyle <span style="color: #0000ff;">PIXEL</span> TRANSPARENT<br /><br /><span style="color: #B900B9;">// Select the needed Background</span><br /><span style="color: #B900B9;">// --------------------------------------</span><br /><span style="color: #B900B9;">// D_COLOR( oDlg )   // Color</span><br /><span style="color: #B900B9;">// DB_IMAGE( oDlg )  // Image-Brush</span><br /><span style="color: #B900B9;">// D_BRUSH( oDlg )   // Style-Brush</span><br /><br />@ <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span>  <span style="color: #0000ff;">TITLE</span> oTitle <span style="color: #0000ff;">size</span> <span style="color: #000000;">242</span>, <span style="color: #000000;">115</span> <span style="color: #0000ff;">of</span> oDlg SHADOW BOTTOMLEFT SHADOWSIZE <span style="color: #000000;">10</span><br /><br />oTitle:<span style="color: #000000;">aGrdBack</span> := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">8553215</span>, <span style="color: #000000;">16777215</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />oTitle:<span style="color: #000000;">lTransparent</span> := .T.<br /><br />@  <span style="color: #000000;">20</span>, <span style="color: #000000;">60</span>  TITLETEXT <span style="color: #0000ff;">OF</span> oTitle <span style="color: #0000ff;">TEXT</span> <span style="color: #ff0000;">"FIVEWIN 9.07"</span>  <span style="color: #0000ff;">FONT</span> oFont1 <span style="color: #0000ff;">BRUSH</span> oBrush1<br /><br />@  <span style="color: #000000;">85</span>, <span style="color: #000000;">40</span> TITLEIMG <span style="color: #0000ff;">OF</span> oTitle BITMAP <span style="color: #ff0000;">"explorer.BMP"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">50</span> REFLEX ANIMA<br /><br />@  <span style="color: #000000;">85</span>, <span style="color: #000000;">140</span> TITLEIMG <span style="color: #0000ff;">OF</span> oTitle BITMAP <span style="color: #ff0000;">"keys.bmp"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>, <span style="color: #000000;">30</span> REFLEX TRANSPARENT <br /><br />@  <span style="color: #000000;">85</span>,  <span style="color: #000000;">240</span> TITLEIMG <span style="color: #0000ff;">OF</span> oTitle BITMAP <span style="color: #ff0000;">"explorer.BMP"</span>    <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">50</span> ANIMA LEVEL <span style="color: #000000;">100</span><br /><br />@  <span style="color: #000000;">85</span>, <span style="color: #000000;">340</span>  TITLEIMG  <span style="color: #0000ff;">OF</span> oTitle BITMAP <span style="color: #ff0000;">"explorer.bmp"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">50</span> REFLEX TRANSPARENT ANIMA<br /><br />oTitle:<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">&#123;</span> | nRow, nCol | BTN_ACTION<span style="color: #000000;">&#40;</span> nRow, nCol, oTitle, oDlg <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />oTitle:<span style="color: #000000;">nShadowIntensity</span> = <span style="color: #000000;">70</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;">ON</span> <span style="color: #0000ff;">PAINT</span> DL_IMAGE<span style="color: #000000;">&#40;</span> hDC, oDlg<span style="color: #000000;">&#41;</span><br /><br />*<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> DLG_GRAD<span style="color: #000000;">&#40;</span> oDlg, .T. <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Gradient</span><br />*<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> DL_IMAGE<span style="color: #000000;">&#40;</span> hDC, oDlg<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Image</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #B900B9;">// --------- DIALOG COLOR --------------------------------------</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> D_COLOR<span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oNewbrush<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oNewBrush <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">128</span><br />SET <span style="color: #0000ff;">BRUSH</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TO</span> oNewBrush<br /><span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">BRUSH</span> oNewbrush<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//---------- DIALOG IMAGE ----------------------- </span><br /><br /><span style="color: #00C800;">FUNCTION</span> DL_IMAGE<span style="color: #000000;">&#40;</span> hDC, oDlg <span style="color: #000000;">&#41;</span> <br /><span style="color: #00C800;">LOCAL</span> oImage<br /><br />aRect := GETCLIENTRECT<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />@ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">IMAGE</span> oImage <span style="color: #0000ff;">SIZE</span> aRect<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>, aRect<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ADJUST</span><br />oImage:<span style="color: #0000ff;">Progress</span><span style="color: #000000;">&#40;</span> .f. <span style="color: #000000;">&#41;</span><br />oImage:<span style="color: #000000;">LoadBmp</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"FANTASY.jpg"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//------- DIALOG IMAGE-Brush -------------------------- </span><br /><br /><span style="color: #00C800;">FUNCTION</span> DB_IMAGE<span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span> <br /><span style="color: #00C800;">LOCAL</span> oImage<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oImage FILE <span style="color: #ff0000;">"Paper.bmp"</span><br />SET <span style="color: #0000ff;">BRUSH</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">TO</span> oImage<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//------ DIALOG STYLE-Brush --------------------------- </span><br /><br /><span style="color: #00C800;">FUNCTION</span> D_BRUSH<span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span> <br /><span style="color: #00C800;">LOCAL</span> oBrush1<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush1  <span style="color: #0000ff;">STYLE</span> <span style="color: #ff0000;">"TILED"</span>      <br />SET <span style="color: #0000ff;">BRUSH</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">TO</span> oBrush1<br /><span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">BRUSH</span> oBrush1<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// &nbsp;------------- &nbsp;normal DIALOG-GRADIENT -------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> DLG_GRAD1<span style="color: #000000;">&#40;</span> oDlg, hDC <span style="color: #000000;">&#41;</span><br /><br />GradientFill<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, oDlg:<span style="color: #000000;">nHeight</span>, oDlg:<span style="color: #000000;">nWidth</span>, aDLG, .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> &nbsp;<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// ------------- &nbsp;DIALOG-GRADIENT for transparent SAY &nbsp;-------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> DLG_GRAD<span style="color: #000000;">&#40;</span> oDlg, lDir<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> hDC, hBmp, hBmpOld, nWidth, nHeight, oBrush<br /><br /><span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nHeight := <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>lDir,oDlg:<span style="color: #000000;">nHeight</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nWidth &nbsp;:= <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>lDir,<span style="color: #000000;">1</span>,oDlg:<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;hDC = CreateCompatibleDC<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; hBmp = CreateCompatibleBitMap<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hDC</span>, nWidth, nHeight <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; hBmpOld = SelectObject<span style="color: #000000;">&#40;</span> hDC, hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; GradientFill<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, nHeight, nWidth, aDLG, lDir <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DeleteObject<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> = hBmp<br />&nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> = CreatePatternBrush<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; SelectObject<span style="color: #000000;">&#40;</span> hDC, hBmpOld <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// ----------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> BTN_ACTION<span style="color: #000000;">&#40;</span> nRow, nCol, oTitle, oDlg <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> nAt, aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br /><br /><span style="color: #00C800;">FOR</span> nAt := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #B900B9;">// Img-Height</span><br />   aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := nBmpHeight<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span><span style="color: #000000;">&#91;</span> nAt, 0x03 <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #B900B9;">// Img-Width</span><br />   aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> := nBmpWidth<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span><span style="color: #000000;">&#91;</span> nAt, 0x03 <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <br />   <span style="color: #B900B9;">// Img-Top</span><br />   aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> := oTitle:<span style="color: #000000;">aImgs</span><span style="color: #000000;">&#91;</span> nAt, 0x01 <span style="color: #000000;">&#93;</span><br />   <span style="color: #B900B9;">// Img-Left</span><br />   aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> := oTitle:<span style="color: #000000;">aImgs</span><span style="color: #000000;">&#91;</span> nAt, 0x02 <span style="color: #000000;">&#93;</span> <span style="color: #B900B9;">// Img-Left</span><br /><br />   <span style="color: #B900B9;">// msgalert( aPOS[Len( oTitle:aImgs )][1], LTRIM(STR(nAt)) + " Height" )</span><br />   <span style="color: #B900B9;">// msgalert( aPOS[Len( oTitle:aImgs )][2], LTRIM(STR(nAt)) + " Width" )</span><br />   <span style="color: #B900B9;">// msgalert( aPOS[Len( oTitle:aImgs )][3], LTRIM(STR(nAt)) + " Top" )</span><br />   <span style="color: #B900B9;">// msgalert( aPOS[Len( oTitle:aImgs )][4], LTRIM(STR(nAt)) + " Left" )</span><br /><br />   <span style="color: #00C800;">IF</span> aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <= nRow .and. ; <span style="color: #B900B9;">// Top <= Row-Click</span><br />      aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> + aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> >= nRow .and. ; <span style="color: #B900B9;">// Top + Height > Row-Click</span><br />      aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> <= nCol .and. ;  <span style="color: #B900B9;">// Left <= Row-Click</span><br />      aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> + aPOS<span style="color: #000000;">&#91;</span>Len<span style="color: #000000;">&#40;</span> oTitle:<span style="color: #000000;">aImgs</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> >= nCol <span style="color: #B900B9;">// Left + Width > Col-Click</span><br />      MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"I am Button : "</span> + LTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>nAt<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">"Attention"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">NEXT</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:3l3c8mr0] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Button-Actions added to new Class VTitle FWH 9.07
Hello Uwe... i think that it is correct way we need convert image to brush [code=fw:8md7xb8y]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> DL_IMAGE<span style="color: #000000;">&#40;</span> hDC, oDlg <span style="color: #000000;">&#41;</span> <br /><span style="color: #00C800;">LOCAL</span> oImage<br /><br />aRect := GETCLIENTRECT<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oImage FILE <span style="color: #ff0000;">"C:<span style="color: #000000;">\F</span>WH<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>lga1.jpg"</span><br />SET <span style="color: #0000ff;">BRUSH</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">TO</span> oImage:<span style="color: #000000;">Resized</span><span style="color: #000000;">&#40;</span> aRect<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>, aRect<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:8md7xb8y] I changed resize function at TBrush Class... ResizeBmp to ResizeImg( hBmp, nWidth, nHeight ) This function show better image quality [img:8md7xb8y]http&#58;//www&#46;sitasoft&#46;com/fivewin/screen/ttrasn1&#46;png[/img:8md7xb8y]
Button-Actions added to new Class VTitle FWH 9.07
[quote="ukoenig":3g2a7oux]I tested Titles with different Dialog-Backgrounds. There seems to be a Shadow-problem with Image-Background. All other Backgrounds are working. [img:3g2a7oux]http&#58;//www&#46;pflegeplus&#46;com/pictures/Vtitle11&#46;jpg[/img:3g2a7oux] Best regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->[/quote:3g2a7oux] Like a previous post... [img:3g2a7oux]http&#58;//www&#46;sitasoft&#46;com/fivewin/screen/ttrasn2&#46;png[/img:3g2a7oux]
Button-Text not adjusted to BMP (TEXTRIGHT) ?
Hello, I noticed, using : REDEFINE BUTTONBMP oBtn1 ID 110 OF oFld:aDialogs[1] ; ACTION MsgAlert("Test" ) ; BITMAP aPICTURES[1][3] PROMPT aBTNTEXT[1][1] [color=#FF0000:2agipd9n]TEXTRIGHT[/color:2agipd9n] oBtn1:cToolTip = { "TButtonBMP","Test", 1, CLR_BLACK, 14089979 } oBtn1:oFont := oTextFont the Button-Text is not adjusted in Relation to the included BMP, always centered. As long the Buttontext is short in Relation to the Buttonwidth, there is no Problem. To make it working, I have to add some left Spaces. I think using < TEXTRIGHT >, the left Start-Text-Position must be calculated with the BMP:nWidth() + some Space. ( always centered ) [img:2agipd9n]http&#58;//www&#46;pflegeplus&#46;com/pictures/textadjust&#46;jpg[/img:2agipd9n] Best Regards uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Button-group RADIO-style
Hello, I needed a button-group that works like radios. The position of the selected button is saved to a INI. After a new start, the saved button shows the status ( selected image ). That all works like a radio, but with a visual-effect. The result : [b:1x3999tq]A color selection[/b:1x3999tq] [img:1x3999tq]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/RBtn1&#46;jpg[/img:1x3999tq] [b:1x3999tq]selecting a new color the image changes on focus[/b:1x3999tq] [img:1x3999tq]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/RBtn2&#46;jpg[/img:1x3999tq] [b:1x3999tq]the new selected color the old selected button ( white ) restores the image[/b:1x3999tq] [img:1x3999tq]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/RBtn3&#46;jpg[/img:1x3999tq] best regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Button-group RADIO-style
Uwe, You could use a group of TBitmap controls and keep track of all them using an array. But not sure if you can make a TBitmap control paint as a circle. have you ever tried it ? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Button-group RADIO-style
Antonio, thank You for the info, I will have a closer look at this solution and tell about the result. best regards Uwe <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Button-group RADIO-style
[code=fw:4wsxyq23]<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;">#define</span> SRCCOPY      0x00CC0020<br /><br /><span style="color: #00C800;">static</span> oBmp, nSelect := <span style="color: #000000;">2</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oWnd, oBrush, n<br />   <span style="color: #00C800;">local</span> aBtn<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span><br />   <span style="color: #00C800;">local</span> aClr := <span style="color: #000000;">&#123;</span> CLR_YELLOW, CLR_HRED, CLR_GREEN, CLR_HBLUE <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> BITMAP oBmp   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;">\y</span>es2.bmp"</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span>  oBrush FILE <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>lga1.jpg"</span> RESIZE<br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd  <span style="color: #0000ff;">BRUSH</span> oBrush<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;">4</span><br />      @ <span style="color: #000000;">-48</span> + n * <span style="color: #000000;">64</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">BTNBMP</span> aBtn<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">64</span>,<span style="color: #000000;">64</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd NOBORDER TRANSPARENT <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> nSelect := ::<span style="color: #000000;">Cargo</span>, oWnd:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      aBtn<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> CLR_BLACK, aClr<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />      aBtn<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Cargo</span> := n<br />      aBtn<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bPainted</span> := <span style="color: #000000;">&#123;</span> |hDC,hPS,oBtn| BmpPaint<span style="color: #000000;">&#40;</span> hDC, oBtn <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">next</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">CENTERED</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">BRUSH</span> oBrush<br />   oBmp:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> BmpPaint<span style="color: #000000;">&#40;</span> hDC, oBtn <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> hBrush    := CreateSolidBrush<span style="color: #000000;">&#40;</span> oBtn:<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> hOldBrush := SelectObject<span style="color: #000000;">&#40;</span> hDC, hBrush <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> hPen := CreatePen<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">2</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBtn:<span style="color: #000000;">lFocused</span> .or. oBtn:<span style="color: #000000;">lMOver</span>, CLR_WHITE, oBtn:<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> n, w, h<br /><br />  &nbsp;n := <span style="color: #000000;">3</span><br /><br />   Ellipse<span style="color: #000000;">&#40;</span> hDC, n, n, oBtn:<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">1</span> - n, oBtn:<span style="color: #000000;">nHeight</span> - <span style="color: #000000;">1</span> - n, hPen <span style="color: #000000;">&#41;</span><br /><br />   SelectObject<span style="color: #000000;">&#40;</span> oBtn:<span style="color: #000000;">hDC</span>, hOldBrush <span style="color: #000000;">&#41;</span><br />   DeleteObject<span style="color: #000000;">&#40;</span> hPen <span style="color: #000000;">&#41;</span><br />   DeleteObject<span style="color: #000000;">&#40;</span> hBrush <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> oBtn:<span style="color: #000000;">Cargo</span> == nSelect<br />      W     := nBmpWidth<span style="color: #000000;">&#40;</span>  oBmp:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span><br />      h     := nBmpHeight<span style="color: #000000;">&#40;</span> oBmp:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span><br />      PalBmpDraw<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">&#40;</span> oBtn:<span style="color: #000000;">nWidth</span> - w <span style="color: #000000;">&#41;</span> / <span style="color: #000000;">2</span>, <span style="color: #000000;">&#40;</span> oBtn:<span style="color: #000000;">nHeight</span> - h <span style="color: #000000;">&#41;</span> / <span style="color: #000000;">2</span> , oBmp:<span style="color: #000000;">hBitmap</span>, oBmp:<span style="color: #000000;">hPalette</span>, w, h, SRCCOPY, .t., oBtn:<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">&#41;</span><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 /> </div>[/code:4wsxyq23]
Button-group RADIO-style
Mr. Rao, Trying the function, there was a problem painting the buttons ( only a visible border ). I found another possible solution with a visible focus : Different button-styles : 1. coloed buttons 2. buttons with image and connected text like normal radios. -- The textcolor could change on focus as well. [img:3k6hfrlh]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/RButton1&#46;jpg[/img:3k6hfrlh] I wanted to use a FOR / NEXT for [b:3k6hfrlh]oRBtn[1]:bClrGrad = { | lMouseOver | If( ! lMouseOver, aBack[1], aFocus[1] ) }[/b:3k6hfrlh] but all buttuns are using color 6 thats the reason there is a line for each button Maybe possible just one line with [b:3k6hfrlh]:cargo [/b:3k6hfrlh] ? [code=fw:3k6hfrlh]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Local</span> aFocus<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>, aBack<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>, aRColor<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>, oRBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span><br />...<br />...<br />aRColor<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">0</span><br />aRColor<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">16777215</span><br />aRColor<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">54121</span><br />aRColor<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">16711680</span><br />aRColor<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">255</span><br />aRColor<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">65535</span><br />I := <span style="color: #000000;">1</span><br />nTop := <span style="color: #000000;">58</span><br /><span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">6</span> <span style="color: #B900B9;">// 6 buttons</span><br />    @ nTop, <span style="color: #000000;">325</span> <span style="color: #0000ff;">BTNBMP</span> oRBtn<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">OF</span> oDlg  ;<br />    <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span>, <span style="color: #000000;">15</span> NOBORDER TRANSPARENT <span style="color: #000000;">2007</span> <span style="color: #0000ff;">UPDATE</span> ;<br />    <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> nBtnPos := ::<span style="color: #000000;">Cargo</span>, ;<br />      nTxtColor := BMPPAINT<span style="color: #000000;">&#40;</span> oDlg, oRBtn, nBtnPos, aRColor <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// value saved to INI    </span><br />    oRBtn<span style="color: #000000;">&#91;</span> I <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lEllipse</span> = .T.<br />    oRBtn<span style="color: #000000;">&#91;</span> I <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Cargo</span> := I<br />    <span style="color: #B900B9;">// can be different !!!   </span><br />    aFocus<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.1</span>, aRColor<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span>, aRColor<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.1</span>, aRColor<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span>, aRColor<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <br />    <br />    aBack<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span>   := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.1</span>, aRColor<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span>, aRColor<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.1</span>, aRColor<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span>, aRColor<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />    nTop := nTop + <span style="color: #000000;">18</span><br /><span style="color: #00C800;">NEXT</span><br /><br /><span style="color: #B900B9;">// possible to include in FOR / NEXT ???</span><br />oRBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrGrad</span> = <span style="color: #000000;">&#123;</span> | lMouseOver | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lMouseOver, aBack<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>, aFocus<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />oRBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrGrad</span> = <span style="color: #000000;">&#123;</span> | lMouseOver | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lMouseOver, aBack<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>, aFocus<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />oRBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrGrad</span> = <span style="color: #000000;">&#123;</span> | lMouseOver | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lMouseOver, aBack<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>, aFocus<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />oRBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrGrad</span> = <span style="color: #000000;">&#123;</span> | lMouseOver | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lMouseOver, aBack<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>, aFocus<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />oRBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrGrad</span> = <span style="color: #000000;">&#123;</span> | lMouseOver | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lMouseOver, aBack<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>, aFocus<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />oRBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrGrad</span> = <span style="color: #000000;">&#123;</span> | lMouseOver | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lMouseOver, aBack<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>, aFocus<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #B900B9;">// loaded from INI</span><br />nTxtColor := BMPPAINT<span style="color: #000000;">&#40;</span> oDlg, oRBtn, nBtnPos, aRColor <span style="color: #000000;">&#41;</span><br />...<br />...<br /><span style="color: #B900B9;">// ------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> BMPPAINT<span style="color: #000000;">&#40;</span> oDlg, oRBtn, nBtnPos, aRColor <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> I := <span style="color: #000000;">1</span>, nRColor := <span style="color: #000000;">0</span><br /><br /><span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">&#40;</span> oRBtn <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">IF</span> nBtnPos = I<br />          nRColor := aRColor<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span><br />     <span style="color: #00C800;">ENDIF</span><br />     oRBtn<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetFile</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">IF</span> I = nBtnPos<br />          oRBtn<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetFile</span><span style="color: #000000;">&#40;</span> c_path1 + <span style="color: #ff0000;">"Yes.Bmp"</span>, c_path1 + <span style="color: #ff0000;">"Yes.Bmp"</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">NEXT</span><br /><br />AEVAL<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">aControls</span>, <span style="color: #000000;">&#123;</span> | oCtl | IIF<span style="color: #000000;">&#40;</span> oCtl:<span style="color: #000000;">ClassName</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"TSAY"</span>, ; <span style="color: #B900B9;">// only SAY is used</span><br />     <span style="color: #000000;">&#40;</span> oCtl:<span style="color: #000000;">Setcolor</span><span style="color: #000000;">&#40;</span> nRColor,  <span style="color: #000000;">&#41;</span>, oCtl:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> nRColor<br /> </div>[/code:3k6hfrlh] best regards Uwe <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Button-group RADIO-style
we should never use loop variables in codeblock created inside a loop. We should use detached variable concept. you can find many examples. I provided an approach in my sample. you can improve upon it to your taste
ButtonBMP
Hola a todos. Estoy empezando a pasar mi primera aplicación a 32 bits- así que a partir de ahora os daré un poco la lata- y tengo algunos problemas con los botones: Quiero eliminar de los diálogos los botones Borland y sustituirlos por otra clase, he probado con ButtonBMP, pero me encuentro que si los defino como Button (Custom Control) me aparecen como pulsados y si los defino como PushButton al pulsar con el ratón y sin soltarlo sitúo el cursor fuera del botón se queda como pulsado y ya no vuelve a verse bien. En cualquier caso quiero evitar el efecto de que cambie de color. La declaración la hago así de simple: REDEFINE BUTTONBMP oBtn1 ID 781 OF oDlg BITMAP "BMP_SI" Los diálogos los tengo en DLLs, estoy usando PellesC Saludos
ButtonBMP
Sebastián, Revisa el ejemplo samples\TestBuBm.prg
ButtonBMP
Antonio, eso fué lo primero que miré. He comprobado que si el BMP del botón está en un fichero sale bien, pero si está en la librería de recursos, aun siendo el mismo dibujo, sale como si estuviera pulsado. Es decir REDEFINE BUTTONBMP oBtn1 ID 781 OF oDlg BITMAP "BMP_SI.BMP" //Se ve bien no se ve igual que: REDEFINE BUTTONBMP oBtn1 ID 781 OF oDlg BITMAP "BMP_SI" //Se ve como pulsado ¿ Estoy haciendo algo mal ?
ButtonBMP
Sebastian, Aqui tienes un ejemplo funcionando correctamente usando un bitmap desde recurso: <!-- m --><a class="postlink" href="http://hyperupload.com/download/018caba742/test.zip.html">http://hyperupload.com/download/018caba ... t.zip.html</a><!-- m -->