topic
stringlengths
1
63
text
stringlengths
1
577k
ClassGriaule.zip
[url:140rmiqs]https://code.google.com/archive/p/fivewin-contributions/downloads?page=9[/url:140rmiqs]
ClassGriaule.zip
Hi Marca, I told you, The solution is not so simple and ActiveX is not a good way to take. Few years ago I did a procedure in C/C++ to work with it. I sent you a demo my procedures, and How you see it works.
ClassGriaule.zip
Hello Marcelo, Before purchasing any source from Laiton, please check in the forum how he treated his customers, particulary on Fiveweb. Also, Griaule has changed so much from old versions....
ClassSel
could someone provide a short translation from these links or a description of CLASSSEL() Thanks in advance Otto <!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=723&highlight=classsel">http://fivetechsoft.com/forums/viewtopi ... t=classsel</a><!-- m --> <!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=7201&highlight=classsel">http://fivetechsoft.com/forums/viewtopi ... t=classsel</a><!-- m --> <!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=8297&highlight=classsel">http://fivetechsoft.com/forums/viewtopi ... t=classsel</a><!-- m --> local o := ErrorNew() // Vamos a ver las DATAs de un objeto error local aInfo := o:ClassSel() for n = 1 to Len( aInfo ) if Left( aInfo[ n ], 1 ) == "_" MsgInfo( SubStr( aInfo[ n ], 2 ) ) endif next
ClassSel
Otto, It returns an array with all the names of the methods and datas of the class. Datas are returned twice, with "_" before for assignment, and without it to retrive their values.
ClassSel
Antonio, thank you. Regards, Otto
Classe FreeImage de xharbour + fwh
Olá, No xharbour existe uma classe para acessar a freeimage.dll, só que, quando incluo o "freeimage.ch", como no programa abaixo é gerado os erros abaixo: #include "fivewin.ch" #include "FreeImage.ch" #include "common.ch" function Main() local oWnd, oBmp DEFINE WINDOW oWnd TITLE "SaveToBmp" ACTIVATE WINDOW oWnd return nil Application =========== Path and name: C:\teste\imag8.exe (32 bits) Size: 1,565,184 bytes Error occurred at: 12/11/06, 17:30:40 Error description: Error BASE/2023 Argument error: SizeOfCStructure Args: [ 1] = A { ... } Stack Calls =========== Called from: => HB_SIZEOFCSTRUCTURE(0) Called from: cstruct.prg => __ACTIVESTRUCTURE(150) Called from: => __INIT_BITMAPINFOHEADER$(0) Isto é alguma incompatibilidade ? Como corrigir isto ? Obrigado, Rossine.
Classe FreeImage de xharbour + fwh
wich image class use ?
Classe FreeImage de xharbour + fwh
Hello Silvio, I am trying to use the class \xharbour\contrib\freeimage Best regards.
Classe FreeImage de xharbour + fwh
Olá, Esta classe realmente é muito boa e tem várias funções para se trabalhar com a freeimage, mas não consigo usá-la junto com FWH. Veja um exemplo abaixo: [code:243bd3g3] /* * $Id&#58; fitest&#46;prg,v 1&#46;3 2006/05/12 22&#58;55&#58;51 lculik Exp $ */ /* * Copyright 2005 Francesco Saverio Giudice <info@fsgiudice&#46;com> * * FreeImage API test file */ #include "FreeImage&#46;ch" #include "common&#46;ch" #define IMAGES_IN "images_in/" #define IMAGES_OUT "images_out/" PROCEDURE Main&#40;&#41; LOCAL im, clone, rotated, rotatedEx, rescale, im2, im3 LOCAL centerX, centerY, width, height, appo LOCAL bmpinfoheader IS BITMAPINFOHEADER LOCAL bmpinfo IS BITMAPINFO LOCAL bkcolor IS RGBQUAD LOCAL iccprofile IS FIICCPROFILE // ? "Press Alt-D + Enter to activate debug" // AltD&#40; &#46;T&#46; &#41; // Inkey&#40;0&#41; *set console OFF *set printer ON altd&#40;&#41; // Check output directory IF !ISDirectory&#40; IMAGES_OUT &#41; DirMake&#40; IMAGES_OUT &#41; ENDIF ? "Initialise" fi_Initialise&#40;&#41; //---------------------------// ? "Set Error Message&#58;", fi_SetOutPutMessage&#40; @fi_Error&#40;&#41; &#41; //? "Set Error Message&#58;", fi_SetOutPutMessage&#40; NIL &#41; ? "Version &#58;", fi_GetVersion&#40;&#41; ? "Copyright &#58;", fi_GetCopyrightMessage&#40;&#41; ? "File type &#58;", fi_GetFileType&#40; IMAGES_IN + "xharbour&#46;jpg" &#41; ? "Load JPEG" im &#58;= fi_Load&#40; FIF_JPEG, IMAGES_IN + "xharbour&#46;jpg", JPEG_DEFAULT &#41; ? "Clone image" clone &#58;= fi_Clone&#40; im &#41; ? "Pointer &#58;", ValToPrg&#40; im &#41; ? "Image Type &#58;", fi_GetImageType&#40; im &#41; ? "Color Used &#58;", fi_GetColorsUsed&#40; im &#41; ? "Pixel size &#58;", fi_GetBPP&#40; im &#41; ? "Width &#58;", fi_GetWidth&#40; im &#41; ? "Height &#58;", fi_GetHeight&#40; im &#41; ? "Byte Size &#58;", fi_GetLine&#40; im &#41; ? "Pitch &#58;", fi_GetPitch&#40; im &#41; ? "DIB Size &#58;", fi_GetDIBSize&#40; im &#41; ? "Dots per Meter X &#58;", fi_GetDotsPerMeterX&#40; im &#41; ? "Dots per Meter Y &#58;", fi_GetDotsPerMeterY&#40; im &#41; ? "Color Type &#58;", fi_GetColorType&#40; im &#41; ? "Red Mask &#58;", fi_GetRedMask&#40; im &#41; ? "Green Mask &#58;", fi_GetGreenMask&#40; im &#41; ? "Blue Mask &#58;", fi_GetBlueMask&#40; im &#41; ? "Transp&#46; Count &#58;", fi_GetTransparencyCount&#40; im &#41; ? "Is Transparent ? &#58;", fi_IsTransparent&#40; im &#41; ? ? "Save BMP ? &#58;", fi_Save&#40; FIF_BMP , im, IMAGES_OUT + "xharbour&#46;bmp", BMP_DEFAULT &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, im, IMAGES_OUT + "xharbour&#46;jpg", JPEG_DEFAULT &#41; ? "Save PNG ? &#58;", fi_Save&#40; FIF_PNG , im, IMAGES_OUT + "xharbour&#46;png", PNG_DEFAULT &#41; ? "Save TIFF ? &#58;", fi_Save&#40; FIF_TIFF, clone, IMAGES_OUT + "xharbour&#46;tif", TIFF_DEFAULT &#41; ? "Flip Horizontal ?&#58;", fi_FlipHorizontal&#40; clone &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, clone, IMAGES_OUT + "horizontal&#46;jpg", JPEG_DEFAULT &#41; ? "Flip Vertical ? &#58;", fi_FlipVertical&#40; clone &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, clone, IMAGES_OUT + "vertical&#46;jpg", JPEG_DEFAULT &#41; ? "Rotate Classic &#58;", ValToPrg&#40; rotated &#58;= fi_RotateClassic&#40; clone, 90 &#41; &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, rotated, IMAGES_OUT + "rotate&#46;jpg", JPEG_DEFAULT &#41; fi_Unload&#40; rotated &#41; centerx &#58;= fi_GetWidth&#40; clone &#41; / 2 centery &#58;= fi_GetHeight&#40; clone &#41; / 2 ? "Rotate Ex &#58;", ValToPrg&#40; rotatedEx &#58;= fi_RotateEx&#40; clone, 15, 0, 0, centerx, centery, TRUE &#41; &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, rotatedEx, IMAGES_OUT + "rotateEx&#46;jpg", JPEG_DEFAULT &#41; fi_Unload&#40; rotatedEx &#41; width &#58;= fi_GetWidth&#40; im &#41; height &#58;= fi_GetHeight&#40; im &#41; ? "Rescale &#58;", ValToPrg&#40; rescale &#58;= fi_Rescale&#40; im, width / 2, height / 2, FILTER_BICUBIC &#41; &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, rescale, IMAGES_OUT + "rescale&#46;jpg", JPEG_DEFAULT &#41; fi_Unload&#40; rescale &#41; im2 &#58;= fi_Clone&#40; im &#41; ? "Adjust Gamma ? &#58;", fi_AdjustGamma&#40; im2, 3&#46;0 &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, im2, IMAGES_OUT + "adjgamma&#46;jpg", JPEG_DEFAULT &#41; fi_Unload&#40; im2 &#41; im2 &#58;= fi_Clone&#40; im &#41; ? "Adjust Brightness&#58;", fi_AdjustBrightness&#40; im2, -30 &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, im2, IMAGES_OUT + "adjbright&#46;jpg", JPEG_DEFAULT &#41; fi_Unload&#40; im2 &#41; im2 &#58;= fi_Clone&#40; im &#41; ? "Adjust Contrast ?&#58;", fi_AdjustContrast&#40; im2, -30 &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, im2, IMAGES_OUT + "adjcontrast&#46;jpg", JPEG_DEFAULT &#41; fi_Unload&#40; im2 &#41; im2 &#58;= fi_Clone&#40; im &#41; ? "Invert ? &#58;", fi_Invert&#40; im2 &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, im2, IMAGES_OUT + "invert&#46;jpg", JPEG_DEFAULT &#41; fi_Unload&#40; im2 &#41; ? "Red Channel &#58;", ValToPrg&#40; im2 &#58;= fi_GetChannel&#40; im, FICC_RED &#41; &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, im2, IMAGES_OUT + "red&#46;jpg", JPEG_DEFAULT &#41; fi_Unload&#40; im2 &#41; ? "Green Channel &#58;", ValToPrg&#40; im2 &#58;= fi_GetChannel&#40; im, FICC_GREEN &#41; &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, im2, IMAGES_OUT + "green&#46;jpg", JPEG_DEFAULT &#41; fi_Unload&#40; im2 &#41; ? "Blue Channel &#58;", ValToPrg&#40; im2 &#58;= fi_GetChannel&#40; im, FICC_BLUE &#41; &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, im2, IMAGES_OUT + "blue&#46;jpg", JPEG_DEFAULT &#41; fi_Unload&#40; im2 &#41; ? "Copy &#58;", ValToPrg&#40; im2 &#58;= fi_Copy&#40; im, 300, 100, 800, 200 &#41; &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, im2, IMAGES_OUT + "copy&#46;jpg", JPEG_DEFAULT &#41; im3 &#58;= fi_Clone&#40; im &#41; ? "Paste ? &#58;", fi_Paste&#40; im3, im2, 10, 10, 70 &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, im3, IMAGES_OUT + "paste&#46;jpg", JPEG_DEFAULT &#41; fi_Unload&#40; im2 &#41; fi_Unload&#40; im3 &#41; ? "Allocate Bitmap &#58;", ValToPrg&#40; im3 &#58;= fi_AllocateT&#40; FIT_BITMAP, 320, 200, 32 &#41; &#41; ? "Save JPG ? &#58;", fi_Save&#40; FIF_JPEG, im3, IMAGES_OUT + "allocate&#46;jpg", JPEG_DEFAULT &#41; fi_Unload&#40; im3 &#41; ? "Create ERROR &#58;" ? "Save GIF ? &#58;", fi_Save&#40; FIF_GIF, im, IMAGES_OUT + "wrong&#46;gif", 0 &#41; //? ValToPrg&#40; fi_GetInfoHeader&#40; im &#41; &#41; //bmpinfoheader&#58;Buffer&#40; fi_GetInfoHeader&#40; im &#41;, TRUE &#41; bmpinfoheader&#58;Pointer&#40; fi_GetInfoHeader&#40; im &#41; &#41; ? "Header &#58;", ValToPrg&#40; bmpinfoheader &#41; ? bmpinfoheader&#58;SayMembers&#40;" ", &#46;t&#46;, &#46;t&#46;&#41; bmpinfo&#58;Pointer&#40; fi_GetInfo&#40; im &#41; &#41; ? "Info &#58;", ValToPrg&#40; bmpinfo &#41; ? bmpinfo&#58;SayMembers&#40;" ", &#46;t&#46;, &#46;t&#46;&#41; ? "-----------------------------------------------------" ? ValType&#40; bmpinfo&#58;Devalue&#40;&#41; &#41; //Tracelog&#40; "bmpinfoheader", ValToPrg&#40; bmpinfoheader &#41;, ; // bmpinfoheader&#58;SayMembers&#40;, &#46;t&#46;&#41;, bmpinfoheader&#58;Value&#40;&#41;, bmpinfoheader&#58;DeValue&#40;&#41;, hb_dumpvar&#40; bmpinfoheader&#58;Array&#40;&#41; &#41;, hb_dumpvar&#40; bmpinfoheader&#58;acMembers &#41; &#41; //appo &#58;= bkcolor&#58;Value&#40;&#41; ? bkcolor&#58;Pointer&#40; fi_GetBackgroundColor&#40; im &#41; &#41; //? fi_GetBackgroundColor&#40; im, @bkcolor&#58;Value&#40;&#41; &#41; //bkcolor&#58;Buffer&#40; appo &#41; ? bkcolor&#58;SayMembers&#40;" ", &#46;t&#46;, &#46;t&#46;&#41; bkcolor&#58;rgbBlue &#58;= 205 //? fi_SetBackgroundColor&#40; im, hb_String2Pointer&#40; bkcolor&#58;Value&#40;&#41; &#41; &#41; Tracelog&#40;"linha 168"&#41; ? fi_SetBackgroundColor&#40; im, bkcolor&#58;Value&#40;&#41; &#41; Tracelog&#40;"linha 170"&#41; ? bkcolor&#58;SayMembers&#40;" ", &#46;t&#46;, &#46;t&#46;&#41; Tracelog&#40;"linha 162"&#41; // ? bkcolor&#58;Pointer&#40; fi_GetBackgroundColor&#40; im &#41; &#41; //? fi_GetBackgroundColor&#40; im, @bkcolor&#58;Value&#40;&#41; &#41; //bkcolor&#58;Buffer&#40; appo &#41; Tracelog&#40;"linha 176"&#41; ? bkcolor&#58;SayMembers&#40;" ", &#46;t&#46;, &#46;t&#46;&#41; Tracelog&#40;"linha 179"&#41; iccprofile&#58;Pointer&#40; fi_GetICCProfile&#40; im &#41; &#41; Tracelog&#40;"linha 181"&#41; ? "Header &#58;", ValToPrg&#40; iccprofile &#41; Tracelog&#40;"linha 183"&#41; ? iccprofile&#58;SayMembers&#40;" ", &#46;t&#46;, &#46;t&#46;&#41; //bmpinfoheader&#58;Reset&#40;&#41; //appo &#58;= NIL //bmpinfoheader &#58;= NIL //hb_GCAll&#40; &#46;T&#46; &#41; ? "Unload images from memory" fi_Unload&#40; im &#41; fi_Unload&#40; clone &#41; //---------------------------// ? "DeInitialise" fi_Deinitialise&#40;&#41; ? ? "Look at " + IMAGES_OUT + " folder for output images" ? *set printer OFF *set console ON RETURN PROCEDURE fi_Error&#40; cFormat, cMessage &#41; ? "ERROR!&#46;&#46;&#46;" ? "Format &#58; ", cFormat ? "Message &#58; ", cMessage return [/code:243bd3g3] Alguém poderia me ajudar ? <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: --> Obrigado, Rossine.
Classe FreeImage de xharbour + fwh
perhaps in dos run but in windows there are some problems I use image from emg
Classe HbPersistent ( xHarbour )
Como faco para usar esta classe HbPersistent do xharbour no FWPPC, se alguem puder me ajudar tenho urgencia nesta classe. Obrigado!
Classe HbPersistent ( xHarbour )
Cleber, Has probado a añadirla como un PRG más de tu aplicación y probar a compilarla ?
Classe LISTBOX (bRDblClick)
Estoy utilizando la CLASSE LISTBOX con MYSQL(FCSODBC) pero como podría utilizar la opción de bRDblClick el Mouse de lado derecho. Quiero utilizar la opción para un MENU oMenu POPUP Gracias Mario
Classe LISTBOX (bRDblClick)
Mario, [code:1vbiq4f7] &#46;&#46;&#46; LISTBOX oBrw FIELDS &#46;&#46;&#46; ; ON RIGHT CLICK ShowPopup&#40; nRow, nCol, oBrw &#41; &#46;&#46;&#46; function ShowPopup&#40; nRow, nCol, oBrw &#41; local oMenu MENU oMenu POPUP MENUITEM "&Colors&#46;&#46;&#46;" ACTION &#46;&#46;&#46; MENUITEM "&Font&#46;&#46;&#46;" ACTION &#46;&#46;&#46; ENDMENU ACTIVATE MENU oMenu AT nRow, nCol OF oBrw return nil [/code:1vbiq4f7]
Classe LISTBOX (bRDblClick)
Muchas, Gracias también me funciono así. oBTab:bRClicked:={|| Desp_Men(oDlg,90,210)} STAT FUNC Mant_Tabla(oDlg,nRow,nCol) LOCAL oMenu MENU oMenu POPUP MENUITEM "&Datos de la Tabla" ENDMENU ACTIVATE POPUP oMenu OF oDlg AT nRow,nCol RETURN (NIL)
Classe LISTBOX (bRDblClick)
Bueno, yo diria que es lo mismo maecmx. Estoy hasta la m...! pasando mis 100,000 lineas de código para que funcionen con ADS en modo C/S. En cuanto logre hacerlo funcionar compartiré las rutinas de control. Gracias René por la idea pero esto me está costando un H..!
Classe LISTBOX (bRDblClick)
[quote="Alfredo Arteaga":1bybx20d]Bueno, yo diria que es lo mismo maecmx. Estoy hasta la m...! pasando mis 100,000 lineas de código para que funcionen con ADS en modo C/S. En cuanto logre hacerlo funcionar compartiré las rutinas de control. Gracias René por la idea pero esto me está costando un H..![/quote:1bybx20d] Animo!!!!!!!! Hay mas tiempo que vida. Saludos
Classe LISTBOX (bRDblClick)
Gracias por el ánimo Willy. Parece que la desvelada valió la pena, ya trabajan mis rutinas de apertura y cierre, solo me queda sustituir todas las llamadas y verificar que esto trabaje normalmente. Lo someteré a prueba en una semana más. Ya te comentaré, saludos.
Classe LISTBOX (bRDblClick)
adelante !! alfredo, las desveladas son caras, pero resulta que es cuando mejor nos funciona el cerebro a los programadores, al menos en lo propio por la madrugada resuelvo muchos de mis problemas complejos, saludos y suerte !! paco
Classe LISTBOX (bRDblClick)
[quote="Francisco Horta":38wr3mvq]adelante !! alfredo, las desveladas son caras, pero resulta que es cuando mejor nos funciona el cerebro a los programadores, al menos en lo propio por la madrugada resuelvo muchos de mis problemas complejos, saludos y suerte !! paco[/quote:38wr3mvq] Comparto indiscutiblemente tu punto de vista. jjejjejjejjejje saludos a los dos Alfred, claro, estaremos pendientes
Classe Metro
Boa Tarde, Estou a ver vários exemplos da classe metro e não estou a conseguir fazer o que desejo, preciso o seguinte: na primeira tela quero que mostre 1 Metrobutton por cada registo da tabela REGIOES.DBF em que o caption é o campo nome desta mesma, quando o usuário clicar num deles preciso saber em que Recno() da REGIOES.DBF clicou , para depois fazer um filtro a tabela ARTIGOS.DBF em que o campo CodReg=RECNO() da tabela REGIOES clicado na primeira tela e mostrar todos os artigos filtrados em 1 metrobutton por cada registo, tem como fazer isso? Cumprimentos João Alpande
Classe Metro
Joao, Prueba asi: [code=fw:1mpquy5a]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #00C800;">local</span> oMetro<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> METRO oMetro ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"My FWH Metro app"</span> ;<br />&nbsp; &nbsp; &nbsp; BACKGROUND <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\h</span>ires<span style="color: #000000;">\e</span>arth.bmp"</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">while</span> ! Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> METROBUTTON <span style="color: #0000ff;">OF</span> oMetro ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PROMPT</span> FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">COLOR</span> CLR_WHITE, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">224</span> <span style="color: #000000;">&#41;</span> ; &nbsp;<span style="color: #B900B9;">// 1 primer campo</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\m</span>etro<span style="color: #000000;">\f</span>iles.bmp"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> Records<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; DbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;end<br />&nbsp;</div>[/code:1mpquy5a]
Classe Metro
Gracias Antonio Linares, MUISTRA BIEN os metrobutton do dbf , cómo saber recno() do dbf el usuario hace clic ? Saludos João
Classe Metro
Joao, Tienes que hacer esta modificación en metro.ch: [code=fw:3eu14ac3]<div class="fw" id="{CB}" style="font-family: monospace;">#xcommand <span style="color: #0000ff;">DEFINE</span> METROBUTTON <span style="color: #000000;">&#91;</span><oBtn><span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">PROMPT</span> <cPrompt> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">COLOR</span> <nClrText>, <nClrPane> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">IMAGE</span> <cImgName> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">OF</span> <oMetro> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <large: <span style="color: #000000;">LARGE</span>> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">ACTION</span> <uAction,...> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; => ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <oBtn> := <span style="color: #000000;">&#93;</span> <oMetro>:<span style="color: #000000;">AddButton</span><span style="color: #000000;">&#40;</span> <cPrompt>, <nClrText>, <nClrPane>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <.large.>, <cImgName>, <span style="color: #000000;">&#91;</span><span style="color: #000000;">&#123;</span>| <span style="color: #00C800;">Self</span> |<uAction><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span></div>[/code:3eu14ac3] [code=fw:3eu14ac3]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp;<span style="color: #00C800;">local</span> oMetro, oBtn<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> METRO oMetro ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"My FWH Metro app"</span> ;<br />&nbsp; &nbsp; &nbsp; BACKGROUND <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\h</span>ires<span style="color: #000000;">\e</span>arth.bmp"</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">while</span> ! Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> METROBUTTON oBtn <span style="color: #0000ff;">OF</span> oMetro ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PROMPT</span> FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">COLOR</span> CLR_WHITE, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">224</span> <span style="color: #000000;">&#41;</span> ; &nbsp;<span style="color: #B900B9;">// 1 primer campo</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\m</span>etro<span style="color: #000000;">\f</span>iles.bmp"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> ShowRecords<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">&#41;</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; oBtn:<span style="color: #000000;">Cargo</span> = RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;end<br />&nbsp;</div>[/code:3eu14ac3]
Classe Metro
ola Antonio Linares, Alterei o metro.ch assim: [code=fw:1q325yyx]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// FiveWin - Windows 8 Metro look</span><br /><br />#ifndef _METRO_CH<br /><span style="color: #00D7D7;">#define</span> _METRO_CH<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />#xcommand <span style="color: #0000ff;">DEFINE</span> METRO <oMtr> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> BACKGROUND <cFileName> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> BTNSIZE <nBtnWidth>, <nBtnHeight> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">TITLE</span> <cTitle> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; => ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <oMtr> := TMetro<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <cTitle>, <nBtnWidth>, <nBtnHeight>, <cFileName> <span style="color: #000000;">&#41;</span><br /><br />xcommand <span style="color: #0000ff;">DEFINE</span> METROBUTTON <span style="color: #000000;">&#91;</span><oBtn><span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">PROMPT</span> <cPrompt> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">COLOR</span> <nClrText>, <nClrPane> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">IMAGE</span> <cImgName> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">OF</span> <oMetro> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <large: <span style="color: #000000;">LARGE</span>> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">ACTION</span> <uAction,...> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; => ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> <oBtn> := <span style="color: #000000;">&#93;</span> <oMetro>:<span style="color: #000000;">AddButton</span><span style="color: #000000;">&#40;</span> <cPrompt>, <nClrText>, <nClrPane>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <.large.>, <cImgName>, <span style="color: #000000;">&#91;</span><span style="color: #000000;">&#123;</span>| <span style="color: #00C800;">Self</span> |<uAction><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />#xcommand <span style="color: #0000ff;">ACTIVATE</span> METRO <oMtr> => <oMtr>:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />#endif</div>[/code:1q325yyx] alterei o metro.prg assim: [code=fw:1q325yyx]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">DEFINE</span> METRO oMetro ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"My FWH Metro app"</span> ;<br />&nbsp; &nbsp; &nbsp; BACKGROUND <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\h</span>ires<span style="color: #000000;">\e</span>arth.bmp"</span><br />&nbsp; &nbsp; DBSELECTAREA<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; NET_USE <span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"F_REG.DBF"</span>, <span style="color: #000000;">3</span>,.T.<span style="color: #000000;">&#41;</span><br />&nbsp;<span style="color: #00C800;">while</span> ! Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> METROBUTTON oBtn <span style="color: #0000ff;">OF</span> oMetro ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PROMPT</span> FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">COLOR</span> CLR_WHITE, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">224</span> <span style="color: #000000;">&#41;</span> ; &nbsp;<span style="color: #B900B9;">// 1 primer campo</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\m</span>etro<span style="color: #000000;">\f</span>iles.bmp"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> ShowRecords<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oBtn:<span style="color: #000000;">Cargo</span> = RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;end<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> METROBUTTON <span style="color: #0000ff;">OF</span> oMetro ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">COLOR</span> CLR_WHITE, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">224</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\m</span>etro<span style="color: #000000;">\e</span>xit.bmp"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Want to exit ?"</span> <span style="color: #000000;">&#41;</span>, oMetro:<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 /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> METRO oMetro</div>[/code:1q325yyx] dá error: Error description: Error description: Error BASE/1005 Class: 'NIL' has no property: CARGO se retirar : oBtn:Cargo = RecNo() mostra bem os metrobutton mas quando clico num dá erro: Error BASE/1003 Variable does not exist: SELF Gracias
Classe Metro
Por favor compílalo usando /b al llamar a Harbour.exe y comprueba que te aparece en el fichero.PPO
Classe Metro
obrigado, o .ppo aparece assim, estou compilando com buildx.bat do samples: [code=fw:9mrnfskq]<div class="fw" id="{CB}" style="font-family: monospace;"> oMetro := TMetro<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;">"My FWH Metro app"</span>,,, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\h</span>ires<span style="color: #000000;">\e</span>arth.bmp"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; DBSELECTAREA<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; NET_USE <span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"F_REG.DBF"</span>, <span style="color: #000000;">3</span>,.T.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<span style="color: #00C800;">while</span> ! Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBtn := oMetro:<span style="color: #000000;">AddButton</span><span style="color: #000000;">&#40;</span> FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> + <span style="color: #000000;">&#40;</span> <span style="color: #000000;">174</span> * <span style="color: #000000;">256</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">&#40;</span> <span style="color: #000000;">224</span> * <span style="color: #000000;">65536</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .F., <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\m</span>etro<span style="color: #000000;">\f</span>iles.bmp"</span>, <span style="color: #000000;">&#123;</span>||ShowRecords<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBtn:<span style="color: #000000;">Cargo</span> :=RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;end<br />&nbsp; &nbsp;oMetro:<span style="color: #000000;">AddButton</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Exit"</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> + <span style="color: #000000;">&#40;</span> <span style="color: #000000;">174</span> * <span style="color: #000000;">256</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">&#40;</span> <span style="color: #000000;">224</span> * <span style="color: #000000;">65536</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .F., <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\m</span>etro<span style="color: #000000;">\e</span>xit.bmp"</span>, <span style="color: #000000;">&#123;</span>||If<span style="color: #000000;">&#40;</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Want to exit ?"</span> <span style="color: #000000;">&#41;</span>, oMetro:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oMetro:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:9mrnfskq]
Classe Metro
En el .ppo debería aparecer esto: {| Self |ShowRecords(::Cargo )} Has modificado el fichero metro.ch como te indiqué ?
Classe Metro
Desculpa Antonio Linares, o metro.ch estava errado , mas continua com o mesmo erro Error description: Error BASE/1005 Class: 'NIL' has no property: CARGO .ppo esta: [code=fw:2dq1478z]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; oMetro := TMetro<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;">"My FWH Metro app"</span>,,, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\h</span>ires<span style="color: #000000;">\e</span>arth.bmp"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; DBSELECTAREA<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; NET_USE <span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"F_REG.DBF"</span>, <span style="color: #000000;">3</span>,.T.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<span style="color: #00C800;">while</span> ! Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBtn := oMetro:<span style="color: #000000;">AddButton</span><span style="color: #000000;">&#40;</span> FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> + <span style="color: #000000;">&#40;</span> <span style="color: #000000;">174</span> * <span style="color: #000000;">256</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">&#40;</span> <span style="color: #000000;">224</span> * <span style="color: #000000;">65536</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .F., <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\m</span>etro<span style="color: #000000;">\f</span>iles.bmp"</span>, <span style="color: #000000;">&#123;</span>| <span style="color: #00C800;">Self</span> |ShowRecords<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBtn:<span style="color: #000000;">Cargo</span> :=RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;end<br />&nbsp; &nbsp;oMetro:<span style="color: #000000;">AddButton</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Exit"</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> + <span style="color: #000000;">&#40;</span> <span style="color: #000000;">174</span> * <span style="color: #000000;">256</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">&#40;</span> <span style="color: #000000;">224</span> * <span style="color: #000000;">65536</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .F., <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\m</span>etro<span style="color: #000000;">\e</span>xit.bmp"</span>, <span style="color: #000000;">&#123;</span>| <span style="color: #00C800;">Self</span> |If<span style="color: #000000;">&#40;</span> MsgYesNo<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Want to exit ?"</span> <span style="color: #000000;">&#41;</span>, oMetro:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oMetro:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2dq1478z]
Classe Metro
Please try this change and let me know what you get: [code=fw:1l1jz1u8]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">while</span> ! Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      oBtn := oMetro:<span style="color: #000000;">AddButton</span><span style="color: #000000;">&#40;</span> FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> + <span style="color: #000000;">&#40;</span> <span style="color: #000000;">174</span> * <span style="color: #000000;">256</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">&#40;</span> <span style="color: #000000;">224</span> * <span style="color: #000000;">65536</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .F., <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\m</span>etro<span style="color: #000000;">\f</span>iles.bmp"</span>, <span style="color: #000000;">&#123;</span>| <span style="color: #00C800;">Self</span> |ShowRecords<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> ValType<span style="color: #000000;">&#40;</span> oBtn <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />         oBtn:<span style="color: #000000;">Cargo</span> :=RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      DbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   end</div>[/code:1l1jz1u8]
Classe Metro
information : U Error description: Error BASE/1005 Class: 'NIL' has no property: CARG
Classe Metro
Ola antonio, no forum fivewin brasil deram uma solução mas com dialog e button , não funciona com metro , veja: [url:4w7nxll0]http&#58;//fivewin&#46;com&#46;br/index&#46;php?/topic/24015-classe-metro/[/url:4w7nxll0] Saludos
Classe Metro
Master algo +- asi: [code=fw:56k0bfdp]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> TESTEPRODU<span style="color: #000000;">&#40;</span> oFld, _Folder, oPRODU, _LETRA, _INIPROD, _FIMPROD <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; MEMVAR OCTL, _oProdu<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">PUBLIC</span> WPRODFOCO<br /><br />&nbsp; &nbsp; oCtl := oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span>_Folder<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">oCtlFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">WHILE</span> _INIPROD <= _FIMPROD<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; SYSREFRESH<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; _oProdu := oProdu+STRZERO<span style="color: #000000;">&#40;</span>_INIPROD,<span style="color: #000000;">2</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>+_LETRA<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> <span style="color: #000000;">&#40;</span>oCtl:<span style="color: #000000;">hWnd</span> = &_oProdu:<span style="color: #000000;">hWnd</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WPRODFOCO := _INIPROD<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;EXIT<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; _INIPROD = _INIPROD + <span style="color: #000000;">1</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDDO</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:56k0bfdp]
Classe Metro
Joao, Que versión de FWH usas ?
Classe Metro
12.07
Classe Metro
Joao, Please check in FWH\source\classes\metropnl.prg if Method AddButton() returns oBtn: [code=fw:2kdwuy35]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> AddButton<span style="color: #000000;">&#40;</span> lLarge, nGroup, cCaption, bAction, nClrText, nClrPane, cImgName, oFont, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nAlign, nBmpAlign, nBmpWidth, nBmpHeight, cText, nTextAlign, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oTextFont, oSubMetro, cBackImage, cAction, cSub <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBtn<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nX := ::<span style="color: #000000;">nMetroMargin</span> + <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nRow</span> * <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBtnSize</span> + <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nY := ::<span style="color: #000000;">nMetroTop</span> + <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nCol</span> * <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBtnSize</span> + <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lLarge := .F.<br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nClrText := CLR_WHITE, nClrPane := NextClr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oBtn &nbsp;:= TMetroBtn<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nX, nY, lLarge, <span style="color: #00C800;">Self</span>, cCaption, cImgName, bAction, nAlign, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nBmpAlign, nBmpWidth, nBmpHeight, oFont, cText, nTextAlign, oTextFont, oSubMetro, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nGroup, cBackImage, cAction, cSub <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oBtn:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> nClrText, nClrPane <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBtn:<span style="color: #000000;">nClrCaption</span> &nbsp;:= nClrText<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> cBackImage <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span> .and. File<span style="color: #000000;">&#40;</span> cBackImage <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBtn:<span style="color: #000000;">SetBackGround</span><span style="color: #000000;">&#40;</span> cBacKImage <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aButtons</span>, oBtn <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">nCol</span>++<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lLarge<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nCol</span>++<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">nCol</span> > <span style="color: #000000;">5</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nRow</span>++<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nCol</span> = <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> oBtn<br />&nbsp;</div>[/code:2kdwuy35]
Classe Metro
Gracias Antonio , si addbutton return obtn , fontes: teste.prg : [code=fw:1ora3fu4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"metropnl.ch"</span><br /><br /><span style="color: #00C800;">static</span> oMetro, oMetro1, oMetro2, oMetro3, lMetro<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>, oTools, oSBtn<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>, oFont1, oFont2, oBigfont<br /><span style="color: #00C800;">static</span> nClrBack &nbsp; := CLR_GREEN, aRect<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>, nPanel := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">static</span> lMainBar := .F., lSubBar := .F., c_Path, c_Path1, oMainBar, oSubBar, nWColorT := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">static</span> nWStyle := <span style="color: #000000;">4</span>, nWColorF := <span style="color: #000000;">16443068</span>, nWColorB := <span style="color: #000000;">10899511</span>, nWGradPos := <span style="color: #000000;">0.2</span><br /><span style="color: #00C800;">static</span> lWDirect := .T., cWBrush := <span style="color: #ff0000;">"BluStone.Bmp"</span>, cWImage := <span style="color: #ff0000;">"Fantasy2.Jpg"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span> cParam <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> oWnd, oBar, oBrush<br /><span style="color: #00C800;">LOCAL</span> cTitle := <span style="color: #ff0000;">"CATALOGO VINHOS "</span><br /><br />&nbsp; &nbsp;SET DELETED <span style="color: #0000ff;">ON</span><br />&nbsp; &nbsp;SET SOFTSEEK OFF<br />&nbsp; &nbsp;SET EPOCH <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1950</span><br />&nbsp; &nbsp;SET DATE FORMAT <span style="color: #ff0000;">"dd/mm/yyyy"</span><br /><br />oFont1 := 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;">0</span>,<span style="color: #000000;">-16</span>,.F.,.T.,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,.F. <span style="color: #000000;">&#41;</span><br />oFont2 := 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;">0</span>,<span style="color: #000000;">-25</span>,.F.,.T.,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,.F. <span style="color: #000000;">&#41;</span><br />oBigFont := 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;">0</span>,<span style="color: #000000;">-38</span>,.F.,.T.,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,.F. <span style="color: #000000;">&#41;</span><br />oSmallFont := 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;">0</span>,<span style="color: #000000;">-12</span>,.F.,.T.,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,.F. <span style="color: #000000;">&#41;</span><br /><br />aRect<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> := GetSysmetrics<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">25</span> <span style="color: #B900B9;">// Screen-Height</span><br />aRect<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> := GetSysmetrics<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Screen-Width</span><br /><br />c_path := cFilePath<span style="color: #000000;">&#40;</span>GetModuleFileName<span style="color: #000000;">&#40;</span> GetInstance<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 /><span style="color: #B900B9;">// lChDir( "../" ) // needed starting from a subdirectory</span><br />c_path1 := c_path + <span style="color: #ff0000;">"Bitmaps<span style="color: #000000;">\"</span><br />c_path2 := c_path + "</span><span style="color: #0000ff;">Bitmaps</span>\Hires\<span style="color: #ff0000;">"<br />c_path3 := c_path + "</span><span style="color: #0000ff;">Bitmaps</span>\AlphaBmp\<span style="color: #ff0000;">"<br />c_path4 := c_path + "</span><span style="color: #0000ff;">Bitmaps</span>\Metro\<span style="color: #ff0000;">"<br /><br />lMetro[1] := .F.<br />lMetro[2] := .F.<br />lMetro[3] := .F.<br /><br />REQUEST DBFCDX<br /><br />IF FILE( c_Path + "</span>F_REG.DBF<span style="color: #ff0000;">" )<br />&nbsp; &nbsp; DBSELECTAREA( 1 )<br />&nbsp; &nbsp; NET_USE (c_Path + "</span>F_REG.DBF<span style="color: #ff0000;">", 3,.T.)<br />ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; MSGALERT("</span>ARQUIVO REGIÕES INEXISTENTE<span style="color: #ff0000;">","</span>Atenção<span style="color: #ff0000;">")<br />ENDIF<br /><br />DEFINE WINDOW oWnd TITLE cTitle STYLE nOr( WS_POPUP, WS_MAXIMIZE );<br />COLOR 255, CLR_GREEN<br /><br />oMetro1 := MakeMetroPanel( oWnd )<br /><br />oMetro1:bRClicked := { |Row,Col,f,o| IIF( lSubBar = .F., MAIN_MOVE() , ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( oSubBar:End(), MAIN_MOVE() ) ) }<br /><br />ACTIVATE WINDOW oWnd MAXIMIZED ;<br />ON INIT ( STARTUP(oMetro1,1), ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oMetro1:Show(), ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oWnd:Move( 0, 0, aRect[4], aRect[3], .f. ) ) // Top, left, width, height<br /><br />oFont1:End()<br />oFont2:End()<br />oBigFont:End()<br />oSmallFont:End()<br /><br />RETURN NIL<br />//----------------------------------------------------------------------------//<br /><br />STATIC FUNCTION MAKEMETROPANEL( oWnd )<br />local oMetro1, oBtn,cnt:=0,oBt[50],nRec[20],aNReg:={},aCReg:={},NBTNPOS,octl<br /><br />DEFINE METROPANEL oMetro1 OF oWnd TITLE "</span>Catálogo de Vinhos<span style="color: #ff0000;">" ;<br />ON CLICK oWnd:End()<br /><br />oMetro1:lDesignMode := .t.<br />lMetro[1] := .T.<br />DBSELECTAREA(1)<br />DBGOTOP()<br /><br />while !eof()<br />&nbsp; &nbsp; &nbsp; DEFINE METROBUTTON oBtn OF oMetro1 ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PROMPT FieldGet( 1 ) COLOR CLR_WHITE, RGB( 2, 174, 224 ) ; &nbsp;// 1 primer campo<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IMAGE "</span>..\<span style="color: #0000ff;">bitmaps</span>\metro\files.bmp<span style="color: #ff0000;">" ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ACTION ShowRecords( ::Cargo )<br />&nbsp; &nbsp; &nbsp; oBtn:Cargo := RecNo()<br />&nbsp; &nbsp; &nbsp; DbSkip()<br />end<br /><br /><br />DEFINE METROBUTTON oBt OF oMetro1 ;<br />COLOR &nbsp; CLR_WHITE,RGB( 255, &nbsp;0, &nbsp;66 ) ;<br />CAPTION &nbsp; "</span>Exit<span style="color: #ff0000;">" ;<br />ALIGN &nbsp; "</span>TOPRIGHT<span style="color: #ff0000;">" ;<br />GROUP &nbsp; 2 ;<br />BITMAP &nbsp; c_path4 + "</span>exit.bmp<span style="color: #ff0000;">" ;<br />BMPALIGN &nbsp; "</span>BOTTOMLEFT<span style="color: #ff0000;">" ;<br />SIZE &nbsp; 48, 48 ;<br />ACTION &nbsp; If( MsgYesNo( "</span>Want <span style="color: #0000ff;">to</span> exit ?<span style="color: #ff0000;">" ), oWnd:End(),)<br /><br /><br /><br />RETURN oMetro1<br /><br />FUNCTION ShowRecords()<br />&nbsp; //aqui preciso saber o recno() para fazer o filtro do artigos.dbf e mostrar em metrobutton<br />RETURN &nbsp;NIL<br /><br />// --------------------------<br /><br />FUNCTION STARTUP(oMetro,nPanel)<br /><br />DBSELECTAREA(1)<br />DBGOTO(nPanel)<br /><br />oMetro:SetColor( nWColorT, &nbsp;)<br />IF nWStyle = 1 // Color<br />&nbsp; &nbsp; D_BACKGRD( oMetro, 1, nWColorF )<br />ELSEIF nWStyle = 2 // Gradient<br />&nbsp; &nbsp; D_BACKGRD( oMetro, 2, nWColorF, nWColorB, nWGradPos, lWDirect )<br />ELSEIF nWStyle = 3 // BRUSH<br />&nbsp; &nbsp; D_BACKGRD( oMetro, 3, , , , , c_path1 + cWBrush )<br />ELSEIF nWStyle = 4 // Image<br />&nbsp; &nbsp; D_BACKGRD( oMetro, 4, , , , , , c_path2 + cWImage )<br />ENDIF<br /><br />RETURN( NIL )<br />// ----------------------------------------------------------------------------<br /><br />FUNCTION MAIN_MOVE()<br />LOCAL nStepL := 0, nLPos := aRect[4]<br /><br />IF lMainBar = .F. &nbsp;// Move IN<br />&nbsp; &nbsp; DO WHILE .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; nStepL := nStepL + 6<br />&nbsp; &nbsp; &nbsp; &nbsp; IF nStepL > &nbsp;100<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; INKEY(0.02)<br />&nbsp; &nbsp; &nbsp; &nbsp; nLPos := aRect[4] - nStepL<br />&nbsp; &nbsp; &nbsp; &nbsp; oMainBar:Move( 0, nLPos, , aRect[3], .f. ) // Top, left, width, height<br />&nbsp; &nbsp; ENDDO<br />&nbsp; &nbsp; lMainBar = .T.<br />ELSE<br />&nbsp; &nbsp; DO WHILE .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; nStepL := nStepL + 6<br />&nbsp; &nbsp; &nbsp; &nbsp; IF nStepL > &nbsp;100<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; INKEY(0.02)<br />&nbsp; &nbsp; &nbsp; &nbsp; nLPos := aRect[4] - 100 + nStepL<br />&nbsp; &nbsp; &nbsp; &nbsp; oMainBar:Move( 0, nLPos, , aRect[3], .f. ) // Top, left, width, height<br />&nbsp; &nbsp; ENDDO<br />&nbsp; &nbsp; lMainBar = .F.<br />ENDIF<br /><br />RETURN NIL<br /><br />// -------- &nbsp;WINDOW / DIALOG - Background ---------------<br /><br />FUNCTION D_BACKGRD( oDlg, nStyle, nColor1, nColor2, nMove, lDirect, cBrush, cImage )<br />LOCAL oBrush, hDC, aGrad, oImage<br />LOCAL aRect := GETCLIENTRECT( oDlg:hWnd )<br /><br />IF nStyle = 1 // COLOR<br />&nbsp; &nbsp; DEFINE BRUSH oBrush COLOR nColor1<br />&nbsp; &nbsp; oDlg:SetBrush( oBrush )<br />&nbsp; &nbsp; oBrush:End()<br />ENDIF<br />IF nStyle = 2 // GRADIENT Brush<br />&nbsp; &nbsp; aGrad := { { nMove, nColor1, nColor2 }, { nMove, nColor2, nColor1 } }<br />&nbsp; &nbsp; hDC = CreateCompatibleDC( oDlg:GetDC() )<br />&nbsp; &nbsp; hBmp = CreateCompatibleBitMap( oDlg:hDC, oDlg:nWidth, oDlg:nHeight )<br />&nbsp; &nbsp; hBmpOld = SelectObject( hDC, hBmp )<br />&nbsp; &nbsp; GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aGrad, lDirect ) // .T: = Vertical<br />&nbsp; &nbsp; DeleteObject( oDlg:oBrush:hBrush )<br />&nbsp; &nbsp; oBrush := TBrush():New( ,,,, hBmp )<br />&nbsp; &nbsp; oBrush:Cargo &nbsp;:= aGrad<br />&nbsp; &nbsp; SelectObject( hDC, hBmpOld )<br />&nbsp; &nbsp; ReleaseDC(hDC)<br />&nbsp; &nbsp; oDlg:SetBrush( oBrush )<br />&nbsp; &nbsp; oBrush:End()<br />ENDIF<br />IF nStyle = 3 // BMP-BRUSH<br />&nbsp; &nbsp; DEFINE BRUSH oBrush FILE &nbsp;cBrush<br />&nbsp; &nbsp; oDlg:SetBrush( oBrush )<br />&nbsp; &nbsp; oBrush:End()<br />ENDIF<br />IF nStyle = 4 // Image ADJUSTED<br />&nbsp; &nbsp; IF FILE( cImage )<br />&nbsp; &nbsp; &nbsp; &nbsp; DEFINE IMAGE oImage FILE cImage<br />&nbsp; &nbsp; &nbsp; &nbsp; oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, &nbsp;aRect[4], aRect[3], .T. ) )<br />&nbsp; &nbsp; &nbsp; &nbsp; oImage:End()<br />&nbsp; &nbsp; &nbsp; &nbsp; oDlg:SetBrush( oBrush )<br />&nbsp; &nbsp; &nbsp; &nbsp; oBrush:End()<br />&nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; IF !EMPTY(cImage)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgAlert( "</span>File : <span style="color: #ff0000;">" + cImage + CRLF + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "</span>does not exist<span style="color: #ff0000;">" + CRLF + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "</span><span style="color: #0000ff;">to</span> show <span style="color: #0000ff;">Image</span> !<span style="color: #ff0000;">", "</span>ATTENTION<span style="color: #ff0000;">" )<br />&nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; ENDIF<br />ENDIF<br /><br />RETURN( NIL )<br /><br />// ---------- NET - FUNCTIONS ----------------------------<br /><br />FUNCTION NET_USE ( cDBName1, ntrials, net)<br /><br />LOCAL lReturn &nbsp;:= .T.<br />LOCAL lOpen &nbsp; &nbsp;:= .F.<br />LOCAL close := 1<br /><br />ntrcount &nbsp; := ntrials<br />JaNein &nbsp; &nbsp;:= .F.<br /><br />// SHARED &nbsp; &nbsp;all Users<br />// EXCLUSIVE &nbsp;1 User<br /><br />IF File( cDBName1 )<br />&nbsp; &nbsp; ntrials := ntrcount<br />&nbsp; &nbsp; DO WHILE !lOpen<br />&nbsp; &nbsp; &nbsp; &nbsp; close := 2<br />&nbsp; &nbsp; &nbsp; &nbsp; DO WHILE .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF !net<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; USE &cDBName1 EXCLUSIVE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; USE &cDBName1 SHARED<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF !NetErr()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lReturn &nbsp; := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lOpen &nbsp; &nbsp; := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials := 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF net = .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; status := "</span>SHARED<span style="color: #ff0000;">"<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; status := "</span>EXCLUSIVE<span style="color: #ff0000;">"<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF ntrcount = ntrials<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xName := WNetGetUser()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF MsgYesNo( "</span>Open <span style="color: #ff0000;">" + status + "</span> &nbsp;<span style="color: #0000ff;">of</span> <span style="color: #ff0000;">" + upper(cDBName1) + "</span> not possible !<span style="color: #ff0000;">" + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"</span> <span style="color: #00C800;">try</span> again ?<span style="color: #ff0000;">", "</span>Network-error -> &xName !<span style="color: #ff0000;">" )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials := ntrcount<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JaNein &nbsp; &nbsp;:= .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials := 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JaNein &nbsp; &nbsp;:= .F.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF JaNein = .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials --<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF ntrials > 0 .AND. ntime > 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NET_WAIT ( ntrcount, ntrials, ntime)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF ntrials = 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials := ntrcount<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lReturn &nbsp; := .F.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lOpen &nbsp; &nbsp; := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials := 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF ntrials = 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lOpen := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; ENDDO<br />&nbsp; &nbsp; ENDDO<br />ELSE<br />&nbsp; &nbsp; nMsgBox ("</span>File -> <span style="color: #ff0000;">" + cDBName1 + "</span> is missing !<span style="color: #ff0000;">", "</span>Attention !<span style="color: #ff0000;">")<br />&nbsp; &nbsp; SET RESOURCES to<br />&nbsp; &nbsp; set _3DLOOK OFF<br />&nbsp; &nbsp; FreeLibrary()<br />&nbsp; &nbsp; close database<br />&nbsp; &nbsp; QUIT<br />ENDIF<br /><br />RETURN lReturn<br /><br />//-------------------------------------------------------<br /><br />FUNCTION NET_RLOCK( ntrials, ntime )<br /><br />LOCAL &nbsp; lReturn &nbsp; := .F.<br />LOCAL &nbsp; ntrcount &nbsp; := 0<br />LOCAL &nbsp; nZSek &nbsp; &nbsp; := 0<br />ntrcount := ntrials<br />DO WHILE !lReturn<br />&nbsp; &nbsp; DO WHILE ntrials > 0<br />&nbsp; &nbsp; &nbsp; &nbsp; IF !RLock()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials --<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF ntrials > 0 .AND. ntime > 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NET_WAIT ( ntrcount, ntrials, ntime )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lReturn := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; ENDDO<br />&nbsp; &nbsp; IF ntrials = 0<br />&nbsp; &nbsp; &nbsp; &nbsp; IF MsgYesNo( "</span>Not possible, <span style="color: #0000ff;">to</span> lock the record !<span style="color: #ff0000;">" + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"</span> <span style="color: #00C800;">Try</span> again ?<span style="color: #ff0000;">", "</span>Network Error !<span style="color: #ff0000;">" )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lOpen &nbsp; &nbsp; :=.T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials := ntrcount<br />&nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lReturn := .F.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lOpen &nbsp; := .F.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; ENDIF<br />ENDDO<br />IF lReturn = .F.<br />&nbsp; &nbsp; nMsgBox ("</span>Files are not saved !!!<span style="color: #ff0000;">", "</span>Attention !<span style="color: #ff0000;">")<br />ENDIF<br /><br />RETURN lReturn<br /><br />//-------------------------------------------------------<br /><br />FUNCTION NET_ULOCK ()<br /><br />LOCAL &nbsp; lReturn &nbsp; := .F.<br />LOCAL &nbsp; ntrcount &nbsp; := 0<br />LOCAL &nbsp; nZSek &nbsp; &nbsp; := 0<br /><br />IF len(fieldname(1)) > 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&& DB offen ?<br />&nbsp; &nbsp; UNLOCK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; && ja<br />ENDIF<br /><br />RETURN lReturn<br /><br />// ----------------------<br /><br />FUNCTION NET_CLOSE(ntrials, ntime, net)<br /><br />LOCAL lReturn &nbsp;:= .T.<br />LOCAL lOpen &nbsp; &nbsp;:= .F.<br />LOCAL close := 1<br /><br />ntrcount &nbsp; := ntrials<br />JaNein &nbsp; &nbsp;:= .F.<br />JaNein &nbsp; &nbsp;:= .F.<br /><br />cDBName1 := DBF()<br /><br />DO WHILE !lOpen<br />&nbsp; &nbsp; close := 1<br />&nbsp; &nbsp; DO WHILE ntrials > 0<br />&nbsp; &nbsp; &nbsp; &nbsp; USE<br />&nbsp; &nbsp; &nbsp; &nbsp; IF NetErr()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials --<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF MsgYesNo( "</span>Close <span style="color: #0000ff;">of</span> file : <span style="color: #ff0000;">" + upper(cDBName1) + "</span> not possible !<span style="color: #ff0000;">" + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "</span> <span style="color: #00C800;">Try</span> again ?<span style="color: #ff0000;">", "</span>Network-Error !<span style="color: #ff0000;">" )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lOpen :=.T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials := ntrcount<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF ntrials > 0 .AND. ntime > 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NET_WAIT ( ntrcount, ntrials, ntime)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lReturn &nbsp; := .F.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lOpen &nbsp; &nbsp; := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials := 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; geschloss := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lReturn &nbsp; := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lOpen &nbsp; &nbsp; := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials := 0<br />&nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; ENDDO<br />ENDDO<br /><br />RETURN lReturn<br /><br />// --------------------------------------------<br /><br />FUNCTION NET_WAIT ( ntrcount, ntrials, ntime )<br /><br />local oMeter, oText1<br /><br />MsgMeter( { | oMeter, oText1 | ;<br />SHOW_WAIT(ntrcount, ntrials, ntime, oMeter, oText1) } , ;<br />"</span>rest trials : <span style="color: #ff0000;">" + ltrim(str(ntrials)) + "</span>. trial...<span style="color: #ff0000;">" )<br /><br />RETURN nil<br /><br />//----------------------------------------------------------------------------//<br /><br />STATIC FUNCTION SHOW_WAIT(ntrcount, ntrials, ntime, oMeter, oText1)<br /><br />oMeter:nTotal = ntrcount<br />nZSek := Seconds()<br />oText1:SetText( "</span>rest <span style="color: #0000ff;">of</span> trials : <span style="color: #ff0000;">" + ltrim(str(ntrials)))<br />oMeter:Set( ntrials )<br />SysRefresh()<br />DO WHILE Seconds() < nZSek + ntime<br />ENDDO<br /><br />RETURN nil<br /><br />// -------------------------------------<br /><br />FUNCTION NET_DELETE ( nSeconds )<br /><br />LOCAL lReturn := .F.<br />LOCAL ntrcount := 0<br />LOCAL cDatabase := DBF()<br /><br />ntrcount := &nbsp;nSeconds<br /><br />DO WHILE !lReturn<br />&nbsp; &nbsp; DO WHILE &nbsp;nSeconds > 0<br />&nbsp; &nbsp; &nbsp; &nbsp; IF !RLock()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nSeconds --<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF &nbsp;nSeconds > 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NET_WAIT ( &nbsp;nSeconds )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DELETE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lReturn := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; ENDDO<br />&nbsp; &nbsp; IF &nbsp;nSeconds = 0<br />&nbsp; &nbsp; &nbsp; &nbsp; IF MsgYesNo( "</span>Not possible <span style="color: #0000ff;">to</span> delete a Record <span style="color: #0000ff;">of</span><span style="color: #ff0000;">" + upper(cDatabase) + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"</span> <span style="color: #00C800;">try</span> again ?<span style="color: #ff0000;">", "</span>Network-Error !<span style="color: #ff0000;">" )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nSeconds := ntrcount<br />&nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lReturn := .F.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; ENDIF<br />ENDDO<br />if lReturn = .F.<br />&nbsp; &nbsp; MsgAlert("</span>The Record is not deleted !!!<span style="color: #ff0000;">", "</span>Attention !<span style="color: #ff0000;">")<br />endif<br /><br />RETURN lReturn<br /><br />// ----------------------------------------------<br /><br />FUNCTION NET_APPEND ( ntrials, ntime )<br /><br />LOCAL &nbsp; lReturn := .F.<br />LOCAL &nbsp; ntrcount := 0<br />LOCAL &nbsp; nZSek &nbsp; := 0<br /><br />ntrcount := ntrials<br /><br />DO WHILE !lReturn<br />&nbsp; &nbsp; DO WHILE ntrials > 0<br />&nbsp; &nbsp; &nbsp; &nbsp; DBAppend()<br />&nbsp; &nbsp; &nbsp; &nbsp; IF NetErr()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials --<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IF ntrials > 0 .AND. ntime > 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NET_WAIT ( ntrcount, ntrials, ntime )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lReturn := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; ENDDO<br />&nbsp; &nbsp; IF ntrials = 0<br />&nbsp; &nbsp; &nbsp; &nbsp; IF MsgYesNo( "</span>Append in : <span style="color: #ff0000;">" + upper(cDBName) + "</span> not possible !<span style="color: #ff0000;">" + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "</span> <span style="color: #00C800;">Try</span> again ?<span style="color: #ff0000;">", "</span>Network Error !<span style="color: #ff0000;">" )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lOpen &nbsp; &nbsp; :=.T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ntrials := ntrcount<br />&nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lReturn := .F.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lOpen &nbsp; := .F.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp; ENDIF<br />&nbsp; &nbsp; ENDIF<br />ENDDO<br />if lReturn = .F.<br />&nbsp; &nbsp; nMsgBox ( "</span>No Record appended !!!<span style="color: #ff0000;">", "</span>Attention !<span style="color: #ff0000;">")<br />endif<br /><br />RETURN lReturn<br /><br />// ----------------------------------------<br />// --------- DBF Array ----------------<br /><br />STATIC FUNCTION NEW_DBF()<br />LOCAL DBFARRAY := {}<br /><br />AADD(DBFARRAY, { "</span>CODIGO<span style="color: #ff0000;">",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "</span>C<span style="color: #ff0000;">", &nbsp;2, 0 })<br />AADD(DBFARRAY, { "</span>N_FAM<span style="color: #ff0000;">",&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "</span>C<span style="color: #ff0000;">", 250, 0 })<br /><br />cDbfName := c_Path + "</span>F_REG.DBF<span style="color: #ff0000;">"<br /><br />DELETE FILE &cDbfName<br /><br />IF LEN(DBFARRAY) == 0<br />&nbsp; &nbsp; MsgInfo( "</span>DBF Structure-Error<span style="color: #ff0000;">", "</span><span style="color: #00C800;">New</span> Structure<span style="color: #ff0000;">" )<br />&nbsp; &nbsp; RETURN NIL<br />ENDIF<br /><br />DBCREATE( cDbfName, DBFARRAY )<br />// DbCreate(cDir+'CL',{ {aClienti[1],aClienti[2],aClienti[3],aClienti[4]}} , 'DBFCDX')<br /><br />DBSELECTAREA( 1 )<br />NET_USE (c_Path + "</span>F_REG.DBF<span style="color: #ff0000;">", 3,.T.)<br /><br />NET_APPEND ( 3, 3 )<br />IF NET_RLOCK( 5, 5 )<br />&nbsp; &nbsp; (1)->CODIGO := &nbsp;"</span>DOURO<span style="color: #ff0000;">"<br />&nbsp; &nbsp; (1)->NOME &nbsp; := &nbsp;"</span>REGIÃO <span style="color: #00C800;">DO</span> DOURO<span style="color: #ff0000;">"<br />&nbsp; &nbsp; NET_ULOCK()<br />ENDIF<br />NET_APPEND ( 3, 3 )<br />IF NET_RLOCK( 5, 5 )<br />&nbsp; &nbsp; (1)->CODIGO := &nbsp;"</span>ALENTEJO<span style="color: #ff0000;">"<br />&nbsp; &nbsp; (1)->NOME &nbsp; := &nbsp;"</span>REGIÃO <span style="color: #00C800;">DO</span> ALENTEJO<span style="color: #ff0000;">"<br />&nbsp; &nbsp; NET_ULOCK()<br />ENDIF<br />NET_APPEND ( 3, 3 )<br />IF NET_RLOCK( 5, 5 )<br />&nbsp; &nbsp; (1)->CODIGO := &nbsp;"</span>LISBOA<span style="color: #ff0000;">"<br />&nbsp; &nbsp; (1)->NOME &nbsp; := &nbsp;"</span>REGIÃO DE LISBOA<span style="color: #ff0000;">"<br />&nbsp; &nbsp; NET_ULOCK()<br />ENDIF<br /><br />COMMIT<br />DBGOTOP()<br />NET_CLOSE ( 3,5,.T.)<br /><br />IF File( cDbfName )<br />&nbsp; &nbsp; MsgInfo( "</span>Novo DBF Criado! <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">" + ALLTRIM(STR(LEN(DBFARRAY))) + "</span> registos <span style="color: #000000;">&#41;</span><span style="color: #ff0000;">", "</span>Nova Estrutura<span style="color: #ff0000;">" )<br />ELSE<br />&nbsp; &nbsp; MsgAlert( "</span>Não consiguiu criar novo ficheiro!<span style="color: #ff0000;">","</span>Projecto-Ficheiro<span style="color: #ff0000;">")<br />ENDIF<br /><br />RETURN NIL<br /><br /></span></div>[/code:1ora3fu4] metropnl.ch [code=fw:1ora3fu4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*<br />*<br />* &nbsp; MetroPnl.ch<br />*<br />*<br />*/</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />#ifndef DT_TOP<br /><span style="color: #00D7D7;">#define</span> DT_TOP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> DT_LEFT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> DT_CENTER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> DT_RIGHT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> DT_VCENTER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">4</span><br /><span style="color: #00D7D7;">#define</span> DT_BOTTOM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">8</span><br /><span style="color: #00D7D7;">#define</span> DT_WORDBREAK &nbsp; &nbsp; &nbsp; <span style="color: #000000;">16</span><br /><span style="color: #00D7D7;">#define</span> DT_SINGLELINE &nbsp; &nbsp; &nbsp;<span style="color: #000000;">32</span><br /><span style="color: #00D7D7;">#define</span> DT_CALCRECT &nbsp; &nbsp; &nbsp;<span style="color: #000000;">1024</span><br />#endif<br /><br />#xcommand <span style="color: #0000ff;">DEFINE</span> METROPANEL <oMetro> <span style="color: #0000ff;">OF</span> <oWnd> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">TITLE</span> <cTitle> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">COLOR</span> <nClrText>, <nClrPane> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> TILESIZE <nSize> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CLICK</span> <uAction> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> SCROLLBARCOLOR <nClrThumb>, <nClrScroll> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; => ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <oMetro> := TMetroPanel<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <oWnd>, <cTitle>, <nClrText>, <nClrPane>, <<span style="color: #000000;">&#123;</span>uAction<span style="color: #000000;">&#125;</span>>, <nSize>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<nClrThumb>, <nClrScroll> <span style="color: #000000;">&#41;</span><br /><br />#xcommand <span style="color: #0000ff;">DEFINE</span> METROBUTTON <span style="color: #000000;">&#91;</span><oBtn><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">OF</span> <oMetro> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <prmt:<span style="color: #0000ff;">PROMPT</span>,CAPTION> <cPrompt> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">COLOR</span> <nClrText>, <nClrPane> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> ALIGN <nAlign> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">FONT</span> &nbsp;<oFont> &nbsp;<span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> GROUP <nGroup> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">MENU</span> <oSub> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <bmp:<span style="color: #000000;">BITMAP</span>,IMAGE> <cImgName> <span style="color: #000000;">&#91;</span> BMPALIGN <nBmpAlign> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">SIZE</span> <nBmpWidth>,<nBmpHeight> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> BACKGROUND <cImage> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <large: <span style="color: #000000;">LARGE</span>> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <txt:<span style="color: #000000;">BODY</span>,BODYTEXT,TEXT> <cText> <span style="color: #000000;">&#91;</span> TEXTALIGN <nTextAlign> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#91;</span> TEXTFONT <oTextFont> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <span style="color: #0000ff;">ACTION</span> <uAction,...> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; => ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span> <oBtn> := <span style="color: #000000;">&#93;</span> <oMetro>:<span style="color: #000000;">AddButton</span><span style="color: #000000;">&#40;</span> <.large.>, <nGroup>, <cPrompt>, <span style="color: #000000;">&#91;</span><<span style="color: #000000;">&#123;</span>uAction<span style="color: #000000;">&#125;</span>><span style="color: #000000;">&#93;</span>, <nClrText>, <nClrPane>, &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<cImgName>, <oFont>, <nAlign>, <nBmpAlign>, <nBmpWidth>, <nBmpHeight>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<cText>, <nTextAlign>, <oTextFont>, <oSub>, <cImage>, <<span style="color: #ff0000;">"uAction"</span>>, <<span style="color: #ff0000;">"oSub"</span>> <span style="color: #000000;">&#41;</span><br /><br />#xcommand ADD <span style="color: #000000;">&#91;</span><oBtn><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">TO</span> METRO <oMetro> <span style="color: #000000;">&#91;</span><clauses,...><span style="color: #000000;">&#93;</span> => ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> METROBUTTON <span style="color: #000000;">&#91;</span><oBtn><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">OF</span> <oMetro> <span style="color: #000000;">&#91;</span><clauses><span style="color: #000000;">&#93;</span><br />&nbsp;</div>[/code:1ora3fu4] metropnl.prg [code=fw:1ora3fu4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*<br />*<br />* &nbsp;MetroPnl.Prg<br />*<br />*/</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"metropnl.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbcompat.ch"</span> &nbsp;<span style="color: #B900B9;">// important</span><br /><br /><span style="color: #B900B9;">// CLASSES: TMetroPanel and TMetroBtn</span><br /><br /><span style="color: #00D7D7;">#define</span> BTN_GAP &nbsp; &nbsp; &nbsp; <span style="color: #000000;">8</span><br /><span style="color: #00D7D7;">#define</span> GRP_GAP &nbsp; &nbsp; &nbsp;<span style="color: #000000;">32</span><br /><span style="color: #00D7D7;">#define</span> SCRLB_HEIGHT <span style="color: #000000;">20</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> oDragWnd<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TMetroPanel <span style="color: #0000ff;">FROM</span> TPanel<br /><br />&nbsp; &nbsp;CLASSDATA lRegistered AS LOGICAL<br />&nbsp; &nbsp;CLASSDATA oActive &nbsp;<span style="color: #B900B9;">// for internal use</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//</span><br />&nbsp; &nbsp;CLASSDATA nBtnSize, nMetroRows, nMetroTop, nMetroMargin, nSliderTop<br />&nbsp; &nbsp;<span style="color: #B900B9;">//</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nOffset &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nScrollRange &nbsp; <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nScrollRatio &nbsp; <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;oFont, oFontB<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;oBtnFont, oTextFont<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nGroups &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">INIT</span> <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;aButtons &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">INIT</span> Array<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;lArranged &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">INIT</span> .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;lDesignMode &nbsp; &nbsp;<span style="color: #0000ff;">INIT</span> .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nClrScroll<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nClrThumb<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nMetroWidth, nThumbSize, nThumbWidth<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nThumbPos &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">INIT</span> <span style="color: #000000;">60</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;hPen<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;cTitle<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nRow, nCol<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;oParent<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// lDrag, nDragRow, nOldCol used for metro sliding by dragging on screen or scrollbar</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;lDrag <span style="color: #0000ff;">INIT</span> .F.<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nDragRow<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nOldCol <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nScrollBarTop<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oWnd, cTitle, nClrText, nClrPane, bLClicked, nBtnSize, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nClrThumb, nClrScroll <span style="color: #000000;">&#41;</span> CONSTRUCTOR<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> AddButton<span style="color: #000000;">&#40;</span> lLarge, nGroup, cCaption, bAction, nClrText, nClrPane, cImgName, oFont, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nAlign, nBmpAlign, nBmpWidth, nBmpHeight, cText, nTextAlign, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oTextFont, oSubMetro, cBackImage <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> Show<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">Arrange</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">ReSize</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">Super</span>:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">lVisible</span> := .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> Hide<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">lVisible</span> := .f. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> Arrange<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> LButtonDown<span style="color: #000000;">&#40;</span> nRow, nCol, nFlags <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> LButtonUp<span style="color: #000000;">&#40;</span> nRow, nCol, nFlags <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> MouseMove<span style="color: #000000;">&#40;</span> nRow, nCol, nFlags <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> MoveBtn<span style="color: #000000;">&#40;</span> oBtnDrag, oBtnOver <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> SwitchTo<span style="color: #000000;">&#40;</span> oNext, lRight <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> MouseWheel<span style="color: #000000;">&#40;</span> nKey, nDelta, nXPos, nYPos <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> Slide<span style="color: #000000;">&#40;</span> nPixels <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> ProgramCode<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> Destroy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oWnd, cTitle, nClrText, nClrPane, bLClicked, nBtnSize, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nClrThumb, nClrScroll <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> cTitle := <span style="color: #ff0000;">"Start"</span>, nClrText := CLR_WHITE, nClrPane := CLR_GREEN<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">nBtnSize</span> &nbsp; &nbsp; &nbsp;:= IfNil<span style="color: #000000;">&#40;</span> nBtnSize, <span style="color: #000000;">132</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">nMetroRows</span> &nbsp; &nbsp;:= Int<span style="color: #000000;">&#40;</span> GetSysMetrics<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> / <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBtnSize</span> + BTN_GAP <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">nMetroTop</span> &nbsp; &nbsp; := ::<span style="color: #000000;">nBtnSize</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">nMetroMargin</span> &nbsp;:= ::<span style="color: #000000;">nBtnSize</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Super</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, GetSysMetrics<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> , GetSysMetrics<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, oWnd <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">cTitle</span> &nbsp; &nbsp; = cTitle<br />&nbsp; &nbsp;::<span style="color: #000000;">nRow</span> &nbsp; &nbsp; &nbsp; = &nbsp; <span style="color: #000000;">0</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nCol</span> &nbsp; &nbsp; &nbsp; = &nbsp; <span style="color: #000000;">0</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nClrThumb</span> &nbsp;= nClrThumb<br />&nbsp; &nbsp;::<span style="color: #000000;">nClrScroll</span> = nClrScroll<br />&nbsp; &nbsp;::<span style="color: #000000;">hPen</span> &nbsp; &nbsp; &nbsp; = CreatePen<span style="color: #000000;">&#40;</span> PS_SOLID, <span style="color: #000000;">2</span>, CLR_BLACK <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">nClrScroll</span> := RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">108</span>, <span style="color: #000000;">110</span>, <span style="color: #000000;">190</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nClrThumb</span> &nbsp;:= RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">148</span>, <span style="color: #000000;">150</span>, <span style="color: #000000;">230</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">oFont</span> &nbsp;<span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI Light"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-52</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">oFontB</span> <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI Light"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-60</span> BOLD<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">oBtnFont</span> &nbsp;<span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI Light"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-20</span> BOLD<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">oTextFont</span> <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI Light"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-16</span> BOLD<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">lVisible</span> &nbsp;:= .t.<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> nClrText, nClrPane <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">bLClicked</span> &nbsp; &nbsp;:= bLClicked<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">oActive</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oActive</span> := <span style="color: #00C800;">Self</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bLClicked</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oParent</span> == <span style="color: #00C800;">nil</span>,, ::<span style="color: #000000;">SwitchTo</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oParent</span>, .t. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oClient</span> &nbsp; &nbsp;:= <span style="color: #00C800;">Self</span><br />&nbsp; &nbsp;::<span style="color: #000000;">Hide</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;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aInfo<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oRect &nbsp; &nbsp;:= ::<span style="color: #000000;">GetCliRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hScrollBrush, hThumbBrush<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nBarTotal<br /><br />&nbsp; &nbsp;aInfo := ::<span style="color: #000000;">DispBegin</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;FillRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, oRect:<span style="color: #000000;">aRect</span>, ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBtnSize</span> - ::<span style="color: #000000;">oFont</span>:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span> / <span style="color: #000000;">2</span>, ::<span style="color: #000000;">nMetroTop</span>, ::<span style="color: #000000;">cTitle</span>,,, ::<span style="color: #000000;">oFont</span>, .t., .t. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">nScrollRange</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; hScrollBrush &nbsp; &nbsp; &nbsp;:= CreateSolidBrush<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrScroll</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; hThumbBrush &nbsp; &nbsp; &nbsp; := CreateSolidBrush<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrThumb</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nThumbWidth</span> &nbsp; &nbsp; := Int<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nThumbSize</span> * <span style="color: #000000;">&#40;</span> oRect:<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">120</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nBarTotal &nbsp; &nbsp; &nbsp; &nbsp; := oRect:<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">120</span> - ::<span style="color: #000000;">nThumbWidth</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nThumbPos</span> &nbsp; &nbsp; &nbsp; := Int<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Abs</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nOffSet</span> / ::<span style="color: #000000;">nScrollRange</span> <span style="color: #000000;">&#41;</span> * nBarTotal <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">60</span><br />&nbsp; &nbsp; &nbsp; oRect:<span style="color: #000000;">nTop</span> &nbsp; &nbsp; &nbsp; &nbsp;:= oRect:<span style="color: #000000;">nBottom</span> - SCRLB_HEIGHT<br />&nbsp; &nbsp; &nbsp; oRect:<span style="color: #000000;">nHeight</span> &nbsp; &nbsp; := SCRLB_HEIGHT<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nScrollBarTop</span> &nbsp; := oRect:<span style="color: #000000;">nTop</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nScrollRatio</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nScrollRange</span> / nBarTotal <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; FillRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, oRect:<span style="color: #000000;">aRect</span>, hScrollBrush <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; FillRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">&#123;</span> oRect:<span style="color: #000000;">nTop</span>, oRect:<span style="color: #000000;">nLeft</span> + ::<span style="color: #000000;">nThumbPos</span>, oRect:<span style="color: #000000;">nBottom</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRect:<span style="color: #000000;">nLeft</span> + ::<span style="color: #000000;">nThumbPos</span> + ::<span style="color: #000000;">nThumbWidth</span> <span style="color: #000000;">&#125;</span>, hThumbBrush <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DeleteObject<span style="color: #000000;">&#40;</span> hScrollBrush <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DeleteObject<span style="color: #000000;">&#40;</span> hThumbBrush <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; MoveTo<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, oRect:<span style="color: #000000;">nLeft</span> + <span style="color: #000000;">32</span>, oRect:<span style="color: #000000;">nTop</span> + &nbsp;<span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; LineTo<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, oRect:<span style="color: #000000;">nLeft</span> + <span style="color: #000000;">24</span>, oRect:<span style="color: #000000;">nTop</span> + <span style="color: #000000;">10</span>, ::<span style="color: #000000;">hPen</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; LineTo<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, oRect:<span style="color: #000000;">nLeft</span> + <span style="color: #000000;">32</span>, oRect:<span style="color: #000000;">nTop</span> + <span style="color: #000000;">16</span>, ::<span style="color: #000000;">hPen</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; MoveTo<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, oRect:<span style="color: #000000;">nRight</span> - <span style="color: #000000;">32</span>, oRect:<span style="color: #000000;">nTop</span> + &nbsp;<span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; LineTo<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, oRect:<span style="color: #000000;">nRight</span> - <span style="color: #000000;">24</span>, oRect:<span style="color: #000000;">nTop</span> + <span style="color: #000000;">10</span>, ::<span style="color: #000000;">hPen</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; LineTo<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, oRect:<span style="color: #000000;">nRight</span> - <span style="color: #000000;">32</span>, oRect:<span style="color: #000000;">nTop</span> + <span style="color: #000000;">16</span>, ::<span style="color: #000000;">hPen</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nScrollBarTop</span> &nbsp; := oRect:<span style="color: #000000;">nBottom</span> + <span style="color: #000000;">2</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bPainted</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"B"</span><br />&nbsp; &nbsp; &nbsp; Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bPainted</span>, ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">cPS</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">&#40;</span> aInfo <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Arrange<span style="color: #000000;">&#40;</span> lReArrange <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nGrpLeft &nbsp; &nbsp;:= ::<span style="color: #000000;">nMetroMargin</span> + ::<span style="color: #000000;">nOffset</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nGrpRight<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nGroup<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aBtns, nBtns, oBtn, nCols<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nRow, nCol, n<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lReArrange == .t.<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lArranged</span> := .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lArranged</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> nGroup := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> ::<span style="color: #000000;">nGroups</span><br />&nbsp; &nbsp; &nbsp; aBtns &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; nBtns &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> each oBtn in ::<span style="color: #000000;">aButtons</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oBtn:<span style="color: #000000;">nGroup</span> == nGroup<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aBtns, oBtn <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nBtns++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> oBtn:<span style="color: #000000;">lLarge</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nBtns++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; nCols &nbsp; &nbsp; := Ceiling<span style="color: #000000;">&#40;</span> nBtns / ::<span style="color: #000000;">nMetroRows</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nRow := nCol := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; nGrpRight &nbsp; &nbsp; &nbsp; &nbsp; := nGrpLeft<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> each oBtn in aBtns<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBtn:<span style="color: #000000;">lLarge</span>, nCol + <span style="color: #000000;">1</span>, nCol <span style="color: #000000;">&#41;</span> > nCols<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nRow++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nCol &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBtn:<span style="color: #000000;">nTop</span> &nbsp; &nbsp; &nbsp;:= ::<span style="color: #000000;">nMetroTop</span> &nbsp;+ nRow * <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBtnSize</span> + BTN_GAP <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBtn:<span style="color: #000000;">nLeft</span> &nbsp; &nbsp; := nGrpLeft + nCol * <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBtnSize</span> + BTN_GAP <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nGrpRight &nbsp; &nbsp; &nbsp;:= <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> nGrpRight, oBtn:<span style="color: #000000;">nLeft</span> + oBtn:<span style="color: #000000;">nWidth</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nCol++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oBtn:<span style="color: #000000;">lLarge</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nCol++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nScrollRange</span> &nbsp; &nbsp;:= nGrpLeft - ::<span style="color: #000000;">nMetroMargin</span> - ::<span style="color: #000000;">nOffSet</span><br />&nbsp; &nbsp; &nbsp; nGrpLeft &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= nGrpRight + GRP_GAP<br />&nbsp; &nbsp; &nbsp; nGrpRight &nbsp; &nbsp; &nbsp; &nbsp; := nGrpLeft<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span> nGroup<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">nMetroWidth</span> &nbsp; &nbsp; := nGrpRight - ::<span style="color: #000000;">nOffSet</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nScrollRange</span> &nbsp; &nbsp;:= <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nMetroWidth</span> - ScreenWidth<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nScrollRange</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nScrollRange</span> &nbsp; &nbsp;:= <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, ::<span style="color: #000000;">nScrollRange</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nThumbSize</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">1</span> - <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nScrollRange</span> / ::<span style="color: #000000;">nMetroWidth</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">lArranged</span> := .t.<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> LButtonDown<span style="color: #000000;">&#40;</span> nRow, nCol, nFlags <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nRow < ::<span style="color: #000000;">nScrollBarTop</span> .or. <span style="color: #000000;">&#40;</span> nCol >= ::<span style="color: #000000;">nThumbPos</span> .and. nCol <= <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nThumbPos</span> + ::<span style="color: #000000;">nThumbWidth</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lDrag</span> &nbsp; &nbsp; = .T.<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nDragRow</span> &nbsp;= nRow<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nOldCol</span> &nbsp; = nCol<br />&nbsp; &nbsp;<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;">METHOD</span> LButtonUp<span style="color: #000000;">&#40;</span> nRow, nCol, nFlags <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">lDrag</span> &nbsp; &nbsp; = .F.<br />&nbsp; &nbsp;::<span style="color: #000000;">nDragRow</span> &nbsp;= <span style="color: #00C800;">nil</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;">METHOD</span> MouseMove<span style="color: #000000;">&#40;</span> nRow, nCol, nFlags <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lDrag</span> .and. ::<span style="color: #000000;">nScrollRange</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nDragRow</span> < ::<span style="color: #000000;">nScrollBarTop</span> .and. nRow < ::<span style="color: #000000;">nScrollBarTop</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">Slide</span><span style="color: #000000;">&#40;</span> nCol - ::<span style="color: #000000;">nOldCol</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; elseif ::<span style="color: #000000;">nDragRow</span> > ::<span style="color: #000000;">nScrollBarTop</span> .and. nRow > ::<span style="color: #000000;">nScrollBarTop</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">Slide</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> Int<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nOldCol</span> - nCol <span style="color: #000000;">&#41;</span> * ::<span style="color: #000000;">nScrollRatio</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lDrag</span> &nbsp; &nbsp; := .f.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nDragRow</span> &nbsp;:= <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nOldCol</span> = nCol<br />&nbsp; &nbsp;<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;">METHOD</span> MoveBtn<span style="color: #000000;">&#40;</span> oBtnDrag, oBtnOver <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nDrag, nOver<br /><br />&nbsp; &nbsp;SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oDragWnd != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; oDragWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oDragWnd &nbsp; &nbsp;:= <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oBtnDrag == oBtnOver<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;nDrag &nbsp; &nbsp;:= AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aButtons</span>, <span style="color: #000000;">&#123;</span> |o| o == oBtnDrag <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;ADel<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aButtons</span>, nDrag, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nOver &nbsp; &nbsp;:= AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aButtons</span>, <span style="color: #000000;">&#123;</span> |o| o == oBtnOver <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;AIns<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aButtons</span>, nOver + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nDrag == nOver, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, oBtnDrag, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBtnDrag:<span style="color: #000000;">nGroup</span> &nbsp; := oBtnOver:<span style="color: #000000;">nGroup</span><br />&nbsp; &nbsp;::<span style="color: #000000;">lArranged</span> := .f.<br />&nbsp; &nbsp;::<span style="color: #000000;">Arrange</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;AEval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aButtons</span>, <span style="color: #000000;">&#123;</span> |o| o:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</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> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> ProgramCode<span style="color: #000000;">&#40;</span> lShow <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cPrg &nbsp;:= <span style="color: #ff0000;">''</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oTile<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lShow := .f.<br /><br />&nbsp; &nbsp;cPrg &nbsp;:= <span style="color: #ff0000;">"static function MakeMetroPanel( oWnd )"</span> + CRLF + CRLF<br />&nbsp; &nbsp;cPrg &nbsp;+= <span style="color: #ff0000;">" &nbsp; local oMetro, oBtn"</span> + CRLF + CRLF<br />&nbsp; &nbsp;cPrg &nbsp;+= <span style="color: #ff0000;">' &nbsp; DEFINE METROPANEL oMetro OF oWnd TITLE "'</span> + ::<span style="color: #000000;">cTitle</span> + <span style="color: #ff0000;">'" ;'</span> + CRLF<br />&nbsp; &nbsp;cPrg &nbsp;+= <span style="color: #ff0000;">' &nbsp; &nbsp; &nbsp;COLOR '</span> + cClrToCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">', '</span> + cClrToCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">' ;'</span> + CRLF<br />&nbsp; &nbsp;cPrg &nbsp;+= <span style="color: #ff0000;">' &nbsp; &nbsp; &nbsp;ON CLICK oWnd:End()'</span> + CRLF + CRLF<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lDesignMode</span><br />&nbsp; &nbsp; &nbsp; cPrg &nbsp;+= <span style="color: #ff0000;">' &nbsp; oMetro:lDesignMode := .t.'</span> + CRLF + CRLF<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> each oTile in ::<span style="color: #000000;">aButtons</span><br />&nbsp; &nbsp; &nbsp; cPrg &nbsp; &nbsp; += oTile:<span style="color: #000000;">ProgramCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp;cPrg &nbsp;+= CRLF + <span style="color: #ff0000;">"return oMetro"</span> + CRLF + CRLF<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lShow<br />&nbsp; &nbsp; &nbsp; ViewCode<span style="color: #000000;">&#40;</span> cPrg <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cPrg<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Destroy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">oFont</span>, ::<span style="color: #000000;">oFontB</span>, ::<span style="color: #000000;">oBtnFont</span>, ::<span style="color: #000000;">oTextFont</span><br />&nbsp; &nbsp;DeleteObject<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hPen</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">Destroy</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> SwitchTo<span style="color: #000000;">&#40;</span> oNext, lRight <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oClient</span> := oNext<br />&nbsp; &nbsp;oNext:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">oActive</span> &nbsp; := oNext<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> AddButton<span style="color: #000000;">&#40;</span> lLarge, nGroup, cCaption, bAction, nClrText, nClrPane, cImgName, oFont, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nAlign, nBmpAlign, nBmpWidth, nBmpHeight, cText, nTextAlign, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oTextFont, oSubMetro, cBackImage, cAction, cSub <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBtn<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nX := ::<span style="color: #000000;">nMetroMargin</span> + <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nRow</span> * <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBtnSize</span> + <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nY := ::<span style="color: #000000;">nMetroTop</span> + <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nCol</span> * <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBtnSize</span> + <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lLarge := .F.<br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nClrText := CLR_WHITE, nClrPane := NextClr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oBtn &nbsp;:= TMetroBtn<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nX, nY, lLarge, <span style="color: #00C800;">Self</span>, cCaption, cImgName, bAction, nAlign, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nBmpAlign, nBmpWidth, nBmpHeight, oFont, cText, nTextAlign, oTextFont, oSubMetro, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nGroup, cBackImage, cAction, cSub <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oBtn:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> nClrText, nClrPane <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBtn:<span style="color: #000000;">nClrCaption</span> &nbsp;:= nClrText<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> cBackImage <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span> .and. File<span style="color: #000000;">&#40;</span> cBackImage <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBtn:<span style="color: #000000;">SetBackGround</span><span style="color: #000000;">&#40;</span> cBacKImage <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aButtons</span>, oBtn <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">nCol</span>++<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lLarge<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nCol</span>++<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">nCol</span> > <span style="color: #000000;">5</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nRow</span>++<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nCol</span> = <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> oBtn<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> MouseWheel<span style="color: #000000;">&#40;</span> nKey, nDelta, nXPos, nYPos <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nMove &nbsp; &nbsp;:= Int<span style="color: #000000;">&#40;</span> nDelta / <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n, oBtn<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">oActive</span>:<span style="color: #000000;">Slide</span><span style="color: #000000;">&#40;</span> nDelta / <span style="color: #000000;">3</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;">METHOD</span> Slide<span style="color: #000000;">&#40;</span> nPixels <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aRect<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">nScrollRange</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nPixels > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nPixels &nbsp;:= <span style="color: #0000ff;">Min</span><span style="color: #000000;">&#40;</span> nPixels, -::<span style="color: #000000;">nOffSet</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nOffSet</span> + nPixels < -::<span style="color: #000000;">nScrollRange</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nPixels &nbsp;:= -::<span style="color: #000000;">nScrollRange</span>- ::<span style="color: #000000;">nOffSet</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nPixels != <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRect &nbsp; &nbsp; &nbsp; = GetClientRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> &nbsp;= IfNil<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSliderTop</span>, ::<span style="color: #000000;">nMetroTop</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> -= <span style="color: #000000;">&#40;</span> SCRLB_HEIGHT + <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ScrollWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, nPixels, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, aRect <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nOffSet</span> &nbsp; &nbsp;+= nPixels<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">nScrollRange</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TMetroBtn <span style="color: #0000ff;">FROM</span> TBtnBmp<br /><br />&nbsp; &nbsp;CLASSDATA lRegistered AS LOGICAL<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> nGroup &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> nMargin &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">INIT</span> <span style="color: #000000;">8</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> lLarge &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">INIT</span> .f.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> nCapAlign &nbsp; &nbsp;<span style="color: #0000ff;">INIT</span> nOr<span style="color: #000000;">&#40;</span> DT_TOP, DT_RIGHT <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> nBmpAlign &nbsp; &nbsp;<span style="color: #0000ff;">INIT</span> nOr<span style="color: #000000;">&#40;</span> DT_BOTTOM, DT_LEFT <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> nBmpTop, nBmpLeft, nBmpWidth, nBmpHeight<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> cBmpSource<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> cText<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> nTextAlign &nbsp; <span style="color: #0000ff;">INIT</span> nOr<span style="color: #000000;">&#40;</span> DT_RIGHT, DT_VCENTER <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> nClrCaption<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> oTextFont<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> cAction, cSub<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> oSub<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nTop, nLeft, lLarge, oMetro, cCaption, uImage, bAction, nAlign, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nBmpAlign, nBmpWidth, nBmpHeight, oFont, oSub, nGroup, cBackImage, cAction, cSub <span style="color: #000000;">&#41;</span> CONSTRUCTOR<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> LoadBitmaps<span style="color: #000000;">&#40;</span> uBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> DrawPrompt<span style="color: #000000;">&#40;</span> cPrompt, oFont, nColor, nAlign <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> DrawMultiLine<span style="color: #000000;">&#40;</span> cText, oFont, nColor, nAlign <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> DesignMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> AlignObject<span style="color: #000000;">&#40;</span> nRow, nCol <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> CalcBmpAlign<span style="color: #000000;">&#40;</span> lRecalc <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> SetBackGround<span style="color: #000000;">&#40;</span> cImage <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> SetBitmap<span style="color: #000000;">&#40;</span> cImage <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> ToggleSize<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> ProgramCode<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> Destroy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nTop, nLeft, lLarge, oMetro, cCaption, uImage, bAction, nAlign, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nBmpAlign, nBmpWidth, nBmpHeight, oFont, cText, nTextAlign, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oTextFont, oSub, nGroup, cBackImage, cAction, cSub <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nWidth &nbsp; := oMetro:<span style="color: #000000;">nBtnSize</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lLarge, oMetro:<span style="color: #000000;">nBtnSize</span> + <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nAlign := nOr<span style="color: #000000;">&#40;</span> DT_TOP, DT_RIGHT <span style="color: #000000;">&#41;</span>, nBmpAlign := nOr<span style="color: #000000;">&#40;</span> DT_BOTTOM, DT_LEFT <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cText &nbsp;:= <span style="color: #ff0000;">''</span>, nTextAlign := nOr<span style="color: #000000;">&#40;</span> DT_VCENTER, DT_RIGHT <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> nAlign <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span><br />&nbsp; &nbsp; &nbsp; nAlign &nbsp; &nbsp; &nbsp;:= StrToAlign<span style="color: #000000;">&#40;</span> nAlign, DT_TOP + DT_RIGHT <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> nBmpAlign <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span><br />&nbsp; &nbsp; &nbsp; nBmpAlign &nbsp; := StrToAlign<span style="color: #000000;">&#40;</span> nBmpAlign, DT_BOTTOM + DT_LEFT <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> nTextAlign <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span><br />&nbsp; &nbsp; &nbsp; nTextAlign &nbsp;:= StrToAlign<span style="color: #000000;">&#40;</span> nTextAlign, DT_VCENTER + DT_RIGHT <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nGroup := oMetro:<span style="color: #000000;">nGroups</span><br />&nbsp; &nbsp;oMetro:<span style="color: #000000;">nGroups</span> := <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> oMetro:<span style="color: #000000;">nGroups</span>, nGroup <span style="color: #000000;">&#41;</span><br />&nbsp; ::<span style="color: #000000;">nGroup</span> &nbsp; &nbsp; &nbsp; := nGroup<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">lLarge</span> &nbsp; &nbsp; &nbsp; := lLarge<br />&nbsp; &nbsp;::<span style="color: #000000;">lTransparent</span> &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp;::<span style="color: #000000;">nCapAlign</span> &nbsp; &nbsp;:= nAlign<br />&nbsp; &nbsp;::<span style="color: #000000;">nBmpAlign</span> &nbsp; &nbsp;:= nBmpAlign<br />&nbsp; &nbsp;::<span style="color: #000000;">nBmpWidth</span> &nbsp; &nbsp;:= nBmpWidth<br />&nbsp; &nbsp;::<span style="color: #000000;">nBmpHeight</span> &nbsp; := nBmpHeight<br />&nbsp; &nbsp;::<span style="color: #000000;">cText</span> &nbsp; &nbsp; &nbsp; &nbsp;:= cText<br />&nbsp; &nbsp;::<span style="color: #000000;">nTextAlign</span> &nbsp; := nTextAlign<br />&nbsp; &nbsp;::<span style="color: #000000;">oTextFont</span> &nbsp; &nbsp;:= oTextFont<br />&nbsp; &nbsp;::<span style="color: #000000;">oSub</span> &nbsp; &nbsp; &nbsp; &nbsp; := oSub<br />&nbsp; &nbsp;::<span style="color: #000000;">cAction</span> &nbsp; &nbsp; &nbsp;:= cAction<br />&nbsp; &nbsp;::<span style="color: #000000;">cSub</span> &nbsp; &nbsp; &nbsp; &nbsp; := cSub<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cText</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cText</span> &nbsp; &nbsp; := StrTran<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cText</span>, <span style="color: #ff0000;">';'</span>, CRLF <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Super</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nTop, nLeft, nWidth, oMetro:<span style="color: #000000;">nBtnSize</span>, uImage, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, bAction, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oMetro, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, .f., .t., cCaption, oFont, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, .f., <span style="color: #ff0000;">'BOTTOM'</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .f. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bAction</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oSub</span> == <span style="color: #00C800;">nil</span>,, <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oSub</span>:<span style="color: #000000;">oParent</span> := ::<span style="color: #000000;">oWnd</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">SwitchTo</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oSub</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> ::<span style="color: #000000;">oDragCursor</span> DRAG<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">bDragBegin</span> &nbsp; := <span style="color: #000000;">&#123;</span> |r,c,f,o| BtnDragBegin<span style="color: #000000;">&#40;</span> r,c,f,o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">bRClicked</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |r,c,f| ::<span style="color: #000000;">DesignMenu</span><span style="color: #000000;">&#40;</span>r,c,f<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">bMMoved</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |r,c,f,lDrag| <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> oDragWnd == <span style="color: #00C800;">nil</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nLeft</span> + ::<span style="color: #000000;">nWidth</span> > ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">Slide</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">nWidth</span> - ::<span style="color: #000000;">nLeft</span> - ::<span style="color: #000000;">nWidth</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nLeft</span> < <span style="color: #000000;">0</span> , ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">Slide</span><span style="color: #000000;">&#40;</span> -::<span style="color: #000000;">nLeft</span> + <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> , <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lDrag == .t., oDragWnd:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nTop</span> + r -oDragWnd:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nLeft</span> + c - oDragWnd:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">nHeight</span>, .t. <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span>oDragWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oDragWnd := <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">OnClick</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bAction</span> == <span style="color: #00C800;">nil</span>,,Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bAction</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aInfo, nStyle, aRect, hOldFont, hBmpOld, nOldClr, nZeroZeroClr<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cText<br /><br />&nbsp; &nbsp;aInfo &nbsp; &nbsp; &nbsp; := ::<span style="color: #000000;">DispBegin</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;FillRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> HasAlpha<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ABPaint<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">nBmpLeft</span>, ::<span style="color: #000000;">nBmpTop</span>, ::<span style="color: #000000;">hBitmap1</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; elseif .f.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DrawTransparent<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">hBitmap1</span>, ::<span style="color: #000000;">nBmpTop</span>, ::<span style="color: #000000;">nBmpLeft</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; elseif .t.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hBmpOld &nbsp; &nbsp; &nbsp; &nbsp;:= SelectObject<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nZeroZeroClr &nbsp; := GetPixel<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SelectObject<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, hBmpOld <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp; &nbsp; nOldClr = SetBkColor( ::hDC, CLR_WHITE )</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TransBmp<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap1</span>, ::<span style="color: #000000;">nBmpWidth</span>, ::<span style="color: #000000;">nBmpHeight</span>, nZeroZeroClr, ::<span style="color: #000000;">hDC</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nBmpLeft</span>, ::<span style="color: #000000;">nBmpTop</span>, ::<span style="color: #000000;">nBmpWidth</span>, ::<span style="color: #000000;">nBmpHeight</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp; &nbsp; SetBkColor( ::hDC, nOldClr )</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">DrawPrompt</span><span style="color: #000000;">&#40;</span> &nbsp;::<span style="color: #000000;">cCaption</span>, IfNil<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oFont</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBtnFont</span> <span style="color: #000000;">&#41;</span>, &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IfNil<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrCaption</span>, ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nCapAlign</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cText</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">DrawPrompt</span><span style="color: #000000;">&#40;</span> &nbsp;::<span style="color: #000000;">cText</span>, IfNil<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oTextFont</span>, ::<span style="color: #000000;">oFont</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oTextFont</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nClrText</span>, ::<span style="color: #000000;">nTextAlign</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">&#40;</span> aInfo <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;">METHOD</span> DrawPrompt<span style="color: #000000;">&#40;</span> cText, oFont, nColor, nAlign <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aRect, hOldFont<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'B'</span><br />&nbsp; &nbsp; &nbsp; cText &nbsp; &nbsp; &nbsp; := Eval<span style="color: #000000;">&#40;</span> cText, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;cText &nbsp; &nbsp;:= AllTrim<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> CRLF $ cText<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> ::<span style="color: #000000;">DrawMultiLine</span><span style="color: #000000;">&#40;</span> cText, oFont, nColor, nAlign <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; SetTextColor<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, nColor <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; SetBkMode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; hOldFont &nbsp; &nbsp;:= SelectObject<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, oFont:<span style="color: #000000;">hFont</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aRect &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> ::<span style="color: #000000;">nMargin</span>, ::<span style="color: #000000;">nMargin</span>, ::<span style="color: #000000;">nHeight</span> - ::<span style="color: #000000;">nMargin</span>, ::<span style="color: #000000;">nWidth</span> - ::<span style="color: #000000;">nMargin</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; DrawTextEx<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, cText, aRect, nOr<span style="color: #000000;">&#40;</span> nAlign, DT_SINGLELINE <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; SelectObject<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, hOldFont <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<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;">METHOD</span> DrawMultiLine<span style="color: #000000;">&#40;</span> cText, oFont, nColor, nAlign <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aRect, hOldFont, nTextHeight<br /><br />&nbsp; &nbsp;SetTextColor<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, nColor <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SetBkMode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;hOldFont &nbsp; &nbsp;:= SelectObject<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, oFont:<span style="color: #000000;">hFont</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;aRect &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> ::<span style="color: #000000;">nMargin</span>, ::<span style="color: #000000;">nMargin</span>, ::<span style="color: #000000;">nHeight</span> - ::<span style="color: #000000;">nMargin</span>, ::<span style="color: #000000;">nWidth</span> - ::<span style="color: #000000;">nMargin</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lAnd<span style="color: #000000;">&#40;</span> nAlign, nOr<span style="color: #000000;">&#40;</span> DT_VCENTER, DT_BOTTOM <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nTextHeight := DrawTextEx<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, cText, aRect, nOr<span style="color: #000000;">&#40;</span> DT_CALCRECT, DT_WORDBREAK <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> lAnd<span style="color: #000000;">&#40;</span> nAlign, DT_BOTTOM <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> &nbsp;:= ::<span style="color: #000000;">nHeight</span> - ::<span style="color: #000000;">nMargin</span> - nTextHeight<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> &nbsp;:= <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nHeight</span> - nTextHeight <span style="color: #000000;">&#41;</span> / <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;DrawTextEx<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, cText, aRect, nAlign <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SelectObject<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, hOldFont <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;">METHOD</span> LoadBitmaps<span style="color: #000000;">&#40;</span> uBmp <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hBmp &nbsp;:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hBmp1, nBmpWidth, nBmpHeight<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> uBmp <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'N'</span> .and. uBmp != <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> IsGdiObject<span style="color: #000000;">&#40;</span> uBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hBmp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := uBmp<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hBmp := LoadBitmap<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, uBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;elseif ValType<span style="color: #000000;">&#40;</span> uBmp <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #ff0000;">'.'</span> $ uBmp<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> File<span style="color: #000000;">&#40;</span> uBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> Lower<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Right</span><span style="color: #000000;">&#40;</span> uBmp, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'.bmp'</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hBmp := ReadBitmap<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, uBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hBmp &nbsp;:= FILoadImg<span style="color: #000000;">&#40;</span> uBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hBmp := LoadBitmap<span style="color: #000000;">&#40;</span> GetInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, uBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cBmpSource</span> &nbsp; := uBmp<br />&nbsp; &nbsp; &nbsp; nBmpWidth &nbsp; := nBmpWidth<span style="color: #000000;">&#40;</span> &nbsp;hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nBmpHeight &nbsp;:= nBmpHeight<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">nBmpWidth</span> := nBmpWidth, ::<span style="color: #000000;">nBmpHeight</span> := nBmpHeight<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nBmpWidth != ::<span style="color: #000000;">nBmpWidth</span> .or. nBmpHeight != ::<span style="color: #000000;">nBmpHeight</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hBmp &nbsp; &nbsp; := ResizeImg<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> hBmp1 := hBmp <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nBmpWidth</span>, ::<span style="color: #000000;">nBmpHeight</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DeleteObject<span style="color: #000000;">&#40;</span> hBmp1 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">CalcBmpAlign</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">hBitmap1</span> &nbsp;:= hBmp<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> CalcBmpAlign<span style="color: #000000;">&#40;</span> lRecalc <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lRecalc := .f.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lRecalc<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nBmpTop</span> := ::<span style="color: #000000;">nBmpLeft</span> := <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBmpWidth</span> <span style="color: #000000;">&#41;</span> .and. ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBmpHeight</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nBmpTop</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> lAnd<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBmpAlign</span>, DT_BOTTOM <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nBmpTop</span> &nbsp;:= ::<span style="color: #000000;">nHeight</span> - ::<span style="color: #000000;">nMargin</span> - ::<span style="color: #000000;">nBmpHeight</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;elseif lAnd<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBmpAlign</span>, DT_VCENTER <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nBmpTop</span> &nbsp;:= <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nHeight</span> - ::<span style="color: #000000;">nBmpHeight</span> <span style="color: #000000;">&#41;</span> / <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nBmpTop</span> &nbsp;:= ::<span style="color: #000000;">nMargin</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nBmpLeft</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> lAnd<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBmpAlign</span>, DT_RIGHT <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nBmpLeft</span> := ::<span style="color: #000000;">nWidth</span> - ::<span style="color: #000000;">nMargin</span> - ::<span style="color: #000000;">nBmpWidth</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;elseif lAnd<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBmpAlign</span>, DT_CENTER <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nBmpLeft</span> := <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nWidth</span> - ::<span style="color: #000000;">nBmpWidth</span> <span style="color: #000000;">&#41;</span> / <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nBmpLeft</span> := ::<span style="color: #000000;">nMargin</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> DesignMenu<span style="color: #000000;">&#40;</span> nRow, nCol, nFlags <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TmetroBtn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oPop, c<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">lDesignMode</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2007</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Large Size"</span> &nbsp; <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">&#123;</span> |o| o:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lLarge</span> <span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#125;</span> &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oMenuItem:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">ToggleSize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Colors"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Tile"</span> &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">SelColor</span><span style="color: #000000;">&#40;</span> .f. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Caption"</span> &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrCaption</span> := ChooseColor<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrCaption</span> <span style="color: #000000;">&#41;</span>, ::<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 />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"BodyText"</span> &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrText</span> := ChooseColor<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">&#41;</span>, ::<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 />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Set Images"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Tile"</span> &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">SetBackGround</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Bitmap"</span> &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">SetBitmap</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Edit Text"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Caption"</span> &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> c &nbsp;:= PadR<span style="color: #000000;">&#40;</span> IfNil<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cCaption</span>, <span style="color: #ff0000;">''</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">15</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> MsgGet<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Caption"</span>, <span style="color: #ff0000;">"Enter 15 Chars for Caption"</span>, @c <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cCaption</span> := AllTrim<span style="color: #000000;">&#40;</span> c <span style="color: #000000;">&#41;</span>, ::<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;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"BodyText"</span> &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> c := PadR<span style="color: #000000;">&#40;</span> IfNil<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cText</span>, <span style="color: #ff0000;">''</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">45</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> MsgGet<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Body Text"</span>, <span style="color: #ff0000;">"Enter 45 Chars for Body"</span>, @c <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cText</span> := StrTran<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> c <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">';'</span>, CRLF <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<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;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Align Elements"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Caption"</span> &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nCapAlign</span> &nbsp;:= ::<span style="color: #000000;">AlignObject</span><span style="color: #000000;">&#40;</span> nRow, nCol <span style="color: #000000;">&#41;</span>, ::<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 />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"BodyText"</span> &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nTextAlign</span> := ::<span style="color: #000000;">AlignObject</span><span style="color: #000000;">&#40;</span> nRow, nCol <span style="color: #000000;">&#41;</span>, ::<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 />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Bitmap"</span> &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBmpAlign</span> &nbsp;:= ::<span style="color: #000000;">AlignObject</span><span style="color: #000000;">&#40;</span> nRow, nCol <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">CalcBmpAlign</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, ::<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 />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">WHEN</span> ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Add New Tile"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">AddButton</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lLarge</span>, ::<span style="color: #000000;">nGroup</span>, <span style="color: #ff0000;">"New"</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">Arrange</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>:<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 />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Insert New Tile"</span> <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">MoveBtn</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">AddButton</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lLarge</span>, ::<span style="color: #000000;">nGroup</span>, <span style="color: #ff0000;">"New"</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"GenerateCode"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Tile"</span> &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">ProgramCode</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Metro"</span> &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">ProgramCode</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br /><br />&nbsp; &nbsp;oPop:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">&#40;</span> nRow, nCol, <span style="color: #00C800;">Self</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;">METHOD</span> AlignObject<span style="color: #000000;">&#40;</span> nRow, nCol <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nAlign<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n &nbsp;:= ::<span style="color: #000000;">nWidth</span> / <span style="color: #000000;">3</span><br /><br />&nbsp; &nbsp;nAlign &nbsp; := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nCol > n, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nCol > <span style="color: #000000;">&#40;</span> n + n <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;n &nbsp; &nbsp; &nbsp; &nbsp;:= ::<span style="color: #000000;">nHeight</span> / <span style="color: #000000;">3</span><br />&nbsp; &nbsp;nAlign &nbsp; += <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nRow > n, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nRow > <span style="color: #000000;">&#40;</span> n + n <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> nAlign<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> SetBackGround<span style="color: #000000;">&#40;</span> cImage <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> lSet &nbsp;:= .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBrush<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> cImage := cGetFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Image File (*.bmp,*.jpg,*.png)|*.bmp;*.jpg;*.png|"</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"Select Background Image"</span>,,CurDir<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> cImage <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush FILE cImage RESIZE<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">SetBrush</span><span style="color: #000000;">&#40;</span> oBrush <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">Resize</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">BRUSH</span> oBrush<br />&nbsp; &nbsp; &nbsp; lSet &nbsp; &nbsp; := .t.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> lSet<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> SetBitmap<span style="color: #000000;">&#40;</span> cImage <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> w, h, hBmp<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> cImage := cGetFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Image File (*.bmp,*.jpg,*.png,*.ico)|*.bmp;*.jpg;*.png;*.ico|"</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"Select Bitmap File"</span>,,CurDir<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> cImage <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DeleteObject<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nBmpTop</span> := ::<span style="color: #000000;">nBmpLeft</span> := <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nBmpWidth</span> := ::<span style="color: #000000;">nBmpHeight</span> := <span style="color: #000000;">50</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">LoadBitmaps</span><span style="color: #000000;">&#40;</span> cImage <span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">/*<br />&nbsp; &nbsp; &nbsp; w &nbsp; &nbsp; &nbsp; &nbsp;:= nBmpWidth( ::hBitmap1 )<br />&nbsp; &nbsp; &nbsp; h &nbsp; &nbsp; &nbsp; &nbsp;:= nBmpHeight(::hBitmap1 )<br />&nbsp; &nbsp; &nbsp; if w > ::nWidth / 3 .or. h > ::nHeight / 3<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hBmp &nbsp;:= ResizeBitmap( ::hBitmap1, ::nWidth / 3, ::nHeight / 3, 3 )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DeleteObject( ::hBitmap1 )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::hBitmap1 &nbsp;:= hBmp<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::CalcBmpAlign( .t. )<br />&nbsp; &nbsp; &nbsp; endif<br />*/</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> ToggleSize<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">lLarge</span> &nbsp; &nbsp; &nbsp; := ! ::<span style="color: #000000;">lLarge</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nWidth</span> &nbsp; &nbsp; &nbsp; := ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">nBtnSize</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lLarge</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">nBtnSize</span> + BTN_GAP, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">CalcBmpAlign</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">Arrange</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;AEval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">aButtons</span>, <span style="color: #000000;">&#123;</span> |o| o:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</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> ::<span style="color: #000000;">lLarge</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> ProgramCode<span style="color: #000000;">&#40;</span> lShow <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cPrg &nbsp;:= <span style="color: #ff0000;">''</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lShow := .f.<br /><br /><span style="color: #00D7D7;">#define</span> NL &nbsp;<span style="color: #ff0000;">' ;'</span> + CRLF<br /><br />&nbsp; &nbsp;cPrg &nbsp; &nbsp; := <span style="color: #ff0000;">' &nbsp; DEFINE METROBUTTON oBtn OF oMetro'</span><br />&nbsp; &nbsp;cPrg &nbsp; &nbsp; += NL + <span style="color: #ff0000;">' &nbsp; &nbsp; &nbsp; &nbsp;COLOR &nbsp; '</span> + cClrToCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">','</span> + cClrToCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cPrg &nbsp;+= NL + <span style="color: #ff0000;">' &nbsp; &nbsp; &nbsp;CAPTION &nbsp; "'</span> + ::<span style="color: #000000;">cCaption</span> + <span style="color: #ff0000;">'"'</span><br />&nbsp; &nbsp; &nbsp; cPrg &nbsp;+= NL + <span style="color: #ff0000;">' &nbsp; &nbsp; &nbsp; &nbsp;ALIGN &nbsp; "'</span> + AlignStr<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nCapAlign</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'"'</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">nGroup</span> > <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; cPrg &nbsp;+= NL + <span style="color: #ff0000;">' &nbsp; &nbsp; &nbsp; &nbsp;GROUP &nbsp; '</span> + LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nGroup</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">&#41;</span> .and. ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cBmpSource</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cPrg &nbsp;+= NL + <span style="color: #ff0000;">' &nbsp; &nbsp; &nbsp; BITMAP &nbsp; "'</span> + ::<span style="color: #000000;">cBmpSource</span> + <span style="color: #ff0000;">'"'</span><br />&nbsp; &nbsp; &nbsp; cPrg &nbsp;+= NL + <span style="color: #ff0000;">' &nbsp; &nbsp; BMPALIGN &nbsp; "'</span> + AlignStr<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBmpAlign</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'"'</span><br />&nbsp; &nbsp; &nbsp; cPrg &nbsp;+= NL + <span style="color: #ff0000;">' &nbsp; &nbsp; &nbsp; &nbsp; SIZE &nbsp; '</span> + LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBmpWidth</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">', '</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBmpHeight</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cText</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cPrg &nbsp;+= NL + <span style="color: #ff0000;">' &nbsp; &nbsp; BODYTEXT &nbsp; "'</span> + StrTran<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cText</span>, CRLF, <span style="color: #ff0000;">';'</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'"'</span><br />&nbsp; &nbsp; &nbsp; cPrg &nbsp;+= NL + <span style="color: #ff0000;">' &nbsp; &nbsp;TEXTALIGN &nbsp; "'</span> + AlignStr<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nTextAlign</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'"'</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">&#41;</span> .and. ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">cBmpFile</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cPrg &nbsp;+= NL + <span style="color: #ff0000;">' &nbsp; BACKGROUND &nbsp; "'</span> + ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">cBmpFile</span> + <span style="color: #ff0000;">'"'</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lLarge</span><br />&nbsp; &nbsp; &nbsp; cPrg &nbsp;+= NL + <span style="color: #ff0000;">' &nbsp; &nbsp; &nbsp; &nbsp;LARGE &nbsp; '</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cSub</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cPrg += NL + &nbsp;<span style="color: #ff0000;">' &nbsp; &nbsp; &nbsp; &nbsp; MENU &nbsp; '</span> + ::<span style="color: #000000;">cSub</span><br />&nbsp; &nbsp;elseif ! Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cAction</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cPrg += NL + &nbsp;<span style="color: #ff0000;">' &nbsp; &nbsp; &nbsp; ACTION &nbsp; '</span> + ::<span style="color: #000000;">cAction</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;cPrg += CRLF<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">nClrCaption</span> != ::<span style="color: #000000;">nClrText</span><br />&nbsp; &nbsp; &nbsp; cPrg &nbsp;+= <span style="color: #ff0000;">' &nbsp; oBtn:nClrCaption := '</span> + cClrToCode<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nClrCaption</span> <span style="color: #000000;">&#41;</span> + CRLF<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;cPrg &nbsp; &nbsp; += CRLF<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lShow<br />&nbsp; &nbsp; &nbsp; ViewCode<span style="color: #000000;">&#40;</span> cPrg <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />#undef NL<br /><br /><span style="color: #00C800;">return</span> cPrg<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> Destroy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">oDragCursor</span> != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">RELEASE</span> CUSROR ::<span style="color: #000000;">oDragCursor</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">Destroy</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">// SUPPORT FUNCTIONS</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> StrToAlign<span style="color: #000000;">&#40;</span> cAlign, nDefault <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> x, y<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nDefault := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;cAlign &nbsp; &nbsp; &nbsp;:= Upper<span style="color: #000000;">&#40;</span> cAlign <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;x &nbsp;:= <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'LEF'</span> $ cAlign, <span style="color: #000000;">0</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'CEN'</span> $ cAlign, <span style="color: #000000;">1</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'RIG'</span> $ cAlign, <span style="color: #000000;">2</span>, nAnd<span style="color: #000000;">&#40;</span> nDefault, &nbsp;<span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;y &nbsp;:= <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'TOP'</span> $ cAlign, <span style="color: #000000;">0</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'MID'</span> $ cAlign, <span style="color: #000000;">4</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'BOT'</span> $ cAlign, <span style="color: #000000;">8</span>, nAnd<span style="color: #000000;">&#40;</span> nDefault, <span style="color: #000000;">12</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> nOr<span style="color: #000000;">&#40;</span> x, y <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> AlignStr<span style="color: #000000;">&#40;</span> nAlign <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlign &nbsp; := <span style="color: #ff0000;">''</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n &nbsp; &nbsp; &nbsp; &nbsp;:= nAnd<span style="color: #000000;">&#40;</span> nAlign, <span style="color: #000000;">12</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;cAlign &nbsp; := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n == <span style="color: #000000;">8</span>, <span style="color: #ff0000;">'BOTTOM'</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n == <span style="color: #000000;">4</span>, <span style="color: #ff0000;">'MIDDLE'</span>, <span style="color: #ff0000;">'TOP'</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;n &nbsp; &nbsp; &nbsp; &nbsp;:= nAnd<span style="color: #000000;">&#40;</span> nAlign, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cAlign &nbsp; += <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n == <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'RIGHT'</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n == <span style="color: #000000;">1</span>, <span style="color: #ff0000;">'CENTER'</span>, <span style="color: #ff0000;">'LEFT'</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> cAlign<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> NextClr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">static</span> n &nbsp; &nbsp;:= <span style="color: #000000;">1</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cClr &nbsp;:= <span style="color: #ff0000;">"E0AE022770EA3C1FB54E98188546020EB15601B1D5ADA6491B30BB008DD49E313A00AB899B83715A0061863B0DADA84B"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nClr &nbsp;:= HexToNum<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cClr, n, <span style="color: #000000;">6</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;n &nbsp;+= <span style="color: #000000;">6</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> n > Len<span style="color: #000000;">&#40;</span> cClr <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; n &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> nClr<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> BtnDragBegin<span style="color: #000000;">&#40;</span> nRow, nCol, nFlags, oBtn <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBmp, hBmp<br /><br />&nbsp; &nbsp;SetDropInfo<span style="color: #000000;">&#40;</span> oBtn <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oDragWnd != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; oDragWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oDragWnd &nbsp; &nbsp;:= <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;hBmp &nbsp; &nbsp; := WndBitmap<span style="color: #000000;">&#40;</span> oBtn:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oDragWnd <span style="color: #0000ff;">COLOR</span> oBtn:<span style="color: #000000;">nClrText</span>, oBtn:<span style="color: #000000;">nClrPane</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STYLE</span> nOr<span style="color: #000000;">&#40;</span> WS_POPUP, WS_VISIBLE <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oDragWnd:<span style="color: #000000;">nOpacity</span> := <span style="color: #000000;">180</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> BITMAP oBmp <span style="color: #0000ff;">OF</span> oDragWnd <span style="color: #0000ff;">SIZE</span> oBtn:<span style="color: #000000;">nWidth</span>, oBtn:<span style="color: #000000;">nHeight</span> <span style="color: #0000ff;">PIXEL</span><br />&nbsp; &nbsp;oBmp:<span style="color: #000000;">hBitmap</span> &nbsp; := hBmp<br />&nbsp; &nbsp;oBmp:<span style="color: #000000;">bDropOver</span> &nbsp;:= <span style="color: #000000;">&#123;</span> |u,r,c,f| BtnDragEnd<span style="color: #000000;">&#40;</span> u,r,c,f <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oDragWnd:<span style="color: #000000;">Cargo</span> := <span style="color: #000000;">&#123;</span> nRow, nCol <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oDragWnd &nbsp;;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oDragWnd:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> oBtn:<span style="color: #000000;">nTop</span>,oBtn:<span style="color: #000000;">nLeft</span>,oBtn:<span style="color: #000000;">nWidth</span>,oBtn:<span style="color: #000000;">nHeight</span>,.t. <span style="color: #000000;">&#41;</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> BtnDragEnd<span style="color: #000000;">&#40;</span> oDragged, nRow, nCol, nFlags <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oMetro &nbsp; := oDragged:<span style="color: #000000;">oWnd</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hDropBtn, oDroppedOn<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> r, c, o<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oDragWnd != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; oDragWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oDragWnd := <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;r &nbsp;:= oDragged:<span style="color: #000000;">nTop</span> &nbsp;+ nRow<br />&nbsp; &nbsp;c &nbsp;:= oDragged:<span style="color: #000000;">nLeft</span> + nCol<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> r > 0x8000<br />&nbsp; &nbsp; &nbsp; r &nbsp;-= 0xffff<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> c > 0x8000<br />&nbsp; &nbsp; &nbsp; c &nbsp;-= 0xffff<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> each o in oMetro:<span style="color: #000000;">aButtons</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> r >= o:<span style="color: #000000;">nTop</span> .and. r <= o:<span style="color: #000000;">nTop</span> + o:<span style="color: #000000;">nHeight</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> c >= o:<span style="color: #000000;">nLeft</span> .and. c <= o:<span style="color: #000000;">nLeft</span> + o:<span style="color: #000000;">nWidth</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oDroppedOn := o<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oDroppedOn != <span style="color: #00C800;">nil</span> .and. oDroppedOn:<span style="color: #000000;">IsKindOf</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'TMETROBTN'</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oMetro:<span style="color: #000000;">MoveBtn</span><span style="color: #000000;">&#40;</span> oDragged, oDroppedOn <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<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;">static</span> <span style="color: #00C800;">function</span> ViewCode<span style="color: #000000;">&#40;</span> cCode <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oGet<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oFont<br /><br /><span style="color: #00D7D7;">#define</span> DLGWD &nbsp;<span style="color: #000000;">350</span> <span style="color: #B900B9;">//250</span><br /><span style="color: #00D7D7;">#define</span> DLGHT &nbsp;<span style="color: #000000;">250</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">'LUCIDA CONSOLE'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> DLGWD*<span style="color: #000000;">2</span>, DLGHT*<span style="color: #000000;">2</span> <span style="color: #0000ff;">PIXEL</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Program Code Generated"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cCode <span style="color: #0000ff;">TEXT</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> DLGWD<span style="color: #000000;">-10</span>,DLGHT<span style="color: #000000;">-45</span> <span style="color: #0000ff;">PIXEL</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp;@ DLGHT<span style="color: #000000;">-20</span>,<span style="color: #000000;">05</span> BUTTONBMP BITMAP <span style="color: #ff0000;">'..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>opy3.bmp'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">16</span>,<span style="color: #000000;">16</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> CopyToClip<span style="color: #000000;">&#40;</span> cCode <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ DLGHT<span style="color: #000000;">-20</span>,DLGWD<span style="color: #000000;">-21</span> BUTTONBMP BITMAP <span style="color: #ff0000;">'..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>lose.bmp'</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">16</span>,<span style="color: #000000;">16</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br />&nbsp; &nbsp;<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 /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CopyToClip<span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oClip<br /><br />&nbsp; &nbsp;oClip := TClipBoard<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><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oClip:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oClip:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oClip:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;oClip:<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></div>[/code:1ora3fu4]
Classe Metro
I can't understand why oBtn is nil after the first command: [code=fw:1lbf9d64]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> METROBUTTON oBtn <span style="color: #0000ff;">OF</span> oMetro1 ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PROMPT</span> FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">COLOR</span> CLR_WHITE, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">224</span> <span style="color: #000000;">&#41;</span> ; &nbsp;<span style="color: #B900B9;">// 1 primer campo</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">IMAGE</span> <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\m</span>etro<span style="color: #000000;">\f</span>iles.bmp"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> ShowRecords<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBtn:<span style="color: #000000;">Cargo</span> := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:1lbf9d64] Someone else see where the fail comes from ? We may be missing something...
Classe Metro
Antonio Linares, acho que os usuarios nao entram no forum portugues só entram no spanish ou english. com esse teste dá error: Error description: Error BASE/1003 Variable does not exist: SELF
Classe Metro
Debes estar usando nuevamente un metro.ch equivocado Genera el fichero PPO y copialo aqui, gracias
Classe Metro
Antonio, neste teste uso o metropnl.ch do \fwh\include e não o metro.ch compilado [code=fw:sgwll41a]<div class="fw" id="{CB}" style="font-family: monospace;">oMetro1 := TMetroPanel<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oWnd, <span style="color: #ff0000;">"Catálogo de Vinhos"</span>,,, <span style="color: #000000;">&#123;</span>|| msgalert<span style="color: #000000;">&#40;</span>ownd:<span style="color: #000000;">oCtlFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span>,,, <span style="color: #000000;">&#41;</span><br /><br />oMetro1:<span style="color: #000000;">lDesignMode</span> := .T.<br />lMetro<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := .T.<br />DBSELECTAREA<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">while</span> !eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><br />&nbsp; &nbsp; &nbsp; oBtn := oMetro1:<span style="color: #000000;">AddButton</span><span style="color: #000000;">&#40;</span> .F.,, FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#123;</span>|| ShowRecords<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> + <span style="color: #000000;">&#40;</span> <span style="color: #000000;">174</span> * <span style="color: #000000;">256</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">&#40;</span> <span style="color: #000000;">224</span> * <span style="color: #000000;">65536</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\m</span>etro<span style="color: #000000;">\f</span>iles.bmp"</span>,,,,,,,,,,, <span style="color: #ff0000;">"ShowRecords( ::Cargo )"</span>, <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBtn:<span style="color: #000000;">Cargo</span> := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />end<br /><br />&nbsp;</div>[/code:sgwll41a]
Classe Metro
Aqui falta Self: {| Self | ShowRecords( ::Cargo )} Falta la modificación al CH que te indiqué
Classe Metro
Antonio , A alteração que indicou foi no metro.ch mas nao funciona , teste alterar o metropnl.ch e funciona bem : [code=fw:fu8jj5zo]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #000000;">&#91;</span> <oBtn> := <span style="color: #000000;">&#93;</span> <oMetro>:<span style="color: #000000;">AddButton</span><span style="color: #000000;">&#40;</span> <.large.>, <nGroup>, <cPrompt>, <span style="color: #000000;">&#91;</span><span style="color: #000000;">&#123;</span>| <span style="color: #00C800;">Self</span> |<uAction><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#93;</span>, <nClrText>, <nClrPane>, &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<cImgName>, <oFont>, <nAlign>, <nBmpAlign>, <nBmpWidth>, <nBmpHeight>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<cText>, <nTextAlign>, <oTextFont>, <oSub>, <cImage>, <<span style="color: #ff0000;">"uAction"</span>>, <<span style="color: #ff0000;">"oSub"</span>> <span style="color: #000000;">&#41;</span></div>[/code:fu8jj5zo] funciona bem com metropnl.ch e nao com metro.ch. Gracias Maestro
Classe Metro
Ya no te da el error de Cargo ?
Classe Metro
no da error nenhum , quando click button return o recno() Gracias
Classe Metro
No entiendo bien lo que dices Sigue dando error ?
Classe Metro
Antonio, No, everything is fine, has no error , return the recno () right. when I click the right mouse button opens a menu, how to remove this menu? Thank´s
Classe Metro
Bom dia, Tem como fazer uma pesquisa , exemplo pesquisar o metrobutton que tem nClrCaption :="Nome Teste" e dar o focus nesse metrobutton , o metropanel deslizar para esse metrobutton? Cumprimentos João Alpande
Classe Metro
Joao, [quote="Joaoalpande":zs7id9jh]Antonio, No, everything is fine, has no error , return the recno () right. when I click the right mouse button opens a menu, how to remove this menu? Thank´s[/quote:zs7id9jh] Could you post a screenshot ? thanks
Classe Metro
Joao, [quote="Joaoalpande":28tmbozq]Bom dia, Tem como fazer uma pesquisa , exemplo pesquisar o metrobutton que tem nClrCaption :="Nome Teste" e dar o focus nesse metrobutton , o metropanel deslizar para esse metrobutton? Cumprimentos João Alpande[/quote:28tmbozq] Please post a screenshot or an example to test here. I don't understand what you mean, thanks
Classe Metro
[quote="Antonio Linares":1b54qvi0]Joao, [quote="Joaoalpande":1b54qvi0]Antonio, No, everything is fine, has no error , return the recno () right. when I click the right mouse button opens a menu, how to remove this menu? Thank´s[/quote:1b54qvi0] Could you post a screenshot ? thanks[/quote:1b54qvi0] this problem was solved , I changed the metropnl.prg line: // ::bRClicked := { |r,c,f| ::DesignMenu(r,c,f) } Thank´s João ALpande
Classe Metro
[quote="Antonio Linares":23umzrhz]Joao, [quote="Joaoalpande":23umzrhz]Bom dia, Tem como fazer uma pesquisa , exemplo pesquisar o metrobutton que tem nClrCaption :="Nome Teste" e dar o focus nesse metrobutton , o metropanel deslizar para esse metrobutton? Cumprimentos João Alpande[/quote:23umzrhz] Please post a screenshot or an example to test here. I don't understand what you mean, thanks[/quote:23umzrhz] I need to create a button where the user types the name of the wine , then metropanel should slide until this button is positioned in the registry that researched , excuse my English I am using translator. [code=fw:23umzrhz]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> ShowRecords<span style="color: #000000;">&#40;</span> NREC,oWnd,OMETRO  <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oMetro2, oBtn, oFont, oHScroll,oBtn1,oBtn2,oBt:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />    oMetro:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">IF</span> FILE<span style="color: #000000;">&#40;</span> c_Path + <span style="color: #ff0000;">"F_ART.DBF"</span> <span style="color: #000000;">&#41;</span><br />    DBSELECTAREA<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />    NET_USE <span style="color: #000000;">&#40;</span>c_Path + <span style="color: #ff0000;">"F_ART.DBF"</span>, <span style="color: #000000;">3</span>,.T.<span style="color: #000000;">&#41;</span><br />        <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> <span style="color: #000000;">2</span>->C_des     <span style="color: #0000ff;">TO</span> f_art<br />   <span style="color: #00C800;">ELSE</span><br />        MSGALERT<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ARQUIVO ARTIGOS INEXISTENTE"</span>,<span style="color: #ff0000;">"Atenção"</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI Light"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-30</span> BOLD<br /><br />   <span style="color: #0000ff;">DEFINE</span> METROPANEL oMetro2 <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"VINHOS"</span> ;<br />     <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;">64</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span>  <span style="color: #000000;">0</span>,  <span style="color: #000000;">0</span>,<span style="color: #000000;">64</span><span style="color: #000000;">&#41;</span><br />   D_BACKGRD<span style="color: #000000;">&#40;</span> oMetro2, <span style="color: #000000;">4</span>, , , , , , c_path1 + <span style="color: #ff0000;">"vinho3.Jpg"</span> <span style="color: #000000;">&#41;</span><br />   oMetro2:<span style="color: #000000;">lDesignMode</span> := .T.<br />   oMetro2:<span style="color: #000000;">nMetroTop</span> = <span style="color: #000000;">120</span><br />   oMetro2:<span style="color: #000000;">nMetroMargin</span> = <span style="color: #000000;">20</span><br />   oMetro2:<span style="color: #000000;">nBtnSize</span> = <span style="color: #000000;">150</span><br />   oMetro2:<span style="color: #000000;">nSliderTop</span> = <span style="color: #000000;">120</span><br />   oWnd:<span style="color: #000000;">bMouseWheel</span> = <span style="color: #000000;">&#123;</span> | nKey, nDelta, nXPos, nYPos | oMetro2:<span style="color: #000000;">MouseWheel</span><span style="color: #000000;">&#40;</span> nKey, nDelta, nXPos, nYPos <span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> METROBUTTON oBtn <span style="color: #0000ff;">OF</span> oMetro2 ;<br />   <span style="color: #0000ff;">COLOR</span>   CLR_WHITE,RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>,  <span style="color: #000000;">0</span>,  <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> ;<br />          GROUP   <span style="color: #000000;">2</span> ;<br />           BITMAP   C_Path1+ <span style="color: #ff0000;">"back-black-48.png"</span> ;<br />     BMPALIGN   <span style="color: #ff0000;">"MIDDLECENTER"</span> ;<br />     LARGE;<br />       <span style="color: #0000ff;">ACTION</span>   <span style="color: #000000;">&#40;</span>NET_CLOSE <span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span>,<span style="color: #000000;">5</span>,.T.<span style="color: #000000;">&#41;</span>,oMetro2:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oMetro:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />  DBSELECTAREA<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />  SET FILTER <span style="color: #0000ff;">TO</span> val<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>->C_CODREG<span style="color: #000000;">&#41;</span>=nRec<br />  DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">WHILE</span> !EOF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>->C_DES<span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">DEFINE</span> METROBUTTON oBtn <span style="color: #0000ff;">OF</span> oMetro2 ;<br />      <span style="color: #0000ff;">PROMPT</span>  oemtoansi<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span>->C_DES<span style="color: #000000;">&#41;</span>;<br />      <span style="color: #0000ff;">COLOR</span>   CLR_WHITE,CLR_RED ;<br />      ALIGN   <span style="color: #ff0000;">"MIDDLECENTER"</span>  ;<br />      <span style="color: #0000ff;">FONT</span>  oFontSmall2 ;<br />      BODYTEXT   <span style="color: #ff0000;">"Preço "</span>+str<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span>->c_pvp,<span style="color: #000000;">6</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>  ;<br />      TEXTALIGN   <span style="color: #ff0000;">"BOTTOMCENTER"</span> ;<br />      large;<br />       <span style="color: #0000ff;">ACTION</span> Detalhe<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">Cargo</span>,oWnd  <span style="color: #000000;">&#41;</span><br />      oBtn:<span style="color: #000000;">Cargo</span> := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br />   DbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> END<br /> <span style="color: #0000ff;">DEFINE</span> METROBUTTON oBtn <span style="color: #0000ff;">OF</span> oMetro2 ;<br />   <span style="color: #0000ff;">COLOR</span>   CLR_WHITE,RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>,  <span style="color: #000000;">0</span>,  <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> ;<br />          GROUP   <span style="color: #000000;">2</span> ;<br />           BITMAP   C_Path1+ <span style="color: #ff0000;">"back-black-48.png"</span> ;<br />     BMPALIGN   <span style="color: #ff0000;">"MIDDLECENTER"</span> ;<br />     LARGE;<br />       <span style="color: #0000ff;">ACTION</span>   <span style="color: #000000;">&#40;</span>NET_CLOSE <span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span>,<span style="color: #000000;">5</span>,.T.<span style="color: #000000;">&#41;</span>,oMetro2:<span style="color: #000000;">Hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oMetro:<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /> oMetro2:<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:23umzrhz] [img:23umzrhz]http&#58;//i&#46;imgur&#46;com/3jfWqrp&#46;jpg[/img:23umzrhz]
Classe Metro
Joao, Do you have a demo of your program or can you post some more screenshots? Your program is looking very good. Best regards, Otto
Classe Metro
[quote="Otto":3odbp6t3]Joao, Do you have a demo of your program or can you post some more screenshots? Your program is looking very good. Best regards, Otto[/quote:3odbp6t3] Good Morning, is a small software with few screens, the f_reg.dbf f_regt.dbf f_art.dbf comes with the other software records . to enter do not need user or password [url:3odbp6t3]http&#58;//www&#46;4shared&#46;com/file/jv17uSoUce/VLWVINHO&#46;html[/url:3odbp6t3]
Classe Metro
Hello, thank you. But I can't download from this space. Can you upload to another place, please. Thanks in adance Otto
Classe Metro
Goog Morning, dropbox : [url:upu4ckq0]https&#58;//www&#46;dropbox&#46;com/s/murnkxh9aup13vg/VLWVINHO&#46;exe?dl=0[/url:upu4ckq0] your email address?
Classe Richedit
Ho un problema con la classe RichEdit. Questo è il codice: [code:223mkoh2] #include "Fivewin&#46;ch" #include "Richedit&#46;ch" FUNCTION MAIN&#40;&#41; LOCAL hDll &#58;= LOADLIBRARY&#40; "RICHED20&#46;DLL" &#41; LOCAL oDlg LOCAL oRich, cVar &#58;= "" DEFINE DIALOG oDlg FROM 0, 0 TO 15, 40 TITLE "Test Richedit" @ 0, 0 RICHEDIT oRich VAR cVar SIZE 160,80 OF oDlg @ 5, 11 BUTTON "&Second" ACTION DIALOG_2&#40;&#41; ACTIVATE DIALOG oDlg CENTER FREELIBRARY&#40; hDll &#41; RETURN NIL STATIC FUNCTION DIALOG_2&#40;&#41; LOCAL oDlg LOCAL oRich, cVar &#58;= "" DEFINE DIALOG oDlg FROM 30, 100 TO 45, 140 TITLE "Second" @ 0, 0 RICHEDIT oRich VAR cVar SIZE 160,80 OF oDlg @ 5, 11 BUTTON "&First" ACTION oDlg&#58;End&#40;&#41; ACTIVATE DIALOG oDlg RETURN NIL [/code:223mkoh2] Se chiudo il programma senza richiamare la seconda dialog è tutto ok. Se richiamo la seconda dialog, torno sulla prima e chiudo il programma ottengo questo errore: [b:223mkoh2]Harbour Exception Called from RESETOLEUNINIT(0)[/b:223mkoh2] Ho l'impressione che, quando chiudo la seconda dialog, la funzione RESetOleUnInit( ::hWnd ) del metodo SetOleInit() effettui il reset anche dell'oggetto della prima dialog. Potete aiutarmi? Grazie. Pier Luigi
Classe Richedit
Il tuo esempio a me non dà problemi. Uso le ultime versioni sia di FWH che di xHarbour (dal CVS) e BCC55. EMG
Classe Richedit
Io uso FWH 7.04 + Harbour + BCC55. Forse è un problema di Harbour ... Pier Luigi
Classe Richedit
Provato anche con Harbour (sempre ultima versione dal CVS): nessun problema. EMG
Classe Richedit
Anche con l'ultima versione di Harbour intercetto lo stesso errore. D'altra parte, la funzione Resetoleuninit() (che provoca l'errore) è contenuta nella libreria FIVEH.LIB. A questo punto dovrei acquistare l'ultima versione di FWH <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> Pier Luigi
Classe TFirebird para xHarbour 123 com Borland 7
Olá Alguém tem a classe TFirebird do Rodrigo Moreno para xHarbour 123 com Bcc 7, tentei contato com ele, mas ele não respondeu meus emails, sei que tem uma classe nova, estou precisando urgente dela.
Classe TFirebird para xHarbour 123 com Borland 7
Joao, Aqui tienes una que publicó William, por si te sirve: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?p=60182#p60182">viewtopic.php?p=60182#p60182</a><!-- l -->
Classe TGif
Olá, boa tarde! Existe alguma definição especifica do GIF para utilizar a classe TGif? Att., Oliveiros Junior
Classe TGif
Dear Oliveiros, The kind of GIF file that is needed is a standard GIF file that follows the GIF89a specification. This means that the GIF file should have the following characteristics: It should have a header that identifies the file as a GIF file and specifies the version of the format. The header should be six bytes long and contain the ASCII characters “GIF89a” It should have a logical screen descriptor that defines the dimensions and properties of the logical screen. The logical screen descriptor should be seven bytes long and contain the following fields: logical screen width, logical screen height, global color table flag, color resolution, sort flag, size of global color table, background color index, and pixel aspect ratio It should have a global color table that contains the colors used in the image. The global color table should be present if the global color table flag is set to 1 in the logical screen descriptor. The size of the global color table should be 2^(size of global color table + 1) bytes, where each byte represents one color component (red, green, or blue) of a color. It should have one or more image descriptors that define the dimensions and properties of each image in the file. The image descriptor should start with a byte containing the ASCII character “,”, followed by the following fields: image left position, image top position, image width, image height, local color table flag, interlace flag, sort flag, size of local color table, and local color table (optional). It should have one or more image data blocks that contain the compressed pixel data of each image in the file. The image data blocks should start with a byte containing the LZW minimum code size, followed by one or more sub-blocks of data. Each sub-block should start with a byte containing the size of the sub-block, followed by the actual data bytes. The last sub-block should have a size of zero, indicating the end of the image data It should have one or more graphic control extensions that specify the animation parameters of each image in the file. The graphic control extension should start with a byte containing the ASCII character “!”, followed by a byte containing the value 249, followed by a byte containing the block size (usually 4), followed by the following fields: reserved, disposal method, user input flag, transparent color flag, delay time, transparent color index, and block terminator (a byte containing the value 0 It should have an application extension that specifies the looping behavior of the animation. The application extension should start with a byte containing the ASCII character “!”, followed by a byte containing the value 255, followed by a byte containing the block size (usually 11), followed by the application identifier (“NETSCAPE”), followed by the application authentication code (“2.0”), followed by a sub-block containing the loop count, followed by a block terminator (a byte containing the value 0) It should have a trailer that marks the end of the file. The trailer should be a single byte containing the ASCII character “;”
Classe TGif
[quote="oliveiros junior":2fjibasv]Olá, boa tarde! Existe alguma definição especifica do GIF para utilizar a classe TGif? Att., Oliveiros Junior[/quote:2fjibasv] caro, explique: "definição especifica" ?? O que você quer saber realmente? Obg. abs. Regards, saludos.
Classe TGif
Thanks master Antonio.
Classe TGif
Olá Karinha, Tenho um gif que não roda de jeito nenhum com a TGif. Ao executar, ele sai do sistema sem gerar nenhuma mensagem. Vou verificar com quem fez o gif se ele atende as especificações citadas pelo Antônio Linhares acima. Obrigado pela atenção. Oliveiros Junior
Classe TGif
Oliveiros, como você está fazendo? [code=fw:1w6h777t]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"gif.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 />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Attention"</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">2</span>, <span style="color: #000000;">11</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Waiting to use the calculator"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> PlaceGif<span style="color: #000000;">&#40;</span> oDlg <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: #00C800;">function</span> PlaceGif<span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oGif<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">19</span>, <span style="color: #000000;">10</span> GIF oGif FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\g</span>ifs<span style="color: #000000;">\l</span>oading.gif"</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// &nbsp;LOCAL oGif</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// @ 61.50, 0 &nbsp;GIF oGif FILE ".\AMBIENTY.GIF" SIZE 230, 100 ADJUST</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/*<br />&nbsp; &nbsp;IF FILE( "AMBIENTY.GIF" )<br /><br />&nbsp; &nbsp; &nbsp; @ 54.00, 01 GIF oGif FILE ".\AMBIENTY.GIF" SIZE 1019, 240 ADJUST<br /><br />&nbsp; &nbsp; &nbsp; // TELA CHEIA<br />&nbsp; &nbsp; &nbsp; // @ 54.00, 01 GIF oGif FILE ".\AMBIENTY.GIF" SIZE 1019, 582 ADJUST<br /><br />&nbsp; &nbsp; &nbsp; oGif:lTransparent := .T.<br /><br />&nbsp; &nbsp;ENDIF<br />&nbsp; &nbsp;*/</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// &nbsp; @ 050, 900 GIF oGif FILE ".\HALO.GIF" SIZE 090, 080 ADJUST OF oRebar</span><br /><br /><span style="color: #0000ff;">Abs</span>.<br />&nbsp;</div>[/code:1w6h777t] Regards, saludos.
Classe TGif
Antonio, Gracias por le explicación pero solo queremos saber como se programan en FWH <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> <!-- s:o --><img src="{SMILIES_PATH}/icon_surprised.gif" alt=":o" title="Surprised" /><!-- s:o --> <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
Classe TGif
FWH\samples\testgif.prg, testgif2.prg, testgifr.prg
Classe TGif
Olá Karinha, Eu peguei os exemplos testgif.prg, testgif2.prg, testgifr.prg e apenas troquei o nome do meu gif e coloquei gif na pasta gifs. Ele compila mas não executa o programa. Att., Oliveiros Junior
Classe TGif
Hola a todos. Antonio, eso si es una magnifica explicación técnica de 10. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Yo, documentando y verificando que todo estaba correcto de este programa pReproducir ver 1.5 32bits que en breve subiré para que se pueda descargar, me paso lo mismo que a oliveiros junior. Una de las noches se me ocurrió cambiar el Gif de fondo blanco a otro de fondo negro, hice una copia de seguridad y sin probarlo lo deje. Al día siguiente ejecuto el programa y se cerraba automáticamente sin errores cuando el día anterior funciona perfectamente. No tenia ni idea que pasaba cuando el código estaba perfecto. Estuve probando de todo durante un par de horas y nada, hasta que decidí dejarlo todo exactamente igual a cuando funcionaba todo perfecto. Yo uso el Gif para emular un grafico de sonido y es la leche porque con los métodos puedes iniciarlo, pararlo, etc, cuando cambia de canción automáticamente, detenerlo, en espera o pararlo el programa lo detiene, lo para o deja que continúe. El truco es magnifico. [b:2jez93m9]Cual era el problema[/b:2jez93m9], pues sencillamente el archivo GIF. no son todos validos para FWH y ahora entenderéis la extensa explicación de Antonio. La clase funciona perfecta, si tenéis este problema es el GIF. oliveiros junior, tu problema es el GIF. Imagen1: [img:2jez93m9]https&#58;//i&#46;postimg&#46;cc/fySCQzNK/preproducir1&#46;jpg[/img:2jez93m9] Yo estoy usando como reproductor de música mi programa usando ActiveX con el API de WMP ( windows media player ). Según microsoft se queda como reproductor para windows 11 y posteriores. Espero que os sirva la explicación. Un abrazo; Javier Lloris <!-- e --><a href="mailto:javierllorisprogramador@gmail.com">javierllorisprogramador@gmail.com</a><!-- e --> Blogs personales: Programación: <!-- m --><a class="postlink" href="https://javierlloris.blogspot.com/">https://javierlloris.blogspot.com/</a><!-- m --> Japonés: <!-- m --><a class="postlink" href="https://bitacorajaponesa.blogspot.com/">https://bitacorajaponesa.blogspot.com/</a><!-- m --> Cubos de Rubik: <!-- m --><a class="postlink" href="https://www.instagram.com/jllorisperson">https://www.instagram.com/jllorisperson</a><!-- m --> ... 2ybz0gmvul Tengo una colección de unos 100 cubos de todo tipo de formas geométricas, todos resueltos, en instagram solo hay unos cuentos cubos.
Classe TOutLook2003 como 2007
Hola a todo el mundo. Seria posible, modificar la classe TOutLook2003, con los colores de 2007 ? Muchas gracias.
Classe TOutLook2003 como 2007
Pedro, Al inicio del código fuente de la clase TOutLook2003 estan estas líneas: [code=fw:3cwtzoxt]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#define</span> LIGHTBLUE &nbsp; &nbsp;nRGB<span style="color: #000000;">&#40;</span> &nbsp;<span style="color: #000000;">89</span>, <span style="color: #000000;">135</span>, <span style="color: #000000;">214</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#define</span> DARKBLUE &nbsp; &nbsp; nRGB<span style="color: #000000;">&#40;</span> &nbsp; <span style="color: #000000;">3</span>, &nbsp;<span style="color: #000000;">56</span>, <span style="color: #000000;">147</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#define</span> LIGHTORANGE1 nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">250</span>, <span style="color: #000000;">227</span>, <span style="color: #000000;">143</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#define</span> DARKORANGE1 &nbsp;nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">238</span>, <span style="color: #000000;">152</span>, <span style="color: #000000;">25</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#define</span> LIGHTCYAN &nbsp; &nbsp;nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">203</span>, <span style="color: #000000;">225</span>, <span style="color: #000000;">252</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#define</span> DARKCYAN &nbsp; &nbsp; nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">165</span>, <span style="color: #000000;">224</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#define</span> LIGHTORANGE2 nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">220</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#define</span> DARKORANGE2 &nbsp;nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">247</span>, <span style="color: #000000;">192</span>, <span style="color: #000000;">91</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:3cwtzoxt] Sólo tienes que modificar esos valores numéricos y recompilar outl2003.prg y enlazarlo como si fuese un PRG más de tu aplicación
Classe TOutLook2003 como 2007
Muchas gracias Antonio, ya esta resuelto.
Classe TOutLook2003 como 2007
Hola: ¿Cuál son esos valores?. Muchas gracias
Classe TOutLook2003 como 2007
No solo he modificado valores sino que he modificado la clase con una propiedad l2007. También he cambiado Gradient por gradientfull. No esta perfecto pero da el pego. Los cambios me he mirado la clase "TRBtn" en la Cabecera añadir [code=fw:263lum81]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Colors.ch"</span><br /><br /><span style="color: #B900B9;">// Colors Office 2007</span><br /><span style="color: #00D7D7;">#define</span> BLUEBOX0     RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">141</span>, <span style="color: #000000;">178</span>, <span style="color: #000000;">227</span> <span style="color: #000000;">&#41;</span>      <br /><span style="color: #00D7D7;">#define</span> BLUEBOX1     RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">197</span>, <span style="color: #000000;">210</span>, <span style="color: #000000;">223</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#define</span> BLUEBOX2     RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">237</span>, <span style="color: #000000;">242</span>, <span style="color: #000000;">248</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00D7D7;">#define</span> BLUE0        RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">218</span>, <span style="color: #000000;">229</span>, <span style="color: #000000;">243</span> <span style="color: #000000;">&#41;</span>      <br /><span style="color: #00D7D7;">#define</span> BLUE1        RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">199</span>, <span style="color: #000000;">216</span>, <span style="color: #000000;">237</span> <span style="color: #000000;">&#41;</span>      <br /><span style="color: #00D7D7;">#define</span> BLUE2        RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">194</span>, <span style="color: #000000;">217</span>, <span style="color: #000000;">240</span> <span style="color: #000000;">&#41;</span>      <br /><span style="color: #00D7D7;">#define</span> BLUE3        RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">191</span>, <span style="color: #000000;">219</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:263lum81] En las propiedades de la Clase (TOutLook2003) [code=fw:263lum81]<div class="fw" id="{CB}" style="font-family: monospace;"><br />    <span style="color: #00C800;">DATA</span>  l2007  <span style="color: #0000ff;">INIT</span> .F.<br /> </div>[/code:263lum81] En el Metodo (METHOD Paint() CLASS TOutLook2003) Declarar variable [code=fw:263lum81]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Local</span> aGrad<br /> </div>[/code:263lum81] Donde [code=fw:263lum81]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Gradient<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">&#123;</span> nTop, <span style="color: #000000;">0</span>, nTop + <span style="color: #000000;">7</span>, ::<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, DARKBLUE, LIGHTBLUE, .T. <span style="color: #000000;">&#41;</span>            <br /> </div>[/code:263lum81] Reemplazar por [code=fw:263lum81]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">If</span> ::<span style="color: #000000;">l2007</span><br />   aGrad         := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">0.3</span>, BLUE0, BLUE0 <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.7</span>, BLUE1, BLUE0 <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />   GradientFill<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, nTop , <span style="color: #000000;">0</span>, nTop + <span style="color: #000000;">7</span>, ::<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> , aGrad <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Else</span>   <br />   Gradient<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">&#123;</span> nTop, <span style="color: #000000;">0</span>, nTop + <span style="color: #000000;">7</span>, ::<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, DARKBLUE, LIGHTBLUE, .T. <span style="color: #000000;">&#41;</span>            <br /><span style="color: #00C800;">EndIf</span><br /> </div>[/code:263lum81] En las propiedades de la clase TOutLook2003Group [code=fw:263lum81]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #00C800;">DATA</span>   l2007     <span style="color: #0000ff;">INIT</span> .F.<br /> </div>[/code:263lum81] En el método (METHOD Paint( lOver ) CLASS TOutLook2003Group) Declarar variables [code=fw:263lum81]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">local</span> aGrad,aGradHigh,aGradOver<br /> </div>[/code:263lum81] Donde [code=fw:263lum81]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   Gradient<span style="color: #000000;">&#40;</span> hDC := oCon:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#123;</span> nTop, <span style="color: #000000;">0</span>, nTop + <span style="color: #000000;">30</span>, oCon:<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,;<br />             <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lOver, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lSelected</span>, ::<span style="color: #000000;">nClrEnd</span>, LIGHTORANGE2 <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nClrStart</span> <span style="color: #000000;">&#41;</span>,;<br />             <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lOver, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lSelected</span>, ::<span style="color: #000000;">nClrStart</span>, DARKORANGE2 <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nClrEnd</span> <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span>            <br /> </div>[/code:263lum81] Reemplazar por [code=fw:263lum81]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">If</span> ::<span style="color: #000000;">l2007</span><br />    aGrad         := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">0.3</span>, BLUE0, BLUE0 <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.7</span>, BLUE1, BLUE0 <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />    aGradHigh     := <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;">253</span>,<span style="color: #000000;">212</span>,<span style="color: #000000;">168</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">251</span>,<span style="color: #000000;">178</span>,<span style="color: #000000;">99</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, <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;">250</span>,<span style="color: #000000;">157</span>,<span style="color: #000000;">52</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">252</span>,<span style="color: #000000;">234</span>,<span style="color: #000000;">163</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />    aGradOver     := <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;">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;">253</span>, <span style="color: #000000;">222</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />    GradientFill<span style="color: #000000;">&#40;</span> hDC := oCon:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> , nTop, <span style="color: #000000;">0</span>, nTop + <span style="color: #000000;">30</span>, oCon:<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> , <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lOver, aGradOver , <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lSelected</span> , aGradHigh , aGrad<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Else</span><br />    Gradient<span style="color: #000000;">&#40;</span> hDC := oCon:<span style="color: #000000;">GetDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#123;</span> nTop, <span style="color: #000000;">0</span>, nTop + <span style="color: #000000;">30</span>, oCon:<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,;<br />             <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lOver, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lSelected</span>, ::<span style="color: #000000;">nClrEnd</span>, LIGHTORANGE2 <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nClrStart</span> <span style="color: #000000;">&#41;</span>,;<br />             <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lOver, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lSelected</span>, ::<span style="color: #000000;">nClrStart</span>, DARKORANGE2 <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">nClrEnd</span> <span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#41;</span>            <br /><span style="color: #00C800;">EndIf</span><br /> </div>[/code:263lum81] Espero que también te funcione mas o menos bien. Gracias. Pere
Classe TOutLook2003 como 2007
Pere, Puedes poner una imagen aqui de como ha quedado ? <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Usa <!-- w --><a class="postlink" href="http://www.imageshack.us">www.imageshack.us</a><!-- w -->
Classe TOutLook2003 como 2007
Hola Antonio, Aquí tienes una imagen de como ha quedado. [img:3vokqlvm]http&#58;//img202&#46;imageshack&#46;us/img202/2843/toutlook2003&#46;png[/img:3vokqlvm] a ver si te parece bien. Gracias.
Classe TOutLook2003 como 2007
Pere, Gracias por poner la imagen, si, se ve bien <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Classe TOutLook2003 como 2007
Antonio: ¿Y por qué los botones look 2007 no se ven como el azul de esa foto?. gracias <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Classe TOutLook2003 como 2007
Muy interesante <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Classe TPROGRESS com sinal de % é possível?
É possível utilizando a classe tprogress que apareça o sinal de %, igual é utilizando o METER? EX? ===..........10%............ aokisantos
Classe TPROGRESS com sinal de % é possível?
Aokisantos, No, el API de Windows no muestra el porcentaje en ese control
Classe TPROGRESS com sinal de % é possível?
gracias
Classe TPrinter
Bueno amigos mi consulta es la siguiente como puedo imprimir con la classe TPrinter en un boleta de venta de 7 cm ancho y 15 largo. yo en clipper lo haci asi: SetPrc(0,0) Do While .Not. Eof() @ fila,5 Say .... @ fila,10 say ... skip enddo como lo hago con la clase TPrinter
Classe TPrinter
tienes que crear el objeto de la tprinter define printer oprn bla bla bla y en lugar del @ te recomiendo imprimas en centimetros page do while .t. oprn:cmsay(2,2,"mi impresion") skip enddo endpage endprint nomas que asi te brinca como si fuera hoja tamaño carta si tu largo es menos, no recuerdo la forma de configurar a ese largo exactamente prueba con PrnSetSize( 25000, 11500 ) que es Ancho,Alto. Pero tiene varios formatos definidos, por si alguno te sirve por ejemplo SETPAGE(9) es formato A4 DMPAPER_LETTER 1 // Letter 8 1/2 x 11 in DMPAPER_LETTERSMALL 2 // Letter Small 8 1/2 x 11 in DMPAPER_TABLOID 3 // Tabloid 11 x 17 in DMPAPER_LEDGER 4 // Ledger 17 x 11 in DMPAPER_LEGAL 5 // Legal 8 1/2 x 14 in DMPAPER_STATEMENT 6 // Statement 5 1/2 x 8 1/2 in DMPAPER_EXECUTIVE 7 // Executive 7 1/4 x 10 1/2 in DMPAPER_A3 8 // A3 297 x 420 mm DMPAPER_A4 9 // A4 210 x 297 mm DMPAPER_A4SMALL 10 // A4 Small 210 x 297 mm DMPAPER_A5 11 // A5 148 x 210 mm DMPAPER_B4 12 // B4 250 x 354 DMPAPER_B5 13 // B5 182 x 257 mm DMPAPER_FOLIO 14 // Folio 8 1/2 x 13 in DMPAPER_QUARTO 15 // Quarto 215 x 275 mm DMPAPER_10X14 16 // 10x14 in DMPAPER_11X17 17 // 11x17 in DMPAPER_NOTE 18 // Note 8 1/2 x 11 in DMPAPER_ENV_9 19 // Envelope #9 3 7/8 x 8 7/8 DMPAPER_ENV_10 20 // Envelope #10 4 1/8 x 9 1/2 DMPAPER_ENV_11 21 // Envelope #11 4 1/2 x 10 3/8 DMPAPER_ENV_12 22 // Envelope #12 4 \276 x 11 DMPAPER_ENV_14 23 // Envelope #14 5 x 11 1/2 DMPAPER_CSHEET 24 // C size sheet DMPAPER_DSHEET 25 // D size sheet DMPAPER_ESHEET 26 // E size sheet DMPAPER_ENV_DL 27 // Envelope DL 110 x 220mm DMPAPER_ENV_C5 28 // Envelope C5 162 x 229 mm DMPAPER_ENV_C3 29 // Envelope C3 324 x 458 mm DMPAPER_ENV_C4 30 // Envelope C4 229 x 324 mm DMPAPER_ENV_C6 31 // Envelope C6 114 x 162 mm DMPAPER_ENV_C65 32 // Envelope C65 114 x 229 mm DMPAPER_ENV_B4 33 // Envelope B4 250 x 353 mm DMPAPER_ENV_B5 34 // Envelope B5 176 x 250 mm DMPAPER_ENV_B6 35 // Envelope B6 176 x 125 mm DMPAPER_ENV_ITALY 36 // Envelope 110 x 230 mm DMPAPER_ENV_MONARCH 37 // Envelope Monarch 3.875 x 7.5 in DMPAPER_ENV_PERSONAL 38 // 6 3/4 Envelope 3 5/8 x 6 1/2 in DMPAPER_FANFOLD_US 39 // US Std Fanfold 14 7/8 x 11 in DMPAPER_FANFOLD_STD_GERMAN 40 // German Std Fanfold 8 1/2 x 12 in DMPAPER_FANFOLD_LGL_GERMAN 41 // German Legal Fanfold 8 1/2 x 13 in saludos paco
Classe TPrinter
Utiliza la clase tDosPrn que puedes manipular las lineas y columnas como en clipper (si usas impresoras de matriz), yo utilizo esta clase para los formatos preimpresos y uso la clase Tprinter para los otros reportes. Saludos
Classe para TreeView
Olá! Que classe vocês costumam usar para TreeView? Preciso fazer um cadastro em esquema de árvore (plano de contas), com opções de incluir, excluir e alterar item, tipo assim: 1--- DESPESAS +---- 1.1 DESPESAS ADMINISTRATIVAS +----- 1.1.1 Salarios +----- 1.1.2 Encargos +----- 1.1.3 Etc +---- 1.2 TAL COISA 2--- RECEITAS Atualmente tenho este cadastro em um listbox, mas a visualizacao nao da a noção de hierarquia das contas ao usuário... [ ]'s Maurilio
Classe para TreeView
dá uma olhada em <!-- w --><a class="postlink" href="http://www.dbwide.com.ar">www.dbwide.com.ar</a><!-- w --> .. lá tem uma classe TTree muito boa...
Classe para TreeView
[quote="siscat":2it7axib]dá uma olhada em <!-- w --><a class="postlink" href="http://www.dbwide.com.ar">www.dbwide.com.ar</a><!-- w --> .. lá tem uma classe TTree muito boa...[/quote:2it7axib] O site está fora do ar... <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> [ ]'s Maurilio
Classe para TreeView
Se encuentra ubicado ahora en: <!-- m --><a class="postlink" href="http://vikthor.com.mx/fivewin/">http://vikthor.com.mx/fivewin/</a><!-- m --> Saludos.
Classe para exibir regua (centometros)
Olá, Alguém sabe se existe alguma classe para desenhar uma regua em uma window/dialog ? [img:mnenidqf]http&#58;//br&#46;geocities&#46;com/qiinformatica2000/regua&#46;png[/img:mnenidqf] Obrigado, Rossine.
Classe para exibir regua (centometros)
THERE WAS TREGLA BUt I not know where u can download it Pls ROssine can you send me at private email . Tanks
Classes ... anyone?
I have been programming in FiveWin, FWH and Harbour for a long time without really knowing what a class is? OK I'm not ashamed to admit I'm very thick, but could someone please explain how to use a class.prg file. I know there's lots of examples in FWH\source\classes\*.prg, but what does one do with a new class.prg file?
Classes ... anyone?
Hello SteveLai, [img:i5jbyw72]http&#58;//www&#46;pflegeplus&#46;com/fw_downloads/object&#46;jpg[/img:i5jbyw72] I will show the Logic on a program, i'm just working on. The Bar < Test > had before the same colours like < Colour-Gradient >, i changed the values. At start it shows default colors The Vars => e_COLOR1, e_COLOR2 and e_COLTEXT i changed from the outside. [code:i5jbyw72] // ------------------------------------------------------------------------ IF nCOLEND = "111" // Glass-Optik is shown REDEFINE INFOBAR oInfoBar2 ID 103 COLOR e_COLOR1 GLASS ; BITMAP e_BITMAP PROMPT SPACE&#40;e_POSLEFT&#41; + ; "Test" COLOR e_COLTEXT LEFT FONT oBFont ; OF oDlg5 UPDATE BORDER ELSE IF nORIENT = "1" // Horizontal Color REDEFINE INFOBAR oInfoBar2 ID 103 GRADIENT e_COLOR1, ; e_COLOR2 HORIZONTAL ; BITMAP e_BITMAP PROMPT SPACE&#40;e_POSLEFT&#41; + ; "Test" COLOR e_COLTEXT LEFT FONT oBFont ; OF oDlg5 UPDATE BORDER ENDIF IF nORIENT = "2" // Vertical Color REDEFINE INFOBAR oInfoBar2 ID 103 GRADIENT e_COLOR1, ; e_COLOR2 BITMAP e_BITMAP ; PROMPT SPACE&#40;e_POSLEFT&#41; + "Test" COLOR e_COLTEXT ; LEFT FONT oBFont OF oDlg5 UPDATE BORDER ENDIF ENDIF // When i press this Button, i want to show new values // --------------------------------------------------------------------- REDEFINE BUTTONBMP oBtn9 ID 601 OF oDlg5 ; ACTION &#40; NEW_COLOR&#40;oInfoBar2&#41; &#41; ; BITMAP "colors" PROMPT SPACE&#40;5&#41; + "&Test" TEXTRIGHT oBtn9&#58;cToolTip = &#123; "Bar-Color-Test", "Test", 1, CLR_BLACK, 14089979 &#125; &#46;&#46;&#46;&#46;&#46; &#46;&#46;&#46;&#46;&#46; //------------------------------ FUNCTION NEW_COLOR&#40;oInfoBar2&#41; When you want to use CLASS - informations, the function must know the OBJECT &#40; oInfoBar2 &#41;&#46; The functions are allways belong to a OBJECT &#40; in this sample => oInfobar2 &#41; e_COLTEXT, e_COLOR1 and e_COLOR2 have the new values i want to test&#46; oInfoBar2&#58;cPrompt &#58;= "Test" // Write "Test" to the Var => cPrompt oInfoBar2&#58;oFontPrompt &#58;= oBFont // Show a try-out Font for the Text oInfoBar2&#58;nClrPrompt &#58;= e_COLTEXT // Show a try-out Color for the Text IF e_COLEND = 9 // Glass - look oInfoBar2&#58;nClrLabel &#58;= e_COLOR1 // Show a try-out Color for the text oInfoBar2&#58;lDrawGradient &#58;= &#46;F&#46; oInfoBar2&#58;lGlass &#58;= &#46;T&#46; ELSE oInfoBar2&#58;nBeginColor &#58;= e_COLOR1 // Show a Color Start-Grad&#46; oInfoBar2&#58;nEndColor &#58;= e_COLOR2 // Show a Color End-Grad IF e_ORIENT = 1 oInfoBar2&#58;lVertGradient &#58;= &#46;F&#46; ENDIF IF e_ORIENT = 2 oInfoBar2&#58;lVertGradient &#58;= &#46;T&#46; ENDIF ENDIF oInfoBar2&#58;Paint&#40;&#41; // METHOD Paint&#40;&#41; oInfoBar2&#58;Refresh&#40;&#41; // REFRESH oInfoBar2 // With this, the BAR => oInfoBar2 is UPDATED with the new Values !!! // You send directly informations to the OBJECT oInfobar2 RETURN&#40; NIL &#41; Some Lines of the Class -------------------------------- // On Top there are DATA // These are the used vars inside the CLASS // and can be modified from outside // see Function NEW_COLOR&#40;oInfoBar2&#41; DATA cPrompt AS CHARACTER DATA nClrPrompt AS NUMERIC DATA oFontPrompt AS OBJECT DATA nClrLabel AS NUMERIC DATA lDrawGradient AS LOGICAL DATA lGlass AS LOGICAL DATA lVertGradient AS LOGICAL DATA nBeginColor AS NUMERIC DATA nEndColor AS NUMERIC // These DATAS i have given new Values // Then you have METHOD &#40; Functions &#41; METHOD Paint&#40;&#41; // I paint oInfoBar2 with the new values &#46;&#46;&#46;&#46;&#46; &#46;&#46;&#46;&#46;&#46; [/code:i5jbyw72] Maybe it shows the Logic a little bit. Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Classes ... anyone?
Steve, Sure you know about James „An Introduction to FiveWin“. (*****) I mention it here only in case if you don’t. Regards, Otto <!-- m --><a class="postlink" href="http://ourworld.compuserve.com/homepages/jbott/fwintro.htm">http://ourworld.compuserve.com/homepage ... wintro.htm</a><!-- m --> Intellitech does most of its software development in the FiveWin programming language. This section contains information primarily of interest to other FiveWin programmers. Feature Articles Introduction to FiveWin An article on programming in the FiveWin programming language. Discusses the basics: FiveWin, resources and resource editors, SDI & MDI windows, dialogs, menus, toolbars, message bars, buttons, colors, icons, etc. Also discusses the concept of a dataDialog class. Good for those just getting started with FiveWin and those considering FiveWin. Introduction to Object-Oriented Programming Using FiveWin: Part I Basics of OOP including encapsulation, inheritance, polymorphism and granularity. Also discusses Fivewin's class syntax. Introduction to Object-Oriented Programming Using FiveWin: Part II Covers class design with examples of building business object classes to emulate real-world business objects.
Classes ... anyone?
Many thanks ukoenig ... I will study and try to understand your sample. Thanks too Otto; I've read James Bott's guide and I think I can follow most of it. ============??? What I don't understand is how to create an EXE from a PRG file containing Function Main and another PRG file containing Create Class. For instance, re Gale FORd's example on Google Map ... i.e. You can download this class and TestWebMap prg at <!-- m --><a class="postlink" href="http://www.hotshare.net/file/24300-4713157df9.html">http://www.hotshare.net/file/24300-4713157df9.html</a><!-- m --> There is TestWebMap.prg for the Function Main and WebMap.prg for the Create Class; the resource is provided in TestWebMap.rc When I try to create the EXE, I get ... xLINK: error: Unresolved external symbol '??2@YAPAXI@Z'. xLINK: error: Unresolved external symbol '??3@YAXPAX@Z'. xLINK: fatal error: 2 unresolved external(s). I have tried combining the two files directly as well as #include one from another without success. I am not doing something right? Any words of wisdom will be much appreciated.