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: fitest.prg,v 1.3 2006/05/12 22:55:51 lculik Exp $
*/
/*
* Copyright 2005 Francesco Saverio Giudice <info@fsgiudice.com>
*
* FreeImage API test file
*/
#include "FreeImage.ch"
#include "common.ch"
#define IMAGES_IN "images_in/"
#define IMAGES_OUT "images_out/"
PROCEDURE Main()
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( .T. )
// Inkey(0)
*set console OFF
*set printer ON
altd()
// Check output directory
IF !ISDirectory( IMAGES_OUT )
DirMake( IMAGES_OUT )
ENDIF
? "Initialise"
fi_Initialise()
//---------------------------//
? "Set Error Message:", fi_SetOutPutMessage( @fi_Error() )
//? "Set Error Message:", fi_SetOutPutMessage( NIL )
? "Version :", fi_GetVersion()
? "Copyright :", fi_GetCopyrightMessage()
? "File type :", fi_GetFileType( IMAGES_IN + "xharbour.jpg" )
? "Load JPEG"
im := fi_Load( FIF_JPEG, IMAGES_IN + "xharbour.jpg", JPEG_DEFAULT )
? "Clone image"
clone := fi_Clone( im )
? "Pointer :", ValToPrg( im )
? "Image Type :", fi_GetImageType( im )
? "Color Used :", fi_GetColorsUsed( im )
? "Pixel size :", fi_GetBPP( im )
? "Width :", fi_GetWidth( im )
? "Height :", fi_GetHeight( im )
? "Byte Size :", fi_GetLine( im )
? "Pitch :", fi_GetPitch( im )
? "DIB Size :", fi_GetDIBSize( im )
? "Dots per Meter X :", fi_GetDotsPerMeterX( im )
? "Dots per Meter Y :", fi_GetDotsPerMeterY( im )
? "Color Type :", fi_GetColorType( im )
? "Red Mask :", fi_GetRedMask( im )
? "Green Mask :", fi_GetGreenMask( im )
? "Blue Mask :", fi_GetBlueMask( im )
? "Transp. Count :", fi_GetTransparencyCount( im )
? "Is Transparent ? :", fi_IsTransparent( im )
?
? "Save BMP ? :", fi_Save( FIF_BMP , im, IMAGES_OUT + "xharbour.bmp", BMP_DEFAULT )
? "Save JPG ? :", fi_Save( FIF_JPEG, im, IMAGES_OUT + "xharbour.jpg", JPEG_DEFAULT )
? "Save PNG ? :", fi_Save( FIF_PNG , im, IMAGES_OUT + "xharbour.png", PNG_DEFAULT )
? "Save TIFF ? :", fi_Save( FIF_TIFF, clone, IMAGES_OUT + "xharbour.tif", TIFF_DEFAULT )
? "Flip Horizontal ?:", fi_FlipHorizontal( clone )
? "Save JPG ? :", fi_Save( FIF_JPEG, clone, IMAGES_OUT + "horizontal.jpg", JPEG_DEFAULT )
? "Flip Vertical ? :", fi_FlipVertical( clone )
? "Save JPG ? :", fi_Save( FIF_JPEG, clone, IMAGES_OUT + "vertical.jpg", JPEG_DEFAULT )
? "Rotate Classic :", ValToPrg( rotated := fi_RotateClassic( clone, 90 ) )
? "Save JPG ? :", fi_Save( FIF_JPEG, rotated, IMAGES_OUT + "rotate.jpg", JPEG_DEFAULT )
fi_Unload( rotated )
centerx := fi_GetWidth( clone ) / 2
centery := fi_GetHeight( clone ) / 2
? "Rotate Ex :", ValToPrg( rotatedEx := fi_RotateEx( clone, 15, 0, 0, centerx, centery, TRUE ) )
? "Save JPG ? :", fi_Save( FIF_JPEG, rotatedEx, IMAGES_OUT + "rotateEx.jpg", JPEG_DEFAULT )
fi_Unload( rotatedEx )
width := fi_GetWidth( im )
height := fi_GetHeight( im )
? "Rescale :", ValToPrg( rescale := fi_Rescale( im, width / 2, height / 2, FILTER_BICUBIC ) )
? "Save JPG ? :", fi_Save( FIF_JPEG, rescale, IMAGES_OUT + "rescale.jpg", JPEG_DEFAULT )
fi_Unload( rescale )
im2 := fi_Clone( im )
? "Adjust Gamma ? :", fi_AdjustGamma( im2, 3.0 )
? "Save JPG ? :", fi_Save( FIF_JPEG, im2, IMAGES_OUT + "adjgamma.jpg", JPEG_DEFAULT )
fi_Unload( im2 )
im2 := fi_Clone( im )
? "Adjust Brightness:", fi_AdjustBrightness( im2, -30 )
? "Save JPG ? :", fi_Save( FIF_JPEG, im2, IMAGES_OUT + "adjbright.jpg", JPEG_DEFAULT )
fi_Unload( im2 )
im2 := fi_Clone( im )
? "Adjust Contrast ?:", fi_AdjustContrast( im2, -30 )
? "Save JPG ? :", fi_Save( FIF_JPEG, im2, IMAGES_OUT + "adjcontrast.jpg", JPEG_DEFAULT )
fi_Unload( im2 )
im2 := fi_Clone( im )
? "Invert ? :", fi_Invert( im2 )
? "Save JPG ? :", fi_Save( FIF_JPEG, im2, IMAGES_OUT + "invert.jpg", JPEG_DEFAULT )
fi_Unload( im2 )
? "Red Channel :", ValToPrg( im2 := fi_GetChannel( im, FICC_RED ) )
? "Save JPG ? :", fi_Save( FIF_JPEG, im2, IMAGES_OUT + "red.jpg", JPEG_DEFAULT )
fi_Unload( im2 )
? "Green Channel :", ValToPrg( im2 := fi_GetChannel( im, FICC_GREEN ) )
? "Save JPG ? :", fi_Save( FIF_JPEG, im2, IMAGES_OUT + "green.jpg", JPEG_DEFAULT )
fi_Unload( im2 )
? "Blue Channel :", ValToPrg( im2 := fi_GetChannel( im, FICC_BLUE ) )
? "Save JPG ? :", fi_Save( FIF_JPEG, im2, IMAGES_OUT + "blue.jpg", JPEG_DEFAULT )
fi_Unload( im2 )
? "Copy :", ValToPrg( im2 := fi_Copy( im, 300, 100, 800, 200 ) )
? "Save JPG ? :", fi_Save( FIF_JPEG, im2, IMAGES_OUT + "copy.jpg", JPEG_DEFAULT )
im3 := fi_Clone( im )
? "Paste ? :", fi_Paste( im3, im2, 10, 10, 70 )
? "Save JPG ? :", fi_Save( FIF_JPEG, im3, IMAGES_OUT + "paste.jpg", JPEG_DEFAULT )
fi_Unload( im2 )
fi_Unload( im3 )
? "Allocate Bitmap :", ValToPrg( im3 := fi_AllocateT( FIT_BITMAP, 320, 200, 32 ) )
? "Save JPG ? :", fi_Save( FIF_JPEG, im3, IMAGES_OUT + "allocate.jpg", JPEG_DEFAULT )
fi_Unload( im3 )
? "Create ERROR :"
? "Save GIF ? :", fi_Save( FIF_GIF, im, IMAGES_OUT + "wrong.gif", 0 )
//? ValToPrg( fi_GetInfoHeader( im ) )
//bmpinfoheader:Buffer( fi_GetInfoHeader( im ), TRUE )
bmpinfoheader:Pointer( fi_GetInfoHeader( im ) )
? "Header :", ValToPrg( bmpinfoheader )
? bmpinfoheader:SayMembers(" ", .t., .t.)
bmpinfo:Pointer( fi_GetInfo( im ) )
? "Info :", ValToPrg( bmpinfo )
? bmpinfo:SayMembers(" ", .t., .t.)
? "-----------------------------------------------------"
? ValType( bmpinfo:Devalue() )
//Tracelog( "bmpinfoheader", ValToPrg( bmpinfoheader ), ;
// bmpinfoheader:SayMembers(, .t.), bmpinfoheader:Value(), bmpinfoheader:DeValue(), hb_dumpvar( bmpinfoheader:Array() ), hb_dumpvar( bmpinfoheader:acMembers ) )
//appo := bkcolor:Value()
? bkcolor:Pointer( fi_GetBackgroundColor( im ) )
//? fi_GetBackgroundColor( im, @bkcolor:Value() )
//bkcolor:Buffer( appo )
? bkcolor:SayMembers(" ", .t., .t.)
bkcolor:rgbBlue := 205
//? fi_SetBackgroundColor( im, hb_String2Pointer( bkcolor:Value() ) )
Tracelog("linha 168")
? fi_SetBackgroundColor( im, bkcolor:Value() )
Tracelog("linha 170")
? bkcolor:SayMembers(" ", .t., .t.)
Tracelog("linha 162")
// ? bkcolor:Pointer( fi_GetBackgroundColor( im ) )
//? fi_GetBackgroundColor( im, @bkcolor:Value() )
//bkcolor:Buffer( appo )
Tracelog("linha 176")
? bkcolor:SayMembers(" ", .t., .t.)
Tracelog("linha 179")
iccprofile:Pointer( fi_GetICCProfile( im ) )
Tracelog("linha 181")
? "Header :", ValToPrg( iccprofile )
Tracelog("linha 183")
? iccprofile:SayMembers(" ", .t., .t.)
//bmpinfoheader:Reset()
//appo := NIL
//bmpinfoheader := NIL
//hb_GCAll( .T. )
? "Unload images from memory"
fi_Unload( im )
fi_Unload( clone )
//---------------------------//
? "DeInitialise"
fi_Deinitialise()
?
? "Look at " + IMAGES_OUT + " folder for output images"
?
*set printer OFF
*set console ON
RETURN
PROCEDURE fi_Error( cFormat, cMessage )
? "ERROR!..."
? "Format : ", cFormat
? "Message : ", 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]
... LISTBOX oBrw FIELDS ... ;
ON RIGHT CLICK ShowPopup( nRow, nCol, oBrw )
...
function ShowPopup( nRow, nCol, oBrw )
local oMenu
MENU oMenu POPUP
MENUITEM "&Colors..." ACTION ...
MENUITEM "&Font..." ACTION ...
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;"> <span style="color: #00C800;">local</span> oMetro<br /><br /> <span style="color: #0000ff;">DEFINE</span> METRO oMetro ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"My FWH Metro app"</span> ;<br /> 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 /> <br /> <span style="color: #00C800;">while</span> ! Eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> METROBUTTON <span style="color: #0000ff;">OF</span> oMetro ;<br /> <span style="color: #0000ff;">PROMPT</span> FieldGet<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">COLOR</span> CLR_WHITE, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">224</span> <span style="color: #000000;">)</span> ; <span style="color: #B900B9;">// 1 primer campo</span><br /> <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 /> <span style="color: #0000ff;">ACTION</span> Records<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> end<br /> </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;">[</span><oBtn><span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">PROMPT</span> <cPrompt> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">COLOR</span> <nClrText>, <nClrPane> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">IMAGE</span> <cImgName> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">OF</span> <oMetro> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <large: <span style="color: #000000;">LARGE</span>> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">ACTION</span> <uAction,...> <span style="color: #000000;">]</span> ;<br /> => ;<br /> <span style="color: #000000;">[</span> <oBtn> := <span style="color: #000000;">]</span> <oMetro>:<span style="color: #000000;">AddButton</span><span style="color: #000000;">(</span> <cPrompt>, <nClrText>, <nClrPane>,;<br /> <.large.>, <cImgName>, <span style="color: #000000;">[</span><span style="color: #000000;">{</span>| <span style="color: #00C800;">Self</span> |<uAction><span style="color: #000000;">}</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span></div>[/code:3eu14ac3]
[code=fw:3eu14ac3]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">local</span> oMetro, oBtn<br /><br /> <span style="color: #0000ff;">DEFINE</span> METRO oMetro ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"My FWH Metro app"</span> ;<br /> 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 /> <br /> <span style="color: #00C800;">while</span> ! Eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> METROBUTTON oBtn <span style="color: #0000ff;">OF</span> oMetro ;<br /> <span style="color: #0000ff;">PROMPT</span> FieldGet<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">COLOR</span> CLR_WHITE, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">224</span> <span style="color: #000000;">)</span> ; <span style="color: #B900B9;">// 1 primer campo</span><br /> <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 /> <span style="color: #0000ff;">ACTION</span> ShowRecords<span style="color: #000000;">(</span> ::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">)</span> <br /> oBtn:<span style="color: #000000;">Cargo</span> = RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> end<br /> </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 /> <span style="color: #000000;">[</span> BACKGROUND <cFileName> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> BTNSIZE <nBtnWidth>, <nBtnHeight> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">TITLE</span> <cTitle> <span style="color: #000000;">]</span> ;<br /> => ;<br /> <oMtr> := TMetro<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <cTitle>, <nBtnWidth>, <nBtnHeight>, <cFileName> <span style="color: #000000;">)</span><br /><br />xcommand <span style="color: #0000ff;">DEFINE</span> METROBUTTON <span style="color: #000000;">[</span><oBtn><span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">PROMPT</span> <cPrompt> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">COLOR</span> <nClrText>, <nClrPane> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">IMAGE</span> <cImgName> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">OF</span> <oMetro> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <large: <span style="color: #000000;">LARGE</span>> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">ACTION</span> <uAction,...> <span style="color: #000000;">]</span> ;<br /> => ;<br /> <span style="color: #000000;">[</span> <oBtn> := <span style="color: #000000;">]</span> <oMetro>:<span style="color: #000000;">AddButton</span><span style="color: #000000;">(</span> <cPrompt>, <nClrText>, <nClrPane>,;<br /> <.large.>, <cImgName>, <span style="color: #000000;">[</span><span style="color: #000000;">{</span>| <span style="color: #00C800;">Self</span> |<uAction><span style="color: #000000;">}</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br />#xcommand <span style="color: #0000ff;">ACTIVATE</span> METRO <oMtr> => <oMtr>:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</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 /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"My FWH Metro app"</span> ;<br /> 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 /> DBSELECTAREA<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> NET_USE <span style="color: #000000;">(</span><span style="color: #ff0000;">"F_REG.DBF"</span>, <span style="color: #000000;">3</span>,.T.<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">while</span> ! Eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> METROBUTTON oBtn <span style="color: #0000ff;">OF</span> oMetro ;<br /> <span style="color: #0000ff;">PROMPT</span> FieldGet<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">COLOR</span> CLR_WHITE, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">224</span> <span style="color: #000000;">)</span> ; <span style="color: #B900B9;">// 1 primer campo</span><br /> <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 /> <span style="color: #0000ff;">ACTION</span> ShowRecords<span style="color: #000000;">(</span> ::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">Cargo</span> = RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> end<br /><br /> <span style="color: #0000ff;">DEFINE</span> METROBUTTON <span style="color: #0000ff;">OF</span> oMetro ;<br /> <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;">(</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">224</span> <span style="color: #000000;">)</span> ;<br /> <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 /> <span style="color: #0000ff;">ACTION</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> MsgYesNo<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Want to exit ?"</span> <span style="color: #000000;">)</span>, oMetro:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span><br /><br /> <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;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</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;">)</span><br /> DBSELECTAREA<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> NET_USE <span style="color: #000000;">(</span><span style="color: #ff0000;">"F_REG.DBF"</span>, <span style="color: #000000;">3</span>,.T.<span style="color: #000000;">)</span><br /> DBGOTOP<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">while</span> ! Eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBtn := oMetro:<span style="color: #000000;">AddButton</span><span style="color: #000000;">(</span> FieldGet<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">(</span> <span style="color: #000000;">2</span> + <span style="color: #000000;">(</span> <span style="color: #000000;">174</span> * <span style="color: #000000;">256</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> <span style="color: #000000;">224</span> * <span style="color: #000000;">65536</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</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;">{</span>||ShowRecords<span style="color: #000000;">(</span>::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">)</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">Cargo</span> :=RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> end<br /> oMetro:<span style="color: #000000;">AddButton</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Exit"</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">(</span> <span style="color: #000000;">2</span> + <span style="color: #000000;">(</span> <span style="color: #000000;">174</span> * <span style="color: #000000;">256</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> <span style="color: #000000;">224</span> * <span style="color: #000000;">65536</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</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;">{</span>||If<span style="color: #000000;">(</span> MsgYesNo<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Want to exit ?"</span> <span style="color: #000000;">)</span>, oMetro:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> oMetro:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</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;"> oMetro := TMetro<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</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;">)</span><br /> DBSELECTAREA<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> NET_USE <span style="color: #000000;">(</span><span style="color: #ff0000;">"F_REG.DBF"</span>, <span style="color: #000000;">3</span>,.T.<span style="color: #000000;">)</span><br /> DBGOTOP<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">while</span> ! Eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBtn := oMetro:<span style="color: #000000;">AddButton</span><span style="color: #000000;">(</span> FieldGet<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">(</span> <span style="color: #000000;">2</span> + <span style="color: #000000;">(</span> <span style="color: #000000;">174</span> * <span style="color: #000000;">256</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> <span style="color: #000000;">224</span> * <span style="color: #000000;">65536</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</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;">{</span>| <span style="color: #00C800;">Self</span> |ShowRecords<span style="color: #000000;">(</span>::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">)</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">Cargo</span> :=RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> end<br /> oMetro:<span style="color: #000000;">AddButton</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Exit"</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">(</span> <span style="color: #000000;">2</span> + <span style="color: #000000;">(</span> <span style="color: #000000;">174</span> * <span style="color: #000000;">256</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> <span style="color: #000000;">224</span> * <span style="color: #000000;">65536</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</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;">{</span>| <span style="color: #00C800;">Self</span> |If<span style="color: #000000;">(</span> MsgYesNo<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Want to exit ?"</span> <span style="color: #000000;">)</span>, oMetro:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> oMetro:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </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;">(</span><span style="color: #000000;">)</span><br /> oBtn := oMetro:<span style="color: #000000;">AddButton</span><span style="color: #000000;">(</span> FieldGet<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">(</span> <span style="color: #000000;">2</span> + <span style="color: #000000;">(</span> <span style="color: #000000;">174</span> * <span style="color: #000000;">256</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> <span style="color: #000000;">224</span> * <span style="color: #000000;">65536</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</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;">{</span>| <span style="color: #00C800;">Self</span> |ShowRecords<span style="color: #000000;">(</span>::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">)</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> oBtn <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">Cargo</span> :=RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</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://fivewin.com.br/index.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;">(</span> oFld, _Folder, oPRODU, _LETRA, _INIPROD, _FIMPROD <span style="color: #000000;">)</span><br /><br /> MEMVAR OCTL, _oProdu<br /><br /> <span style="color: #00C800;">PUBLIC</span> WPRODFOCO<br /><br /> oCtl := oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span>_Folder<span style="color: #000000;">]</span>:<span style="color: #000000;">oCtlFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">WHILE</span> _INIPROD <= _FIMPROD<br /><br /> SYSREFRESH<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> _oProdu := oProdu+STRZERO<span style="color: #000000;">(</span>_INIPROD,<span style="color: #000000;">2</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span>+_LETRA<br /><br /> <span style="color: #00C800;">IF</span> <span style="color: #000000;">(</span>oCtl:<span style="color: #000000;">hWnd</span> = &_oProdu:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span><br /><br /> WPRODFOCO := _INIPROD<br /><br /> EXIT<br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> _INIPROD = _INIPROD + <span style="color: #000000;">1</span><br /><br /> <span style="color: #00C800;">ENDDO</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> .T. <span style="color: #000000;">)</span><br /> </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;">(</span> lLarge, nGroup, cCaption, bAction, nClrText, nClrPane, cImgName, oFont, ;<br /> nAlign, nBmpAlign, nBmpWidth, nBmpHeight, cText, nTextAlign, ;<br /> oTextFont, oSubMetro, cBackImage, cAction, cSub <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> <span style="color: #00C800;">local</span> oBtn<br /> <span style="color: #00C800;">local</span> nX := ::<span style="color: #000000;">nMetroMargin</span> + <span style="color: #000000;">(</span> ::<span style="color: #000000;">nRow</span> * <span style="color: #000000;">(</span> ::<span style="color: #000000;">nBtnSize</span> + <span style="color: #000000;">8</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> nY := ::<span style="color: #000000;">nMetroTop</span> + <span style="color: #000000;">(</span> ::<span style="color: #000000;">nCol</span> * <span style="color: #000000;">(</span> ::<span style="color: #000000;">nBtnSize</span> + <span style="color: #000000;">8</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> lLarge := .F.<br /> <span style="color: #00C800;">DEFAULT</span> nClrText := CLR_WHITE, nClrPane := NextClr<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oBtn := TMetroBtn<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> nX, nY, lLarge, <span style="color: #00C800;">Self</span>, cCaption, cImgName, bAction, nAlign, ;<br /> nBmpAlign, nBmpWidth, nBmpHeight, oFont, cText, nTextAlign, oTextFont, oSubMetro, ;<br /> nGroup, cBackImage, cAction, cSub <span style="color: #000000;">)</span><br /><br /> oBtn:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> nClrText, nClrPane <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">nClrCaption</span> := nClrText<br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> cBackImage <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'C'</span> .and. File<span style="color: #000000;">(</span> cBackImage <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">SetBackGround</span><span style="color: #000000;">(</span> cBacKImage <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> AAdd<span style="color: #000000;">(</span> ::<span style="color: #000000;">aButtons</span>, oBtn <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">nCol</span>++<br /> <span style="color: #00C800;">if</span> lLarge<br /> ::<span style="color: #000000;">nCol</span>++<br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nCol</span> > <span style="color: #000000;">5</span><br /> ::<span style="color: #000000;">nRow</span>++<br /> ::<span style="color: #000000;">nCol</span> = <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> oBtn<br /> </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;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>, oTools, oSBtn<span style="color: #000000;">[</span><span style="color: #000000;">6</span><span style="color: #000000;">]</span>, oFont1, oFont2, oBigfont<br /><span style="color: #00C800;">static</span> nClrBack := CLR_GREEN, aRect<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</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;">(</span> cParam <span style="color: #000000;">)</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 /> SET DELETED <span style="color: #0000ff;">ON</span><br /> SET SOFTSEEK OFF<br /> SET EPOCH <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1950</span><br /> SET DATE FORMAT <span style="color: #ff0000;">"dd/mm/yyyy"</span><br /><br />oFont1 := TFont<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</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;">)</span><br />oFont2 := TFont<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</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;">)</span><br />oBigFont := TFont<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</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;">)</span><br />oSmallFont := TFont<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</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;">)</span><br /><br />aRect<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> := GetSysmetrics<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> - <span style="color: #000000;">25</span> <span style="color: #B900B9;">// Screen-Height</span><br />aRect<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span> := GetSysmetrics<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Screen-Width</span><br /><br />c_path := cFilePath<span style="color: #000000;">(</span>GetModuleFileName<span style="color: #000000;">(</span> GetInstance<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</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 /> DBSELECTAREA( 1 )<br /> NET_USE (c_Path + "</span>F_REG.DBF<span style="color: #ff0000;">", 3,.T.)<br />ELSE<br /> 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 /> ( oSubBar:End(), MAIN_MOVE() ) ) }<br /><br />ACTIVATE WINDOW oWnd MAXIMIZED ;<br />ON INIT ( STARTUP(oMetro1,1), ;<br /> oMetro1:Show(), ;<br /> 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 /> DEFINE METROBUTTON oBtn OF oMetro1 ;<br /> PROMPT FieldGet( 1 ) COLOR CLR_WHITE, RGB( 2, 174, 224 ) ; // 1 primer campo<br /> IMAGE "</span>..\<span style="color: #0000ff;">bitmaps</span>\metro\files.bmp<span style="color: #ff0000;">" ;<br /> ACTION ShowRecords( ::Cargo )<br /> oBtn:Cargo := RecNo()<br /> DbSkip()<br />end<br /><br /><br />DEFINE METROBUTTON oBt OF oMetro1 ;<br />COLOR CLR_WHITE,RGB( 255, 0, 66 ) ;<br />CAPTION "</span>Exit<span style="color: #ff0000;">" ;<br />ALIGN "</span>TOPRIGHT<span style="color: #ff0000;">" ;<br />GROUP 2 ;<br />BITMAP c_path4 + "</span>exit.bmp<span style="color: #ff0000;">" ;<br />BMPALIGN "</span>BOTTOMLEFT<span style="color: #ff0000;">" ;<br />SIZE 48, 48 ;<br />ACTION 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 /> //aqui preciso saber o recno() para fazer o filtro do artigos.dbf e mostrar em metrobutton<br />RETURN NIL<br /><br />// --------------------------<br /><br />FUNCTION STARTUP(oMetro,nPanel)<br /><br />DBSELECTAREA(1)<br />DBGOTO(nPanel)<br /><br />oMetro:SetColor( nWColorT, )<br />IF nWStyle = 1 // Color<br /> D_BACKGRD( oMetro, 1, nWColorF )<br />ELSEIF nWStyle = 2 // Gradient<br /> D_BACKGRD( oMetro, 2, nWColorF, nWColorB, nWGradPos, lWDirect )<br />ELSEIF nWStyle = 3 // BRUSH<br /> D_BACKGRD( oMetro, 3, , , , , c_path1 + cWBrush )<br />ELSEIF nWStyle = 4 // Image<br /> 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. // Move IN<br /> DO WHILE .T.<br /> nStepL := nStepL + 6<br /> IF nStepL > 100<br /> EXIT<br /> ENDIF<br /> INKEY(0.02)<br /> nLPos := aRect[4] - nStepL<br /> oMainBar:Move( 0, nLPos, , aRect[3], .f. ) // Top, left, width, height<br /> ENDDO<br /> lMainBar = .T.<br />ELSE<br /> DO WHILE .T.<br /> nStepL := nStepL + 6<br /> IF nStepL > 100<br /> EXIT<br /> ENDIF<br /> INKEY(0.02)<br /> nLPos := aRect[4] - 100 + nStepL<br /> oMainBar:Move( 0, nLPos, , aRect[3], .f. ) // Top, left, width, height<br /> ENDDO<br /> lMainBar = .F.<br />ENDIF<br /><br />RETURN NIL<br /><br />// -------- 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 /> DEFINE BRUSH oBrush COLOR nColor1<br /> oDlg:SetBrush( oBrush )<br /> oBrush:End()<br />ENDIF<br />IF nStyle = 2 // GRADIENT Brush<br /> aGrad := { { nMove, nColor1, nColor2 }, { nMove, nColor2, nColor1 } }<br /> hDC = CreateCompatibleDC( oDlg:GetDC() )<br /> hBmp = CreateCompatibleBitMap( oDlg:hDC, oDlg:nWidth, oDlg:nHeight )<br /> hBmpOld = SelectObject( hDC, hBmp )<br /> GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aGrad, lDirect ) // .T: = Vertical<br /> DeleteObject( oDlg:oBrush:hBrush )<br /> oBrush := TBrush():New( ,,,, hBmp )<br /> oBrush:Cargo := aGrad<br /> SelectObject( hDC, hBmpOld )<br /> ReleaseDC(hDC)<br /> oDlg:SetBrush( oBrush )<br /> oBrush:End()<br />ENDIF<br />IF nStyle = 3 // BMP-BRUSH<br /> DEFINE BRUSH oBrush FILE cBrush<br /> oDlg:SetBrush( oBrush )<br /> oBrush:End()<br />ENDIF<br />IF nStyle = 4 // Image ADJUSTED<br /> IF FILE( cImage )<br /> DEFINE IMAGE oImage FILE cImage<br /> oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, aRect[4], aRect[3], .T. ) )<br /> oImage:End()<br /> oDlg:SetBrush( oBrush )<br /> oBrush:End()<br /> ELSE<br /> IF !EMPTY(cImage)<br /> MsgAlert( "</span>File : <span style="color: #ff0000;">" + cImage + CRLF + ;<br /> "</span>does not exist<span style="color: #ff0000;">" + CRLF + ;<br /> "</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 /> ENDIF<br /> ENDIF<br />ENDIF<br /><br />RETURN( NIL )<br /><br />// ---------- NET - FUNCTIONS ----------------------------<br /><br />FUNCTION NET_USE ( cDBName1, ntrials, net)<br /><br />LOCAL lReturn := .T.<br />LOCAL lOpen := .F.<br />LOCAL close := 1<br /><br />ntrcount := ntrials<br />JaNein := .F.<br /><br />// SHARED all Users<br />// EXCLUSIVE 1 User<br /><br />IF File( cDBName1 )<br /> ntrials := ntrcount<br /> DO WHILE !lOpen<br /> close := 2<br /> DO WHILE .T.<br /> IF !net<br /> USE &cDBName1 EXCLUSIVE<br /> ELSE<br /> USE &cDBName1 SHARED<br /> ENDIF<br /> IF !NetErr()<br /> lReturn := .T.<br /> lOpen := .T.<br /> ntrials := 0<br /> ELSE<br /> IF net = .T.<br /> status := "</span>SHARED<span style="color: #ff0000;">"<br /> ELSE<br /> status := "</span>EXCLUSIVE<span style="color: #ff0000;">"<br /> ENDIF<br /> IF ntrcount = ntrials<br /> xName := WNetGetUser()<br /> IF MsgYesNo( "</span>Open <span style="color: #ff0000;">" + status + "</span> <span style="color: #0000ff;">of</span> <span style="color: #ff0000;">" + upper(cDBName1) + "</span> not possible !<span style="color: #ff0000;">" + ;<br /> "</span> <span style="color: #00C800;">try</span> again ?<span style="color: #ff0000;">", "</span>Network-error -> &xName !<span style="color: #ff0000;">" )<br /> ntrials := ntrcount<br /> JaNein := .T.<br /> ELSE<br /> ntrials := 0<br /> JaNein := .F.<br /> ENDIF<br /> ENDIF<br /> IF JaNein = .T.<br /> ntrials --<br /> IF ntrials > 0 .AND. ntime > 0<br /> NET_WAIT ( ntrcount, ntrials, ntime)<br /> ENDIF<br /> IF ntrials = 0<br /> ntrials := ntrcount<br /> ENDIF<br /> ELSE<br /> lReturn := .F.<br /> lOpen := .T.<br /> ntrials := 0<br /> ENDIF<br /> ENDIF<br /> IF ntrials = 0<br /> lOpen := .T.<br /> EXIT<br /> ENDIF<br /> ENDDO<br /> ENDDO<br />ELSE<br /> nMsgBox ("</span>File -> <span style="color: #ff0000;">" + cDBName1 + "</span> is missing !<span style="color: #ff0000;">", "</span>Attention !<span style="color: #ff0000;">")<br /> SET RESOURCES to<br /> set _3DLOOK OFF<br /> FreeLibrary()<br /> close database<br /> QUIT<br />ENDIF<br /><br />RETURN lReturn<br /><br />//-------------------------------------------------------<br /><br />FUNCTION NET_RLOCK( ntrials, ntime )<br /><br />LOCAL lReturn := .F.<br />LOCAL ntrcount := 0<br />LOCAL nZSek := 0<br />ntrcount := ntrials<br />DO WHILE !lReturn<br /> DO WHILE ntrials > 0<br /> IF !RLock()<br /> ntrials --<br /> IF ntrials > 0 .AND. ntime > 0<br /> NET_WAIT ( ntrcount, ntrials, ntime )<br /> ENDIF<br /> ELSE<br /> lReturn := .T.<br /> EXIT<br /> ENDIF<br /> ENDDO<br /> IF ntrials = 0<br /> IF MsgYesNo( "</span>Not possible, <span style="color: #0000ff;">to</span> lock the record !<span style="color: #ff0000;">" + ;<br /> "</span> <span style="color: #00C800;">Try</span> again ?<span style="color: #ff0000;">", "</span>Network Error !<span style="color: #ff0000;">" )<br /> lOpen :=.T.<br /> ntrials := ntrcount<br /> ELSE<br /> lReturn := .F.<br /> lOpen := .F.<br /> EXIT<br /> ENDIF<br /> ENDIF<br />ENDDO<br />IF lReturn = .F.<br /> 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 lReturn := .F.<br />LOCAL ntrcount := 0<br />LOCAL nZSek := 0<br /><br />IF len(fieldname(1)) > 0 && DB offen ?<br /> UNLOCK && ja<br />ENDIF<br /><br />RETURN lReturn<br /><br />// ----------------------<br /><br />FUNCTION NET_CLOSE(ntrials, ntime, net)<br /><br />LOCAL lReturn := .T.<br />LOCAL lOpen := .F.<br />LOCAL close := 1<br /><br />ntrcount := ntrials<br />JaNein := .F.<br />JaNein := .F.<br /><br />cDBName1 := DBF()<br /><br />DO WHILE !lOpen<br /> close := 1<br /> DO WHILE ntrials > 0<br /> USE<br /> IF NetErr()<br /> ntrials --<br /> 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 /> "</span> <span style="color: #00C800;">Try</span> again ?<span style="color: #ff0000;">", "</span>Network-Error !<span style="color: #ff0000;">" )<br /> lOpen :=.T.<br /> ntrials := ntrcount<br /> IF ntrials > 0 .AND. ntime > 0<br /> NET_WAIT ( ntrcount, ntrials, ntime)<br /> ENDIF<br /> ELSE<br /> lReturn := .F.<br /> lOpen := .T.<br /> ntrials := 0<br /> ENDIF<br /> ELSE<br /> geschloss := .T.<br /> lReturn := .T.<br /> lOpen := .T.<br /> ntrials := 0<br /> ENDIF<br /> 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 := nSeconds<br /><br />DO WHILE !lReturn<br /> DO WHILE nSeconds > 0<br /> IF !RLock()<br /> nSeconds --<br /> IF nSeconds > 0<br /> NET_WAIT ( nSeconds )<br /> ENDIF<br /> ELSE<br /> DELETE<br /> lReturn := .T.<br /> EXIT<br /> ENDIF<br /> ENDDO<br /> IF nSeconds = 0<br /> 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 /> "</span> <span style="color: #00C800;">try</span> again ?<span style="color: #ff0000;">", "</span>Network-Error !<span style="color: #ff0000;">" )<br /> nSeconds := ntrcount<br /> ELSE<br /> lReturn := .F.<br /> EXIT<br /> ENDIF<br /> ENDIF<br />ENDDO<br />if lReturn = .F.<br /> 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 lReturn := .F.<br />LOCAL ntrcount := 0<br />LOCAL nZSek := 0<br /><br />ntrcount := ntrials<br /><br />DO WHILE !lReturn<br /> DO WHILE ntrials > 0<br /> DBAppend()<br /> IF NetErr()<br /> ntrials --<br /> IF ntrials > 0 .AND. ntime > 0<br /> NET_WAIT ( ntrcount, ntrials, ntime )<br /> ENDIF<br /> ELSE<br /> lReturn := .T.<br /> EXIT<br /> ENDIF<br /> ENDDO<br /> IF ntrials = 0<br /> IF MsgYesNo( "</span>Append in : <span style="color: #ff0000;">" + upper(cDBName) + "</span> not possible !<span style="color: #ff0000;">" + ;<br /> "</span> <span style="color: #00C800;">Try</span> again ?<span style="color: #ff0000;">", "</span>Network Error !<span style="color: #ff0000;">" )<br /> lOpen :=.T.<br /> ntrials := ntrcount<br /> ELSE<br /> lReturn := .F.<br /> lOpen := .F.<br /> EXIT<br /> ENDIF<br /> ENDIF<br />ENDDO<br />if lReturn = .F.<br /> 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;">", "</span>C<span style="color: #ff0000;">", 2, 0 })<br />AADD(DBFARRAY, { "</span>N_FAM<span style="color: #ff0000;">", "</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 /> MsgInfo( "</span>DBF Structure-Error<span style="color: #ff0000;">", "</span><span style="color: #00C800;">New</span> Structure<span style="color: #ff0000;">" )<br /> 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 /> (1)->CODIGO := "</span>DOURO<span style="color: #ff0000;">"<br /> (1)->NOME := "</span>REGIÃO <span style="color: #00C800;">DO</span> DOURO<span style="color: #ff0000;">"<br /> NET_ULOCK()<br />ENDIF<br />NET_APPEND ( 3, 3 )<br />IF NET_RLOCK( 5, 5 )<br /> (1)->CODIGO := "</span>ALENTEJO<span style="color: #ff0000;">"<br /> (1)->NOME := "</span>REGIÃO <span style="color: #00C800;">DO</span> ALENTEJO<span style="color: #ff0000;">"<br /> NET_ULOCK()<br />ENDIF<br />NET_APPEND ( 3, 3 )<br />IF NET_RLOCK( 5, 5 )<br /> (1)->CODIGO := "</span>LISBOA<span style="color: #ff0000;">"<br /> (1)->NOME := "</span>REGIÃO DE LISBOA<span style="color: #ff0000;">"<br /> NET_ULOCK()<br />ENDIF<br /><br />COMMIT<br />DBGOTOP()<br />NET_CLOSE ( 3,5,.T.)<br /><br />IF File( cDbfName )<br /> MsgInfo( "</span>Novo DBF Criado! <span style="color: #000000;">(</span> <span style="color: #ff0000;">" + ALLTRIM(STR(LEN(DBFARRAY))) + "</span> registos <span style="color: #000000;">)</span><span style="color: #ff0000;">", "</span>Nova Estrutura<span style="color: #ff0000;">" )<br />ELSE<br /> 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 />* 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 <span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> DT_LEFT <span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> DT_CENTER <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> DT_RIGHT <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#define</span> DT_VCENTER <span style="color: #000000;">4</span><br /><span style="color: #00D7D7;">#define</span> DT_BOTTOM <span style="color: #000000;">8</span><br /><span style="color: #00D7D7;">#define</span> DT_WORDBREAK <span style="color: #000000;">16</span><br /><span style="color: #00D7D7;">#define</span> DT_SINGLELINE <span style="color: #000000;">32</span><br /><span style="color: #00D7D7;">#define</span> DT_CALCRECT <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 /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">TITLE</span> <cTitle> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">COLOR</span> <nClrText>, <nClrPane> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> TILESIZE <nSize> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CLICK</span> <uAction> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> SCROLLBARCOLOR <nClrThumb>, <nClrScroll> <span style="color: #000000;">]</span> ;<br /> => ;<br /> <oMetro> := TMetroPanel<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <oWnd>, <cTitle>, <nClrText>, <nClrPane>, <<span style="color: #000000;">{</span>uAction<span style="color: #000000;">}</span>>, <nSize>, ;<br /> <nClrThumb>, <nClrScroll> <span style="color: #000000;">)</span><br /><br />#xcommand <span style="color: #0000ff;">DEFINE</span> METROBUTTON <span style="color: #000000;">[</span><oBtn><span style="color: #000000;">]</span> <span style="color: #0000ff;">OF</span> <oMetro> ;<br /> <span style="color: #000000;">[</span> <prmt:<span style="color: #0000ff;">PROMPT</span>,CAPTION> <cPrompt> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">COLOR</span> <nClrText>, <nClrPane> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> ALIGN <nAlign> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">FONT</span> <oFont> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> GROUP <nGroup> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">MENU</span> <oSub> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <bmp:<span style="color: #000000;">BITMAP</span>,IMAGE> <cImgName> <span style="color: #000000;">[</span> BMPALIGN <nBmpAlign> <span style="color: #000000;">]</span> <span style="color: #000000;">[</span> <span style="color: #0000ff;">SIZE</span> <nBmpWidth>,<nBmpHeight> <span style="color: #000000;">]</span> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> BACKGROUND <cImage> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <large: <span style="color: #000000;">LARGE</span>> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <txt:<span style="color: #000000;">BODY</span>,BODYTEXT,TEXT> <cText> <span style="color: #000000;">[</span> TEXTALIGN <nTextAlign> <span style="color: #000000;">]</span> <span style="color: #000000;">[</span> TEXTFONT <oTextFont> <span style="color: #000000;">]</span> <span style="color: #000000;">]</span> ;<br /> <span style="color: #000000;">[</span> <span style="color: #0000ff;">ACTION</span> <uAction,...> <span style="color: #000000;">]</span> ;<br /> => ;<br /> <span style="color: #000000;">[</span> <oBtn> := <span style="color: #000000;">]</span> <oMetro>:<span style="color: #000000;">AddButton</span><span style="color: #000000;">(</span> <.large.>, <nGroup>, <cPrompt>, <span style="color: #000000;">[</span><<span style="color: #000000;">{</span>uAction<span style="color: #000000;">}</span>><span style="color: #000000;">]</span>, <nClrText>, <nClrPane>, ;<br /> <cImgName>, <oFont>, <nAlign>, <nBmpAlign>, <nBmpWidth>, <nBmpHeight>, ;<br /> <cText>, <nTextAlign>, <oTextFont>, <oSub>, <cImage>, <<span style="color: #ff0000;">"uAction"</span>>, <<span style="color: #ff0000;">"oSub"</span>> <span style="color: #000000;">)</span><br /><br />#xcommand ADD <span style="color: #000000;">[</span><oBtn><span style="color: #000000;">]</span> <span style="color: #0000ff;">TO</span> METRO <oMetro> <span style="color: #000000;">[</span><clauses,...><span style="color: #000000;">]</span> => ;<br /> <span style="color: #0000ff;">DEFINE</span> METROBUTTON <span style="color: #000000;">[</span><oBtn><span style="color: #000000;">]</span> <span style="color: #0000ff;">OF</span> <oMetro> <span style="color: #000000;">[</span><clauses><span style="color: #000000;">]</span><br /> </div>[/code:1ora3fu4]
metropnl.prg
[code=fw:1ora3fu4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*<br />*<br />* 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> <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 <span style="color: #000000;">8</span><br /><span style="color: #00D7D7;">#define</span> GRP_GAP <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 /> CLASSDATA lRegistered AS LOGICAL<br /> CLASSDATA oActive <span style="color: #B900B9;">// for internal use</span><br /><br /> <span style="color: #B900B9;">//</span><br /> CLASSDATA nBtnSize, nMetroRows, nMetroTop, nMetroMargin, nSliderTop<br /> <span style="color: #B900B9;">//</span><br /> <span style="color: #00C800;">DATA</span> nOffset <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">DATA</span> nScrollRange <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">DATA</span> nScrollRatio <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">DATA</span> oFont, oFontB<br /> <span style="color: #00C800;">DATA</span> oBtnFont, oTextFont<br /> <span style="color: #00C800;">DATA</span> nGroups <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">DATA</span> aButtons <span style="color: #0000ff;">INIT</span> Array<span style="color: #000000;">(</span><span style="color: #000000;">0</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DATA</span> lArranged <span style="color: #0000ff;">INIT</span> .f.<br /> <span style="color: #00C800;">DATA</span> lDesignMode <span style="color: #0000ff;">INIT</span> .f.<br /> <span style="color: #00C800;">DATA</span> nClrScroll<br /> <span style="color: #00C800;">DATA</span> nClrThumb<br /> <span style="color: #00C800;">DATA</span> nMetroWidth, nThumbSize, nThumbWidth<br /> <span style="color: #00C800;">DATA</span> nThumbPos <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">60</span><br /> <span style="color: #00C800;">DATA</span> hPen<br /><br /> <span style="color: #00C800;">DATA</span> cTitle<br /> <span style="color: #00C800;">DATA</span> nRow, nCol<br /> <span style="color: #00C800;">DATA</span> oParent<br /><br /> <span style="color: #B900B9;">// lDrag, nDragRow, nOldCol used for metro sliding by dragging on screen or scrollbar</span><br /> <span style="color: #00C800;">DATA</span> lDrag <span style="color: #0000ff;">INIT</span> .F.<br /> <span style="color: #00C800;">DATA</span> nDragRow<br /> <span style="color: #00C800;">DATA</span> nOldCol <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">0</span><br /><br /> <span style="color: #00C800;">DATA</span> nScrollBarTop<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oWnd, cTitle, nClrText, nClrPane, bLClicked, nBtnSize, ;<br /> nClrThumb, nClrScroll <span style="color: #000000;">)</span> CONSTRUCTOR<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> AddButton<span style="color: #000000;">(</span> lLarge, nGroup, cCaption, bAction, nClrText, nClrPane, cImgName, oFont, ;<br /> nAlign, nBmpAlign, nBmpWidth, nBmpHeight, cText, nTextAlign, ;<br /> oTextFont, oSubMetro, cBackImage <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Show<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">Arrange</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">ReSize</span><span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">Super</span>:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ::<span style="color: #000000;">lVisible</span> := .t. <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Hide<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ::<span style="color: #000000;">lVisible</span> := .f. <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Arrange<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> LButtonDown<span style="color: #000000;">(</span> nRow, nCol, nFlags <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> LButtonUp<span style="color: #000000;">(</span> nRow, nCol, nFlags <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> MouseMove<span style="color: #000000;">(</span> nRow, nCol, nFlags <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> MoveBtn<span style="color: #000000;">(</span> oBtnDrag, oBtnOver <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SwitchTo<span style="color: #000000;">(</span> oNext, lRight <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> MouseWheel<span style="color: #000000;">(</span> nKey, nDelta, nXPos, nYPos <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Slide<span style="color: #000000;">(</span> nPixels <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> ProgramCode<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Destroy<span style="color: #000000;">(</span><span style="color: #000000;">)</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;">(</span> oWnd, cTitle, nClrText, nClrPane, bLClicked, nBtnSize, ;<br /> nClrThumb, nClrScroll <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> <span style="color: #00C800;">DEFAULT</span> cTitle := <span style="color: #ff0000;">"Start"</span>, nClrText := CLR_WHITE, nClrPane := CLR_GREEN<br /><br /> <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">nBtnSize</span> := IfNil<span style="color: #000000;">(</span> nBtnSize, <span style="color: #000000;">132</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">nMetroRows</span> := Int<span style="color: #000000;">(</span> GetSysMetrics<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">(</span> ::<span style="color: #000000;">nBtnSize</span> + BTN_GAP <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> - <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">nMetroTop</span> := ::<span style="color: #000000;">nBtnSize</span><br /> <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">nMetroMargin</span> := ::<span style="color: #000000;">nBtnSize</span><br /><br /> <span style="color: #00C800;">Super</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, GetSysMetrics<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> , GetSysMetrics<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, oWnd <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">cTitle</span> = cTitle<br /> ::<span style="color: #000000;">nRow</span> = <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nCol</span> = <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nClrThumb</span> = nClrThumb<br /> ::<span style="color: #000000;">nClrScroll</span> = nClrScroll<br /> ::<span style="color: #000000;">hPen</span> = CreatePen<span style="color: #000000;">(</span> PS_SOLID, <span style="color: #000000;">2</span>, CLR_BLACK <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">nClrScroll</span> := RGB<span style="color: #000000;">(</span> <span style="color: #000000;">108</span>, <span style="color: #000000;">110</span>, <span style="color: #000000;">190</span> <span style="color: #000000;">)</span>, ;<br /> ::<span style="color: #000000;">nClrThumb</span> := RGB<span style="color: #000000;">(</span> <span style="color: #000000;">148</span>, <span style="color: #000000;">150</span>, <span style="color: #000000;">230</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">oFont</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;">-52</span><br /> <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 /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">oBtnFont</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;">-20</span> BOLD<br /> <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 /> ::<span style="color: #000000;">lVisible</span> := .t.<br /><br /> ::<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> nClrText, nClrPane <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">bLClicked</span> := bLClicked<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oActive</span> == <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">oActive</span> := <span style="color: #00C800;">Self</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bLClicked</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oParent</span> == <span style="color: #00C800;">nil</span>,, ::<span style="color: #000000;">SwitchTo</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oParent</span>, .t. <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oClient</span> := <span style="color: #00C800;">Self</span><br /> ::<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> <span style="color: #00C800;">local</span> aInfo<br /> <span style="color: #00C800;">local</span> oRect := ::<span style="color: #000000;">GetCliRect</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> hScrollBrush, hThumbBrush<br /> <span style="color: #00C800;">local</span> nBarTotal<br /><br /> aInfo := ::<span style="color: #000000;">DispBegin</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> FillRect<span style="color: #000000;">(</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;">)</span><br /> ::<span style="color: #0000ff;">Say</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nBtnSize</span> - ::<span style="color: #000000;">oFont</span>:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">)</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;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nScrollRange</span> > <span style="color: #000000;">0</span><br /> hScrollBrush := CreateSolidBrush<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrScroll</span> <span style="color: #000000;">)</span><br /> hThumbBrush := CreateSolidBrush<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrThumb</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nThumbWidth</span> := Int<span style="color: #000000;">(</span> ::<span style="color: #000000;">nThumbSize</span> * <span style="color: #000000;">(</span> oRect:<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">120</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> nBarTotal := oRect:<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">120</span> - ::<span style="color: #000000;">nThumbWidth</span><br /> ::<span style="color: #000000;">nThumbPos</span> := Int<span style="color: #000000;">(</span> <span style="color: #0000ff;">Abs</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">nOffSet</span> / ::<span style="color: #000000;">nScrollRange</span> <span style="color: #000000;">)</span> * nBarTotal <span style="color: #000000;">)</span> + <span style="color: #000000;">60</span><br /> oRect:<span style="color: #000000;">nTop</span> := oRect:<span style="color: #000000;">nBottom</span> - SCRLB_HEIGHT<br /> oRect:<span style="color: #000000;">nHeight</span> := SCRLB_HEIGHT<br /> ::<span style="color: #000000;">nScrollBarTop</span> := oRect:<span style="color: #000000;">nTop</span><br /> ::<span style="color: #000000;">nScrollRatio</span> := <span style="color: #000000;">(</span> ::<span style="color: #000000;">nScrollRange</span> / nBarTotal <span style="color: #000000;">)</span><br /><br /> FillRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, oRect:<span style="color: #000000;">aRect</span>, hScrollBrush <span style="color: #000000;">)</span><br /> FillRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">{</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 /> oRect:<span style="color: #000000;">nLeft</span> + ::<span style="color: #000000;">nThumbPos</span> + ::<span style="color: #000000;">nThumbWidth</span> <span style="color: #000000;">}</span>, hThumbBrush <span style="color: #000000;">)</span><br /> DeleteObject<span style="color: #000000;">(</span> hScrollBrush <span style="color: #000000;">)</span><br /> DeleteObject<span style="color: #000000;">(</span> hThumbBrush <span style="color: #000000;">)</span><br /><br /> MoveTo<span style="color: #000000;">(</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;">4</span> <span style="color: #000000;">)</span><br /> LineTo<span style="color: #000000;">(</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;">)</span><br /> LineTo<span style="color: #000000;">(</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;">)</span><br /><br /> MoveTo<span style="color: #000000;">(</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;">4</span> <span style="color: #000000;">)</span><br /> LineTo<span style="color: #000000;">(</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;">)</span><br /> LineTo<span style="color: #000000;">(</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;">)</span><br /><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">nScrollBarTop</span> := oRect:<span style="color: #000000;">nBottom</span> + <span style="color: #000000;">2</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">bPainted</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span><br /> Eval<span style="color: #000000;">(</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;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">(</span> aInfo <span style="color: #000000;">)</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;">(</span> lReArrange <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> <span style="color: #00C800;">local</span> nGrpLeft := ::<span style="color: #000000;">nMetroMargin</span> + ::<span style="color: #000000;">nOffset</span><br /> <span style="color: #00C800;">local</span> nGrpRight<br /> <span style="color: #00C800;">local</span> nGroup<br /> <span style="color: #00C800;">local</span> aBtns, nBtns, oBtn, nCols<br /> <span style="color: #00C800;">local</span> nRow, nCol, n<br /><br /> <span style="color: #00C800;">if</span> lReArrange == .t.<br /> ::<span style="color: #000000;">lArranged</span> := .f.<br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lArranged</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <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 /> aBtns := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> nBtns := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">for</span> each oBtn in ::<span style="color: #000000;">aButtons</span><br /> <span style="color: #00C800;">if</span> oBtn:<span style="color: #000000;">nGroup</span> == nGroup<br /> AAdd<span style="color: #000000;">(</span> aBtns, oBtn <span style="color: #000000;">)</span><br /> nBtns++<br /> <span style="color: #00C800;">if</span> oBtn:<span style="color: #000000;">lLarge</span><br /> nBtns++<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /> nCols := Ceiling<span style="color: #000000;">(</span> nBtns / ::<span style="color: #000000;">nMetroRows</span> <span style="color: #000000;">)</span><br /> nRow := nCol := <span style="color: #000000;">0</span><br /> nGrpRight := nGrpLeft<br /> <span style="color: #00C800;">for</span> each oBtn in aBtns<br /> <span style="color: #00C800;">if</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oBtn:<span style="color: #000000;">lLarge</span>, nCol + <span style="color: #000000;">1</span>, nCol <span style="color: #000000;">)</span> > nCols<br /> nRow++<br /> nCol := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">endif</span><br /> oBtn:<span style="color: #000000;">nTop</span> := ::<span style="color: #000000;">nMetroTop</span> + nRow * <span style="color: #000000;">(</span> ::<span style="color: #000000;">nBtnSize</span> + BTN_GAP <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">nLeft</span> := nGrpLeft + nCol * <span style="color: #000000;">(</span> ::<span style="color: #000000;">nBtnSize</span> + BTN_GAP <span style="color: #000000;">)</span><br /> nGrpRight := <span style="color: #0000ff;">Max</span><span style="color: #000000;">(</span> nGrpRight, oBtn:<span style="color: #000000;">nLeft</span> + oBtn:<span style="color: #000000;">nWidth</span> <span style="color: #000000;">)</span><br /> nCol++<br /> <span style="color: #00C800;">if</span> oBtn:<span style="color: #000000;">lLarge</span><br /> nCol++<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /> ::<span style="color: #000000;">nScrollRange</span> := nGrpLeft - ::<span style="color: #000000;">nMetroMargin</span> - ::<span style="color: #000000;">nOffSet</span><br /> nGrpLeft := nGrpRight + GRP_GAP<br /> nGrpRight := nGrpLeft<br /><br /> <span style="color: #00C800;">next</span> nGroup<br /><br /> ::<span style="color: #000000;">nMetroWidth</span> := nGrpRight - ::<span style="color: #000000;">nOffSet</span><br /> ::<span style="color: #000000;">nScrollRange</span> := <span style="color: #0000ff;">Max</span><span style="color: #000000;">(</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">nMetroWidth</span> - ScreenWidth<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nScrollRange</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nScrollRange</span> := <span style="color: #0000ff;">Max</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, ::<span style="color: #000000;">nScrollRange</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nThumbSize</span> := <span style="color: #000000;">1</span> - <span style="color: #000000;">(</span> ::<span style="color: #000000;">nScrollRange</span> / ::<span style="color: #000000;">nMetroWidth</span> <span style="color: #000000;">)</span><br /><br /> ::<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;">(</span> nRow, nCol, nFlags <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> <span style="color: #00C800;">if</span> nRow < ::<span style="color: #000000;">nScrollBarTop</span> .or. <span style="color: #000000;">(</span> nCol >= ::<span style="color: #000000;">nThumbPos</span> .and. nCol <= <span style="color: #000000;">(</span> ::<span style="color: #000000;">nThumbPos</span> + ::<span style="color: #000000;">nThumbWidth</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">lDrag</span> = .T.<br /> ::<span style="color: #000000;">nDragRow</span> = nRow<br /> ::<span style="color: #000000;">nOldCol</span> = nCol<br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> LButtonUp<span style="color: #000000;">(</span> nRow, nCol, nFlags <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> ::<span style="color: #000000;">lDrag</span> = .F.<br /> ::<span style="color: #000000;">nDragRow</span> = <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;">(</span> nRow, nCol, nFlags <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> <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 /> <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 /> ::<span style="color: #000000;">Slide</span><span style="color: #000000;">(</span> nCol - ::<span style="color: #000000;">nOldCol</span> <span style="color: #000000;">)</span><br /> elseif ::<span style="color: #000000;">nDragRow</span> > ::<span style="color: #000000;">nScrollBarTop</span> .and. nRow > ::<span style="color: #000000;">nScrollBarTop</span><br /> ::<span style="color: #000000;">Slide</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> Int<span style="color: #000000;">(</span> ::<span style="color: #000000;">nOldCol</span> - nCol <span style="color: #000000;">)</span> * ::<span style="color: #000000;">nScrollRatio</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">lDrag</span> := .f.<br /> ::<span style="color: #000000;">nDragRow</span> := <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /> ::<span style="color: #000000;">nOldCol</span> = nCol<br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> MoveBtn<span style="color: #000000;">(</span> oBtnDrag, oBtnOver <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> <span style="color: #00C800;">local</span> nDrag, nOver<br /><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> oDragWnd != <span style="color: #00C800;">nil</span><br /> oDragWnd:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oDragWnd := <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> oBtnDrag == oBtnOver<br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /> <span style="color: #00C800;">endif</span><br /><br /> nDrag := AScan<span style="color: #000000;">(</span> ::<span style="color: #000000;">aButtons</span>, <span style="color: #000000;">{</span> |o| o == oBtnDrag <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> ADel<span style="color: #000000;">(</span> ::<span style="color: #000000;">aButtons</span>, nDrag, .t. <span style="color: #000000;">)</span><br /> nOver := AScan<span style="color: #000000;">(</span> ::<span style="color: #000000;">aButtons</span>, <span style="color: #000000;">{</span> |o| o == oBtnOver <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> AIns<span style="color: #000000;">(</span> ::<span style="color: #000000;">aButtons</span>, nOver + <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nDrag == nOver, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, oBtnDrag, .t. <span style="color: #000000;">)</span><br /> oBtnDrag:<span style="color: #000000;">nGroup</span> := oBtnOver:<span style="color: #000000;">nGroup</span><br /> ::<span style="color: #000000;">lArranged</span> := .f.<br /> ::<span style="color: #000000;">Arrange</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> AEval<span style="color: #000000;">(</span> ::<span style="color: #000000;">aButtons</span>, <span style="color: #000000;">{</span> |o| o:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> ProgramCode<span style="color: #000000;">(</span> lShow <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> <span style="color: #00C800;">local</span> cPrg := <span style="color: #ff0000;">''</span><br /> <span style="color: #00C800;">local</span> oTile<br /><br /> <span style="color: #00C800;">DEFAULT</span> lShow := .f.<br /><br /> cPrg := <span style="color: #ff0000;">"static function MakeMetroPanel( oWnd )"</span> + CRLF + CRLF<br /> cPrg += <span style="color: #ff0000;">" local oMetro, oBtn"</span> + CRLF + CRLF<br /> cPrg += <span style="color: #ff0000;">' DEFINE METROPANEL oMetro OF oWnd TITLE "'</span> + ::<span style="color: #000000;">cTitle</span> + <span style="color: #ff0000;">'" ;'</span> + CRLF<br /> cPrg += <span style="color: #ff0000;">' COLOR '</span> + cClrToCode<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">', '</span> + cClrToCode<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">' ;'</span> + CRLF<br /> cPrg += <span style="color: #ff0000;">' ON CLICK oWnd:End()'</span> + CRLF + CRLF<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lDesignMode</span><br /> cPrg += <span style="color: #ff0000;">' oMetro:lDesignMode := .t.'</span> + CRLF + CRLF<br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">for</span> each oTile in ::<span style="color: #000000;">aButtons</span><br /> cPrg += oTile:<span style="color: #000000;">ProgramCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /><br /> cPrg += CRLF + <span style="color: #ff0000;">"return oMetro"</span> + CRLF + CRLF<br /><br /> <span style="color: #00C800;">if</span> lShow<br /> ViewCode<span style="color: #000000;">(</span> cPrg <span style="color: #000000;">)</span><br /> <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;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> <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 /> DeleteObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hPen</span> <span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> SwitchTo<span style="color: #000000;">(</span> oNext, lRight <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> ::<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oClient</span> := oNext<br /> oNext:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oActive</span> := 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;">(</span> lLarge, nGroup, cCaption, bAction, nClrText, nClrPane, cImgName, oFont, ;<br /> nAlign, nBmpAlign, nBmpWidth, nBmpHeight, cText, nTextAlign, ;<br /> oTextFont, oSubMetro, cBackImage, cAction, cSub <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> <span style="color: #00C800;">local</span> oBtn<br /> <span style="color: #00C800;">local</span> nX := ::<span style="color: #000000;">nMetroMargin</span> + <span style="color: #000000;">(</span> ::<span style="color: #000000;">nRow</span> * <span style="color: #000000;">(</span> ::<span style="color: #000000;">nBtnSize</span> + <span style="color: #000000;">8</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> nY := ::<span style="color: #000000;">nMetroTop</span> + <span style="color: #000000;">(</span> ::<span style="color: #000000;">nCol</span> * <span style="color: #000000;">(</span> ::<span style="color: #000000;">nBtnSize</span> + <span style="color: #000000;">8</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> lLarge := .F.<br /> <span style="color: #00C800;">DEFAULT</span> nClrText := CLR_WHITE, nClrPane := NextClr<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oBtn := TMetroBtn<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> nX, nY, lLarge, <span style="color: #00C800;">Self</span>, cCaption, cImgName, bAction, nAlign, ;<br /> nBmpAlign, nBmpWidth, nBmpHeight, oFont, cText, nTextAlign, oTextFont, oSubMetro, ;<br /> nGroup, cBackImage, cAction, cSub <span style="color: #000000;">)</span><br /><br /> oBtn:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> nClrText, nClrPane <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">nClrCaption</span> := nClrText<br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> cBackImage <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'C'</span> .and. File<span style="color: #000000;">(</span> cBackImage <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">SetBackGround</span><span style="color: #000000;">(</span> cBacKImage <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> AAdd<span style="color: #000000;">(</span> ::<span style="color: #000000;">aButtons</span>, oBtn <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">nCol</span>++<br /> <span style="color: #00C800;">if</span> lLarge<br /> ::<span style="color: #000000;">nCol</span>++<br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nCol</span> > <span style="color: #000000;">5</span><br /> ::<span style="color: #000000;">nRow</span>++<br /> ::<span style="color: #000000;">nCol</span> = <span style="color: #000000;">0</span><br /> <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;">(</span> nKey, nDelta, nXPos, nYPos <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> <span style="color: #00C800;">local</span> nMove := Int<span style="color: #000000;">(</span> nDelta / <span style="color: #000000;">3</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> n, oBtn<br /><br /> ::<span style="color: #000000;">oActive</span>:<span style="color: #000000;">Slide</span><span style="color: #000000;">(</span> nDelta / <span style="color: #000000;">3</span> <span style="color: #000000;">)</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;">(</span> nPixels <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroPanel<br /><br /> <span style="color: #00C800;">local</span> aRect<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nScrollRange</span> > <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">if</span> nPixels > <span style="color: #000000;">0</span><br /> nPixels := <span style="color: #0000ff;">Min</span><span style="color: #000000;">(</span> nPixels, -::<span style="color: #000000;">nOffSet</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nOffSet</span> + nPixels < -::<span style="color: #000000;">nScrollRange</span><br /> nPixels := -::<span style="color: #000000;">nScrollRange</span>- ::<span style="color: #000000;">nOffSet</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> nPixels != <span style="color: #000000;">0</span><br /> aRect = GetClientRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> aRect<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = IfNil<span style="color: #000000;">(</span> ::<span style="color: #000000;">nSliderTop</span>, ::<span style="color: #000000;">nMetroTop</span> <span style="color: #000000;">)</span><br /> aRect<span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> -= <span style="color: #000000;">(</span> SCRLB_HEIGHT + <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> ScrollWindow<span style="color: #000000;">(</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;">)</span><br /> ::<span style="color: #000000;">nOffSet</span> += nPixels<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nScrollRange</span> > <span style="color: #000000;">0</span><br /> ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <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 /> CLASSDATA lRegistered AS LOGICAL<br /><br /> <span style="color: #00C800;">DATA</span> nGroup <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">DATA</span> nMargin <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">8</span><br /> <span style="color: #00C800;">DATA</span> lLarge <span style="color: #0000ff;">INIT</span> .f.<br /><br /> <span style="color: #00C800;">DATA</span> nCapAlign <span style="color: #0000ff;">INIT</span> nOr<span style="color: #000000;">(</span> DT_TOP, DT_RIGHT <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DATA</span> nBmpAlign <span style="color: #0000ff;">INIT</span> nOr<span style="color: #000000;">(</span> DT_BOTTOM, DT_LEFT <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DATA</span> nBmpTop, nBmpLeft, nBmpWidth, nBmpHeight<br /> <span style="color: #00C800;">DATA</span> cBmpSource<br /><br /> <span style="color: #00C800;">DATA</span> cText<br /> <span style="color: #00C800;">DATA</span> nTextAlign <span style="color: #0000ff;">INIT</span> nOr<span style="color: #000000;">(</span> DT_RIGHT, DT_VCENTER <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DATA</span> nClrCaption<br /> <span style="color: #00C800;">DATA</span> oTextFont<br /> <span style="color: #00C800;">DATA</span> cAction, cSub<br /> <span style="color: #00C800;">DATA</span> oSub<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> nTop, nLeft, lLarge, oMetro, cCaption, uImage, bAction, nAlign, ;<br /> nBmpAlign, nBmpWidth, nBmpHeight, oFont, oSub, nGroup, cBackImage, cAction, cSub <span style="color: #000000;">)</span> CONSTRUCTOR<br /><br /> <span style="color: #00C800;">METHOD</span> LoadBitmaps<span style="color: #000000;">(</span> uBmp <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> DrawPrompt<span style="color: #000000;">(</span> cPrompt, oFont, nColor, nAlign <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> DrawMultiLine<span style="color: #000000;">(</span> cText, oFont, nColor, nAlign <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> DesignMenu<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> AlignObject<span style="color: #000000;">(</span> nRow, nCol <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> CalcBmpAlign<span style="color: #000000;">(</span> lRecalc <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetBackGround<span style="color: #000000;">(</span> cImage <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> SetBitmap<span style="color: #000000;">(</span> cImage <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> ToggleSize<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> ProgramCode<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Destroy<span style="color: #000000;">(</span><span style="color: #000000;">)</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;">(</span> nTop, nLeft, lLarge, oMetro, cCaption, uImage, bAction, nAlign, ;<br /> nBmpAlign, nBmpWidth, nBmpHeight, oFont, cText, nTextAlign, ;<br /> oTextFont, oSub, nGroup, cBackImage, cAction, cSub <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br /> <span style="color: #00C800;">local</span> nWidth := oMetro:<span style="color: #000000;">nBtnSize</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">(</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;">)</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> nAlign := nOr<span style="color: #000000;">(</span> DT_TOP, DT_RIGHT <span style="color: #000000;">)</span>, nBmpAlign := nOr<span style="color: #000000;">(</span> DT_BOTTOM, DT_LEFT <span style="color: #000000;">)</span>, ;<br /> cText := <span style="color: #ff0000;">''</span>, nTextAlign := nOr<span style="color: #000000;">(</span> DT_VCENTER, DT_RIGHT <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> nAlign <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'C'</span><br /> nAlign := StrToAlign<span style="color: #000000;">(</span> nAlign, DT_TOP + DT_RIGHT <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> nBmpAlign <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'C'</span><br /> nBmpAlign := StrToAlign<span style="color: #000000;">(</span> nBmpAlign, DT_BOTTOM + DT_LEFT <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> nTextAlign <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'C'</span><br /> nTextAlign := StrToAlign<span style="color: #000000;">(</span> nTextAlign, DT_VCENTER + DT_RIGHT <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> nGroup := oMetro:<span style="color: #000000;">nGroups</span><br /> oMetro:<span style="color: #000000;">nGroups</span> := <span style="color: #0000ff;">Max</span><span style="color: #000000;">(</span> oMetro:<span style="color: #000000;">nGroups</span>, nGroup <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nGroup</span> := nGroup<br /><br /> ::<span style="color: #000000;">lLarge</span> := lLarge<br /> ::<span style="color: #000000;">lTransparent</span> := .f.<br /> ::<span style="color: #000000;">nCapAlign</span> := nAlign<br /> ::<span style="color: #000000;">nBmpAlign</span> := nBmpAlign<br /> ::<span style="color: #000000;">nBmpWidth</span> := nBmpWidth<br /> ::<span style="color: #000000;">nBmpHeight</span> := nBmpHeight<br /> ::<span style="color: #000000;">cText</span> := cText<br /> ::<span style="color: #000000;">nTextAlign</span> := nTextAlign<br /> ::<span style="color: #000000;">oTextFont</span> := oTextFont<br /> ::<span style="color: #000000;">oSub</span> := oSub<br /> ::<span style="color: #000000;">cAction</span> := cAction<br /> ::<span style="color: #000000;">cSub</span> := cSub<br /><br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">cText</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'C'</span><br /> ::<span style="color: #000000;">cText</span> := StrTran<span style="color: #000000;">(</span> ::<span style="color: #000000;">cText</span>, <span style="color: #ff0000;">';'</span>, CRLF <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">Super</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</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 /> 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 /> .f. <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">bAction</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oSub</span> == <span style="color: #00C800;">nil</span>,, <span style="color: #000000;">(</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;">(</span> ::<span style="color: #000000;">oSub</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> ::<span style="color: #000000;">oDragCursor</span> DRAG<br /><br /> ::<span style="color: #000000;">bDragBegin</span> := <span style="color: #000000;">{</span> |r,c,f,o| BtnDragBegin<span style="color: #000000;">(</span> r,c,f,o <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">bRClicked</span> := <span style="color: #000000;">{</span> |r,c,f| ::<span style="color: #000000;">DesignMenu</span><span style="color: #000000;">(</span>r,c,f<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> ::<span style="color: #000000;">bMMoved</span> := <span style="color: #000000;">{</span> |r,c,f,lDrag| <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> oDragWnd == <span style="color: #00C800;">nil</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</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;">(</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;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</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;">(</span> -::<span style="color: #000000;">nLeft</span> + <span style="color: #000000;">8</span> <span style="color: #000000;">)</span> , <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lDrag == .t., oDragWnd:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">nTop</span> + r -oDragWnd:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>, ;<br /> ::<span style="color: #000000;">nLeft</span> + c - oDragWnd:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>, ::<span style="color: #000000;">nWidth</span>, ::<span style="color: #000000;">nHeight</span>, .t. <span style="color: #000000;">)</span>, ;<br /> <span style="color: #000000;">(</span>oDragWnd:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,oDragWnd := <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> ::<span style="color: #000000;">OnClick</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">bAction</span> == <span style="color: #00C800;">nil</span>,,Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bAction</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #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;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br /> <span style="color: #00C800;">local</span> aInfo, nStyle, aRect, hOldFont, hBmpOld, nOldClr, nZeroZeroClr<br /> <span style="color: #00C800;">local</span> cText<br /><br /> aInfo := ::<span style="color: #000000;">DispBegin</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> FillRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, GetClientRect<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> HasAlpha<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span><br /> ABPaint<span style="color: #000000;">(</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;">)</span><br /> elseif .f.<br /> DrawTransparent<span style="color: #000000;">(</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;">)</span><br /> elseif .t.<br /><br /> hBmpOld := SelectObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span><br /> nZeroZeroClr := GetPixel<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> SelectObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hBmpOld <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// nOldClr = SetBkColor( ::hDC, CLR_WHITE )</span><br /> TransBmp<span style="color: #000000;">(</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 /> ::<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;">)</span><br /><span style="color: #B900B9;">// SetBkColor( ::hDC, nOldClr )</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">DrawPrompt</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span>, IfNil<span style="color: #000000;">(</span> ::<span style="color: #000000;">oFont</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBtnFont</span> <span style="color: #000000;">)</span>, ;<br /> IfNil<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrCaption</span>, ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nCapAlign</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cText</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">DrawPrompt</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">cText</span>, IfNil<span style="color: #000000;">(</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;">)</span>, ;<br /> ::<span style="color: #000000;">nClrText</span>, ::<span style="color: #000000;">nTextAlign</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">(</span> aInfo <span style="color: #000000;">)</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;">(</span> cText, oFont, nColor, nAlign <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br /> <span style="color: #00C800;">local</span> aRect, hOldFont<br /><br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'B'</span><br /> cText := Eval<span style="color: #000000;">(</span> cText, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> cText := AllTrim<span style="color: #000000;">(</span> cValToChar<span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> CRLF $ cText<br /> <span style="color: #00C800;">return</span> ::<span style="color: #000000;">DrawMultiLine</span><span style="color: #000000;">(</span> cText, oFont, nColor, nAlign <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> SetTextColor<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nColor <span style="color: #000000;">)</span><br /> SetBkMode<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> hOldFont := SelectObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, oFont:<span style="color: #000000;">hFont</span> <span style="color: #000000;">)</span><br /> aRect := <span style="color: #000000;">{</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;">}</span><br /> DrawTextEx<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, cText, aRect, nOr<span style="color: #000000;">(</span> nAlign, DT_SINGLELINE <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> SelectObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hOldFont <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> DrawMultiLine<span style="color: #000000;">(</span> cText, oFont, nColor, nAlign <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br /> <span style="color: #00C800;">local</span> aRect, hOldFont, nTextHeight<br /><br /> SetTextColor<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, nColor <span style="color: #000000;">)</span><br /> SetBkMode<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> hOldFont := SelectObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, oFont:<span style="color: #000000;">hFont</span> <span style="color: #000000;">)</span><br /> aRect := <span style="color: #000000;">{</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;">}</span><br /> <span style="color: #00C800;">if</span> lAnd<span style="color: #000000;">(</span> nAlign, nOr<span style="color: #000000;">(</span> DT_VCENTER, DT_BOTTOM <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> nTextHeight := DrawTextEx<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, cText, aRect, nOr<span style="color: #000000;">(</span> DT_CALCRECT, DT_WORDBREAK <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> lAnd<span style="color: #000000;">(</span> nAlign, DT_BOTTOM <span style="color: #000000;">)</span><br /> aRect<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> := ::<span style="color: #000000;">nHeight</span> - ::<span style="color: #000000;">nMargin</span> - nTextHeight<br /> <span style="color: #00C800;">else</span><br /> aRect<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> := <span style="color: #000000;">(</span> ::<span style="color: #000000;">nHeight</span> - nTextHeight <span style="color: #000000;">)</span> / <span style="color: #000000;">2</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /> DrawTextEx<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, cText, aRect, nAlign <span style="color: #000000;">)</span><br /> SelectObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, hOldFont <span style="color: #000000;">)</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;">(</span> uBmp <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br /> <span style="color: #00C800;">local</span> hBmp := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> hBmp1, nBmpWidth, nBmpHeight<br /><br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> uBmp <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'N'</span> .and. uBmp != <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">if</span> IsGdiObject<span style="color: #000000;">(</span> uBmp <span style="color: #000000;">)</span><br /> hBmp := uBmp<br /> <span style="color: #00C800;">else</span><br /> hBmp := LoadBitmap<span style="color: #000000;">(</span> GetInstance<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, uBmp <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> elseif ValType<span style="color: #000000;">(</span> uBmp <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'C'</span><br /> <span style="color: #00C800;">if</span> <span style="color: #ff0000;">'.'</span> $ uBmp<br /> <span style="color: #00C800;">if</span> File<span style="color: #000000;">(</span> uBmp <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> Lower<span style="color: #000000;">(</span> <span style="color: #0000ff;">Right</span><span style="color: #000000;">(</span> uBmp, <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'.bmp'</span><br /> hBmp := ReadBitmap<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, uBmp <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> hBmp := FILoadImg<span style="color: #000000;">(</span> uBmp <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> hBmp := LoadBitmap<span style="color: #000000;">(</span> GetInstance<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, uBmp <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">cBmpSource</span> := uBmp<br /> nBmpWidth := nBmpWidth<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span><br /> nBmpHeight := nBmpHeight<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">nBmpWidth</span> := nBmpWidth, ::<span style="color: #000000;">nBmpHeight</span> := nBmpHeight<br /> <span style="color: #00C800;">if</span> nBmpWidth != ::<span style="color: #000000;">nBmpWidth</span> .or. nBmpHeight != ::<span style="color: #000000;">nBmpHeight</span><br /> hBmp := ResizeImg<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> hBmp1 := hBmp <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nBmpWidth</span>, ::<span style="color: #000000;">nBmpHeight</span> <span style="color: #000000;">)</span><br /> DeleteObject<span style="color: #000000;">(</span> hBmp1 <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> ::<span style="color: #000000;">CalcBmpAlign</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">hBitmap1</span> := 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;">(</span> lRecalc <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br /> <span style="color: #00C800;">DEFAULT</span> lRecalc := .f.<br /><br /> <span style="color: #00C800;">if</span> lRecalc<br /> ::<span style="color: #000000;">nBmpTop</span> := ::<span style="color: #000000;">nBmpLeft</span> := <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">nBmpWidth</span> <span style="color: #000000;">)</span> .and. ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">nBmpHeight</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nBmpTop</span> == <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">if</span> lAnd<span style="color: #000000;">(</span> ::<span style="color: #000000;">nBmpAlign</span>, DT_BOTTOM <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nBmpTop</span> := ::<span style="color: #000000;">nHeight</span> - ::<span style="color: #000000;">nMargin</span> - ::<span style="color: #000000;">nBmpHeight</span><br /> elseif lAnd<span style="color: #000000;">(</span> ::<span style="color: #000000;">nBmpAlign</span>, DT_VCENTER <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nBmpTop</span> := <span style="color: #000000;">(</span> ::<span style="color: #000000;">nHeight</span> - ::<span style="color: #000000;">nBmpHeight</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">2</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">nBmpTop</span> := ::<span style="color: #000000;">nMargin</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nBmpLeft</span> == <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">if</span> lAnd<span style="color: #000000;">(</span> ::<span style="color: #000000;">nBmpAlign</span>, DT_RIGHT <span style="color: #000000;">)</span><br /> ::<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 /> elseif lAnd<span style="color: #000000;">(</span> ::<span style="color: #000000;">nBmpAlign</span>, DT_CENTER <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nBmpLeft</span> := <span style="color: #000000;">(</span> ::<span style="color: #000000;">nWidth</span> - ::<span style="color: #000000;">nBmpWidth</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">2</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">nBmpLeft</span> := ::<span style="color: #000000;">nMargin</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <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;">(</span> nRow, nCol, nFlags <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TmetroBtn<br /><br /> <span style="color: #00C800;">local</span> oPop, c<br /><br /> <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">lDesignMode</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2007</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Large Size"</span> <span style="color: #0000ff;">WHEN</span> <span style="color: #000000;">{</span> |o| o:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lLarge</span> <span style="color: #000000;">)</span>, .t. <span style="color: #000000;">}</span> ;<br /> <span style="color: #0000ff;">ACTION</span> oMenuItem:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">ToggleSize</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">SEPARATOR</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Colors"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Tile"</span> <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">SelColor</span><span style="color: #000000;">(</span> .f. <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Caption"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrCaption</span> := ChooseColor<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrCaption</span> <span style="color: #000000;">)</span>, ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"BodyText"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span> := ChooseColor<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">)</span>, ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Set Images"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Tile"</span> <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">SetBackGround</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Bitmap"</span> <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">SetBitmap</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Edit Text"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Caption"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> c := PadR<span style="color: #000000;">(</span> IfNil<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span>, <span style="color: #ff0000;">''</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">15</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> MsgGet<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Caption"</span>, <span style="color: #ff0000;">"Enter 15 Chars for Caption"</span>, @c <span style="color: #000000;">)</span>, ;<br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> := AllTrim<span style="color: #000000;">(</span> c <span style="color: #000000;">)</span>, ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"BodyText"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> c := PadR<span style="color: #000000;">(</span> IfNil<span style="color: #000000;">(</span> ::<span style="color: #000000;">cText</span>, <span style="color: #ff0000;">''</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">45</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> MsgGet<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Body Text"</span>, <span style="color: #ff0000;">"Enter 45 Chars for Body"</span>, @c <span style="color: #000000;">)</span>, ;<br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">cText</span> := StrTran<span style="color: #000000;">(</span> AllTrim<span style="color: #000000;">(</span> c <span style="color: #000000;">)</span>, <span style="color: #ff0000;">';'</span>, CRLF <span style="color: #000000;">)</span>, ;<br /> ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Align Elements"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Caption"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nCapAlign</span> := ::<span style="color: #000000;">AlignObject</span><span style="color: #000000;">(</span> nRow, nCol <span style="color: #000000;">)</span>, ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"BodyText"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nTextAlign</span> := ::<span style="color: #000000;">AlignObject</span><span style="color: #000000;">(</span> nRow, nCol <span style="color: #000000;">)</span>, ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Bitmap"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nBmpAlign</span> := ::<span style="color: #000000;">AlignObject</span><span style="color: #000000;">(</span> nRow, nCol <span style="color: #000000;">)</span>, ;<br /> ::<span style="color: #000000;">CalcBmpAlign</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span>, ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">WHEN</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> <span style="color: #0000ff;">SEPARATOR</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Add New Tile"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">AddButton</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lLarge</span>, ::<span style="color: #000000;">nGroup</span>, <span style="color: #ff0000;">"New"</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">Arrange</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">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;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">AddButton</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lLarge</span>, ::<span style="color: #000000;">nGroup</span>, <span style="color: #ff0000;">"New"</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">SEPARATOR</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"GenerateCode"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Tile"</span> <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">ProgramCode</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Metro"</span> <span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">ProgramCode</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /> oPop:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">(</span> nRow, nCol, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</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;">(</span> nRow, nCol <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br /> <span style="color: #00C800;">local</span> nAlign<br /> <span style="color: #00C800;">local</span> n := ::<span style="color: #000000;">nWidth</span> / <span style="color: #000000;">3</span><br /><br /> nAlign := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nCol > n, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nCol > <span style="color: #000000;">(</span> n + n <span style="color: #000000;">)</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> n := ::<span style="color: #000000;">nHeight</span> / <span style="color: #000000;">3</span><br /> nAlign += <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nRow > n, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nRow > <span style="color: #000000;">(</span> n + n <span style="color: #000000;">)</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</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;">(</span> cImage <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br /> <span style="color: #00C800;">local</span> lSet := .f.<br /> <span style="color: #00C800;">local</span> oBrush<br /><br /> <span style="color: #00C800;">DEFAULT</span> cImage := cGetFile<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Image File (*.bmp,*.jpg,*.png)|*.bmp;*.jpg;*.png|"</span>, ;<br /> <span style="color: #ff0000;">"Select Background Image"</span>,,CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> cImage <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush FILE cImage RESIZE<br /> ::<span style="color: #000000;">SetBrush</span><span style="color: #000000;">(</span> oBrush <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">Resize</span><span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">BRUSH</span> oBrush<br /> lSet := .t.<br /> <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;">(</span> cImage <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br /> <span style="color: #00C800;">local</span> w, h, hBmp<br /><br /> <span style="color: #00C800;">DEFAULT</span> cImage := cGetFile<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Image File (*.bmp,*.jpg,*.png,*.ico)|*.bmp;*.jpg;*.png;*.ico|"</span>, ;<br /> <span style="color: #ff0000;">"Select Bitmap File"</span>,,CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> cImage <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span><br /> DeleteObject<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> ::<span style="color: #000000;">nBmpTop</span> := ::<span style="color: #000000;">nBmpLeft</span> := <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">nBmpWidth</span> := ::<span style="color: #000000;">nBmpHeight</span> := <span style="color: #000000;">50</span><br /> ::<span style="color: #000000;">LoadBitmaps</span><span style="color: #000000;">(</span> cImage <span style="color: #000000;">)</span><br /><span style="color: #B900B9;">/*<br /> w := nBmpWidth( ::hBitmap1 )<br /> h := nBmpHeight(::hBitmap1 )<br /> if w > ::nWidth / 3 .or. h > ::nHeight / 3<br /> hBmp := ResizeBitmap( ::hBitmap1, ::nWidth / 3, ::nHeight / 3, 3 )<br /> DeleteObject( ::hBitmap1 )<br /> ::hBitmap1 := hBmp<br /> ::CalcBmpAlign( .t. )<br /> endif<br />*/</span><br /> ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> ToggleSize<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br /> ::<span style="color: #000000;">lLarge</span> := ! ::<span style="color: #000000;">lLarge</span><br /> ::<span style="color: #000000;">nWidth</span> := ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">nBtnSize</span> + <span style="color: #00C800;">If</span><span style="color: #000000;">(</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;">)</span><br /> ::<span style="color: #000000;">CalcBmpAlign</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">Arrange</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> AEval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">aButtons</span>, <span style="color: #000000;">{</span> |o| o:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> ::<span style="color: #000000;">lLarge</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> ProgramCode<span style="color: #000000;">(</span> lShow <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br /> <span style="color: #00C800;">local</span> cPrg := <span style="color: #ff0000;">''</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> lShow := .f.<br /><br /><span style="color: #00D7D7;">#define</span> NL <span style="color: #ff0000;">' ;'</span> + CRLF<br /><br /> cPrg := <span style="color: #ff0000;">' DEFINE METROBUTTON oBtn OF oMetro'</span><br /> cPrg += NL + <span style="color: #ff0000;">' COLOR '</span> + cClrToCode<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrText</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">','</span> + cClrToCode<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrPane</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">)</span><br /> cPrg += NL + <span style="color: #ff0000;">' CAPTION "'</span> + ::<span style="color: #000000;">cCaption</span> + <span style="color: #ff0000;">'"'</span><br /> cPrg += NL + <span style="color: #ff0000;">' ALIGN "'</span> + AlignStr<span style="color: #000000;">(</span> ::<span style="color: #000000;">nCapAlign</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">'"'</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nGroup</span> > <span style="color: #000000;">1</span><br /> cPrg += NL + <span style="color: #ff0000;">' GROUP '</span> + LTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> ::<span style="color: #000000;">nGroup</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">hBitmap1</span> <span style="color: #000000;">)</span> .and. ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cBmpSource</span> <span style="color: #000000;">)</span><br /> cPrg += NL + <span style="color: #ff0000;">' BITMAP "'</span> + ::<span style="color: #000000;">cBmpSource</span> + <span style="color: #ff0000;">'"'</span><br /> cPrg += NL + <span style="color: #ff0000;">' BMPALIGN "'</span> + AlignStr<span style="color: #000000;">(</span> ::<span style="color: #000000;">nBmpAlign</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">'"'</span><br /> cPrg += NL + <span style="color: #ff0000;">' SIZE '</span> + LTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> ::<span style="color: #000000;">nBmpWidth</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">', '</span> + ;<br /> LTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> ::<span style="color: #000000;">nBmpHeight</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cText</span> <span style="color: #000000;">)</span><br /> cPrg += NL + <span style="color: #ff0000;">' BODYTEXT "'</span> + StrTran<span style="color: #000000;">(</span> ::<span style="color: #000000;">cText</span>, CRLF, <span style="color: #ff0000;">';'</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">'"'</span><br /> cPrg += NL + <span style="color: #ff0000;">' TEXTALIGN "'</span> + AlignStr<span style="color: #000000;">(</span> ::<span style="color: #000000;">nTextAlign</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">'"'</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> .and. ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">cBmpFile</span> <span style="color: #000000;">)</span><br /> cPrg += NL + <span style="color: #ff0000;">' BACKGROUND "'</span> + ::<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">cBmpFile</span> + <span style="color: #ff0000;">'"'</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lLarge</span><br /> cPrg += NL + <span style="color: #ff0000;">' LARGE '</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cSub</span> <span style="color: #000000;">)</span><br /> cPrg += NL + <span style="color: #ff0000;">' MENU '</span> + ::<span style="color: #000000;">cSub</span><br /> elseif ! Empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">cAction</span> <span style="color: #000000;">)</span><br /> cPrg += NL + <span style="color: #ff0000;">' ACTION '</span> + ::<span style="color: #000000;">cAction</span><br /> <span style="color: #00C800;">endif</span><br /> cPrg += CRLF<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nClrCaption</span> != ::<span style="color: #000000;">nClrText</span><br /> cPrg += <span style="color: #ff0000;">' oBtn:nClrCaption := '</span> + cClrToCode<span style="color: #000000;">(</span> ::<span style="color: #000000;">nClrCaption</span> <span style="color: #000000;">)</span> + CRLF<br /> <span style="color: #00C800;">endif</span><br /> cPrg += CRLF<br /><br /> <span style="color: #00C800;">if</span> lShow<br /> ViewCode<span style="color: #000000;">(</span> cPrg <span style="color: #000000;">)</span><br /> <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;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TMetroBtn<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oDragCursor</span> != <span style="color: #00C800;">nil</span><br /> <span style="color: #0000ff;">RELEASE</span> CUSROR ::<span style="color: #000000;">oDragCursor</span><br /> <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;">(</span><span style="color: #000000;">)</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;">(</span> cAlign, nDefault <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> x, y<br /><br /> <span style="color: #00C800;">DEFAULT</span> nDefault := <span style="color: #000000;">0</span><br /> cAlign := Upper<span style="color: #000000;">(</span> cAlign <span style="color: #000000;">)</span><br /><br /> x := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'LEF'</span> $ cAlign, <span style="color: #000000;">0</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'CEN'</span> $ cAlign, <span style="color: #000000;">1</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'RIG'</span> $ cAlign, <span style="color: #000000;">2</span>, nAnd<span style="color: #000000;">(</span> nDefault, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> y := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'TOP'</span> $ cAlign, <span style="color: #000000;">0</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'MID'</span> $ cAlign, <span style="color: #000000;">4</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'BOT'</span> $ cAlign, <span style="color: #000000;">8</span>, nAnd<span style="color: #000000;">(</span> nDefault, <span style="color: #000000;">12</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> nOr<span style="color: #000000;">(</span> x, y <span style="color: #000000;">)</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;">(</span> nAlign <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cAlign := <span style="color: #ff0000;">''</span><br /> <span style="color: #00C800;">local</span> n := nAnd<span style="color: #000000;">(</span> nAlign, <span style="color: #000000;">12</span> <span style="color: #000000;">)</span><br /><br /> cAlign := <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> n == <span style="color: #000000;">8</span>, <span style="color: #ff0000;">'BOTTOM'</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> n == <span style="color: #000000;">4</span>, <span style="color: #ff0000;">'MIDDLE'</span>, <span style="color: #ff0000;">'TOP'</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> n := nAnd<span style="color: #000000;">(</span> nAlign, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span><br /> cAlign += <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> n == <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'RIGHT'</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> n == <span style="color: #000000;">1</span>, <span style="color: #ff0000;">'CENTER'</span>, <span style="color: #ff0000;">'LEFT'</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">static</span> n := <span style="color: #000000;">1</span><br /><br /> <span style="color: #00C800;">local</span> cClr := <span style="color: #ff0000;">"E0AE022770EA3C1FB54E98188546020EB15601B1D5ADA6491B30BB008DD49E313A00AB899B83715A0061863B0DADA84B"</span><br /> <span style="color: #00C800;">local</span> nClr := HexToNum<span style="color: #000000;">(</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">(</span> cClr, n, <span style="color: #000000;">6</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> n += <span style="color: #000000;">6</span><br /> <span style="color: #00C800;">if</span> n > Len<span style="color: #000000;">(</span> cClr <span style="color: #000000;">)</span><br /> n := <span style="color: #000000;">1</span><br /> <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;">(</span> nRow, nCol, nFlags, oBtn <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oBmp, hBmp<br /><br /> SetDropInfo<span style="color: #000000;">(</span> oBtn <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> oDragWnd != <span style="color: #00C800;">nil</span><br /> oDragWnd:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oDragWnd := <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /><br /> hBmp := WndBitmap<span style="color: #000000;">(</span> oBtn:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> <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 /> <span style="color: #0000ff;">STYLE</span> nOr<span style="color: #000000;">(</span> WS_POPUP, WS_VISIBLE <span style="color: #000000;">)</span><br /> oDragWnd:<span style="color: #000000;">nOpacity</span> := <span style="color: #000000;">180</span><br /> @ <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 /> oBmp:<span style="color: #000000;">hBitmap</span> := hBmp<br /> oBmp:<span style="color: #000000;">bDropOver</span> := <span style="color: #000000;">{</span> |u,r,c,f| BtnDragEnd<span style="color: #000000;">(</span> u,r,c,f <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oDragWnd:<span style="color: #000000;">Cargo</span> := <span style="color: #000000;">{</span> nRow, nCol <span style="color: #000000;">}</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oDragWnd ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span> oDragWnd:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</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;">)</span> <span style="color: #000000;">)</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;">(</span> oDragged, nRow, nCol, nFlags <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oMetro := oDragged:<span style="color: #000000;">oWnd</span><br /> <span style="color: #00C800;">local</span> hDropBtn, oDroppedOn<br /> <span style="color: #00C800;">local</span> r, c, o<br /><br /> <span style="color: #00C800;">if</span> oDragWnd != <span style="color: #00C800;">nil</span><br /> oDragWnd:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oDragWnd := <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /><br /> r := oDragged:<span style="color: #000000;">nTop</span> + nRow<br /> c := oDragged:<span style="color: #000000;">nLeft</span> + nCol<br /><br /> <span style="color: #00C800;">if</span> r > 0x8000<br /> r -= 0xffff<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> c > 0x8000<br /> c -= 0xffff<br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">for</span> each o in oMetro:<span style="color: #000000;">aButtons</span><br /> <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 /> <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 /> oDroppedOn := o<br /> exit<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /><br /> <span style="color: #00C800;">if</span> oDroppedOn != <span style="color: #00C800;">nil</span> .and. oDroppedOn:<span style="color: #000000;">IsKindOf</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'TMETROBTN'</span> <span style="color: #000000;">)</span><br /> oMetro:<span style="color: #000000;">MoveBtn</span><span style="color: #000000;">(</span> oDragged, oDroppedOn <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ViewCode<span style="color: #000000;">(</span> cCode <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oGet<br /> <span style="color: #00C800;">local</span> oDlg<br /> <span style="color: #00C800;">local</span> oFont<br /><br /><span style="color: #00D7D7;">#define</span> DLGWD <span style="color: #000000;">350</span> <span style="color: #B900B9;">//250</span><br /><span style="color: #00D7D7;">#define</span> DLGHT <span style="color: #000000;">250</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">'LUCIDA CONSOLE'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span><br /> <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 /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Program Code Generated"</span> ;<br /> <span style="color: #0000ff;">FONT</span> oFont<br /><br /> @ <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 /> <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 /> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFont<br /><br /> @ 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 /> <span style="color: #0000ff;">ACTION</span> CopyToClip<span style="color: #000000;">(</span> cCode <span style="color: #000000;">)</span><br /><br /> @ 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 /> <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 /> <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CopyToClip<span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oClip<br /><br /> oClip := TClipBoard<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> oClip:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oClip:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span><br /> oClip:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> oClip:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</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;"> <span style="color: #0000ff;">DEFINE</span> METROBUTTON oBtn <span style="color: #0000ff;">OF</span> oMetro1 ;<br /> <span style="color: #0000ff;">PROMPT</span> FieldGet<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">COLOR</span> CLR_WHITE, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">224</span> <span style="color: #000000;">)</span> ; <span style="color: #B900B9;">// 1 primer campo</span><br /> <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 /> <span style="color: #0000ff;">ACTION</span> ShowRecords<span style="color: #000000;">(</span> ::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">Cargo</span> := RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oWnd, <span style="color: #ff0000;">"Catálogo de Vinhos"</span>,,, <span style="color: #000000;">{</span>|| msgalert<span style="color: #000000;">(</span>ownd:<span style="color: #000000;">oCtlFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>,,, <span style="color: #000000;">)</span><br /><br />oMetro1:<span style="color: #000000;">lDesignMode</span> := .T.<br />lMetro<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> := .T.<br />DBSELECTAREA<span style="color: #000000;">(</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span><br />DBGOTOP<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">while</span> !eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /><br /> oBtn := oMetro1:<span style="color: #000000;">AddButton</span><span style="color: #000000;">(</span> .F.,, FieldGet<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">{</span>|| ShowRecords<span style="color: #000000;">(</span> ::<span style="color: #000000;">Cargo</span> <span style="color: #000000;">)</span><span style="color: #000000;">}</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">(</span> <span style="color: #000000;">2</span> + <span style="color: #000000;">(</span> <span style="color: #000000;">174</span> * <span style="color: #000000;">256</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> <span style="color: #000000;">224</span> * <span style="color: #000000;">65536</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</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;">)</span><br /> oBtn:<span style="color: #000000;">Cargo</span> := RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />end<br /><br /> </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;">[</span> <oBtn> := <span style="color: #000000;">]</span> <oMetro>:<span style="color: #000000;">AddButton</span><span style="color: #000000;">(</span> <.large.>, <nGroup>, <cPrompt>, <span style="color: #000000;">[</span><span style="color: #000000;">{</span>| <span style="color: #00C800;">Self</span> |<uAction><span style="color: #000000;">}</span><span style="color: #000000;">]</span>, <nClrText>, <nClrPane>, ;<br /> <cImgName>, <oFont>, <nAlign>, <nBmpAlign>, <nBmpWidth>, <nBmpHeight>, ;<br /> <cText>, <nTextAlign>, <oTextFont>, <oSub>, <cImage>, <<span style="color: #ff0000;">"uAction"</span>>, <<span style="color: #ff0000;">"oSub"</span>> <span style="color: #000000;">)</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;">(</span> NREC,oWnd,OMETRO <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oMetro2, oBtn, oFont, oHScroll,oBtn1,oBtn2,oBt:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> oMetro:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> FILE<span style="color: #000000;">(</span> c_Path + <span style="color: #ff0000;">"F_ART.DBF"</span> <span style="color: #000000;">)</span><br /> DBSELECTAREA<span style="color: #000000;">(</span> <span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /> NET_USE <span style="color: #000000;">(</span>c_Path + <span style="color: #ff0000;">"F_ART.DBF"</span>, <span style="color: #000000;">3</span>,.T.<span style="color: #000000;">)</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;">(</span><span style="color: #ff0000;">"ARQUIVO ARTIGOS INEXISTENTE"</span>,<span style="color: #ff0000;">"Atenção"</span><span style="color: #000000;">)</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;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>,<span style="color: #000000;">64</span> <span style="color: #000000;">)</span>, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>,<span style="color: #000000;">64</span><span style="color: #000000;">)</span><br /> D_BACKGRD<span style="color: #000000;">(</span> oMetro2, <span style="color: #000000;">4</span>, , , , , , c_path1 + <span style="color: #ff0000;">"vinho3.Jpg"</span> <span style="color: #000000;">)</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;">{</span> | nKey, nDelta, nXPos, nYPos | oMetro2:<span style="color: #000000;">MouseWheel</span><span style="color: #000000;">(</span> nKey, nDelta, nXPos, nYPos <span style="color: #000000;">)</span> <span style="color: #000000;">}</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;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</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;">(</span>NET_CLOSE <span style="color: #000000;">(</span> <span style="color: #000000;">3</span>,<span style="color: #000000;">5</span>,.T.<span style="color: #000000;">)</span>,oMetro2:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oMetro:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> DBSELECTAREA<span style="color: #000000;">(</span><span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /> SET FILTER <span style="color: #0000ff;">TO</span> val<span style="color: #000000;">(</span><span style="color: #000000;">(</span><span style="color: #000000;">2</span><span style="color: #000000;">)</span>->C_CODREG<span style="color: #000000;">)</span>=nRec<br /> DBGOTOP<span style="color: #000000;">(</span><span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">WHILE</span> !EOF<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">(</span> <span style="color: #000000;">2</span>->C_DES<span style="color: #000000;">)</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;">(</span><span style="color: #000000;">2</span>->C_DES<span style="color: #000000;">)</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;">(</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;">)</span> ;<br /> TEXTALIGN <span style="color: #ff0000;">"BOTTOMCENTER"</span> ;<br /> large;<br /> <span style="color: #0000ff;">ACTION</span> Detalhe<span style="color: #000000;">(</span>::<span style="color: #000000;">Cargo</span>,oWnd <span style="color: #000000;">)</span><br /> oBtn:<span style="color: #000000;">Cargo</span> := RecNo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</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;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</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;">(</span>NET_CLOSE <span style="color: #000000;">(</span> <span style="color: #000000;">3</span>,<span style="color: #000000;">5</span>,.T.<span style="color: #000000;">)</span>,oMetro2:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oMetro:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oMetro2:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:23umzrhz]
[img:23umzrhz]http://i.imgur.com/3jfWqrp.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://www.4shared.com/file/jv17uSoUce/VLWVINHO.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://www.dropbox.com/s/murnkxh9aup13vg/VLWVINHO.exe?dl=0[/url:upu4ckq0]
your email address? |
Classe Richedit | Ho un problema con la classe RichEdit.
Questo è il codice:
[code:223mkoh2]
#include "Fivewin.ch"
#include "Richedit.ch"
FUNCTION MAIN()
LOCAL hDll := LOADLIBRARY( "RICHED20.DLL" )
LOCAL oDlg
LOCAL oRich, cVar := ""
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()
ACTIVATE DIALOG oDlg CENTER
FREELIBRARY( hDll )
RETURN NIL
STATIC FUNCTION DIALOG_2()
LOCAL oDlg
LOCAL oRich, cVar := ""
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:End()
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;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Attention"</span><br /><br /> @ <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 /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> PlaceGif<span style="color: #000000;">(</span> oDlg <span style="color: #000000;">)</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;">(</span> oDlg <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oGif<br /><br /> @ <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 /> <span style="color: #B900B9;">// LOCAL oGif</span><br /><br /> <span style="color: #B900B9;">// @ 61.50, 0 GIF oGif FILE ".\AMBIENTY.GIF" SIZE 230, 100 ADJUST</span><br /><br /> <span style="color: #B900B9;">/*<br /> IF FILE( "AMBIENTY.GIF" )<br /><br /> @ 54.00, 01 GIF oGif FILE ".\AMBIENTY.GIF" SIZE 1019, 240 ADJUST<br /><br /> // TELA CHEIA<br /> // @ 54.00, 01 GIF oGif FILE ".\AMBIENTY.GIF" SIZE 1019, 582 ADJUST<br /><br /> oGif:lTransparent := .T.<br /><br /> ENDIF<br /> */</span><br /><br /> <span style="color: #B900B9;">// @ 050, 900 GIF oGif FILE ".\HALO.GIF" SIZE 090, 080 ADJUST OF oRebar</span><br /><br /><span style="color: #0000ff;">Abs</span>.<br /> </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://i.postimg.cc/fySCQzNK/preproducir1.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 nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">89</span>, <span style="color: #000000;">135</span>, <span style="color: #000000;">214</span> <span style="color: #000000;">)</span><br /><span style="color: #00D7D7;">#define</span> DARKBLUE nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">56</span>, <span style="color: #000000;">147</span> <span style="color: #000000;">)</span><br /><span style="color: #00D7D7;">#define</span> LIGHTORANGE1 nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">250</span>, <span style="color: #000000;">227</span>, <span style="color: #000000;">143</span> <span style="color: #000000;">)</span><br /><span style="color: #00D7D7;">#define</span> DARKORANGE1 nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">238</span>, <span style="color: #000000;">152</span>, <span style="color: #000000;">25</span> <span style="color: #000000;">)</span><br /><span style="color: #00D7D7;">#define</span> LIGHTCYAN nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">203</span>, <span style="color: #000000;">225</span>, <span style="color: #000000;">252</span> <span style="color: #000000;">)</span><br /><span style="color: #00D7D7;">#define</span> DARKCYAN nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">165</span>, <span style="color: #000000;">224</span> <span style="color: #000000;">)</span><br /><span style="color: #00D7D7;">#define</span> LIGHTORANGE2 nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">220</span> <span style="color: #000000;">)</span><br /><span style="color: #00D7D7;">#define</span> DARKORANGE2 nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">247</span>, <span style="color: #000000;">192</span>, <span style="color: #000000;">91</span> <span style="color: #000000;">)</span><br /> </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;">(</span> <span style="color: #000000;">141</span>, <span style="color: #000000;">178</span>, <span style="color: #000000;">227</span> <span style="color: #000000;">)</span> <br /><span style="color: #00D7D7;">#define</span> BLUEBOX1 RGB<span style="color: #000000;">(</span> <span style="color: #000000;">197</span>, <span style="color: #000000;">210</span>, <span style="color: #000000;">223</span> <span style="color: #000000;">)</span><br /><span style="color: #00D7D7;">#define</span> BLUEBOX2 RGB<span style="color: #000000;">(</span> <span style="color: #000000;">237</span>, <span style="color: #000000;">242</span>, <span style="color: #000000;">248</span> <span style="color: #000000;">)</span><br /><span style="color: #00D7D7;">#define</span> BLUE0 RGB<span style="color: #000000;">(</span> <span style="color: #000000;">218</span>, <span style="color: #000000;">229</span>, <span style="color: #000000;">243</span> <span style="color: #000000;">)</span> <br /><span style="color: #00D7D7;">#define</span> BLUE1 RGB<span style="color: #000000;">(</span> <span style="color: #000000;">199</span>, <span style="color: #000000;">216</span>, <span style="color: #000000;">237</span> <span style="color: #000000;">)</span> <br /><span style="color: #00D7D7;">#define</span> BLUE2 RGB<span style="color: #000000;">(</span> <span style="color: #000000;">194</span>, <span style="color: #000000;">217</span>, <span style="color: #000000;">240</span> <span style="color: #000000;">)</span> <br /><span style="color: #00D7D7;">#define</span> BLUE3 RGB<span style="color: #000000;">(</span> <span style="color: #000000;">191</span>, <span style="color: #000000;">219</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</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;">(</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">{</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;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, DARKBLUE, LIGHTBLUE, .T. <span style="color: #000000;">)</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;">{</span> <span style="color: #000000;">{</span><span style="color: #000000;">0.3</span>, BLUE0, BLUE0 <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> <span style="color: #000000;">0.7</span>, BLUE1, BLUE0 <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> GradientFill<span style="color: #000000;">(</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;">(</span><span style="color: #000000;">)</span> , aGrad <span style="color: #000000;">)</span><br /><span style="color: #00C800;">Else</span> <br /> Gradient<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, <span style="color: #000000;">{</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;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, DARKBLUE, LIGHTBLUE, .T. <span style="color: #000000;">)</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;">(</span> hDC := oCon:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">{</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;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lOver, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lSelected</span>, ::<span style="color: #000000;">nClrEnd</span>, LIGHTORANGE2 <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nClrStart</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lOver, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lSelected</span>, ::<span style="color: #000000;">nClrStart</span>, DARKORANGE2 <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nClrEnd</span> <span style="color: #000000;">)</span>, .T. <span style="color: #000000;">)</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;">{</span> <span style="color: #000000;">{</span><span style="color: #000000;">0.3</span>, BLUE0, BLUE0 <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> <span style="color: #000000;">0.7</span>, BLUE1, BLUE0 <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> aGradHigh := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #000000;">1</span>/<span style="color: #000000;">3</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">253</span>,<span style="color: #000000;">212</span>,<span style="color: #000000;">168</span> <span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">251</span>,<span style="color: #000000;">178</span>,<span style="color: #000000;">99</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span><span style="color: #000000;">2</span>/<span style="color: #000000;">3</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">250</span>,<span style="color: #000000;">157</span>,<span style="color: #000000;">52</span> <span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">252</span>,<span style="color: #000000;">234</span>,<span style="color: #000000;">163</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> aGradOver := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #000000;">1</span> , nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>,<span style="color: #000000;">215</span>,<span style="color: #000000;">84</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">253</span>, <span style="color: #000000;">222</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> GradientFill<span style="color: #000000;">(</span> hDC := oCon:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</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;">(</span><span style="color: #000000;">)</span> , <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lOver, aGradOver , <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lSelected</span> , aGradHigh , aGrad<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">Else</span><br /> Gradient<span style="color: #000000;">(</span> hDC := oCon:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">{</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;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lOver, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lSelected</span>, ::<span style="color: #000000;">nClrEnd</span>, LIGHTORANGE2 <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nClrStart</span> <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lOver, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">lSelected</span>, ::<span style="color: #000000;">nClrStart</span>, DARKORANGE2 <span style="color: #000000;">)</span>, ::<span style="color: #000000;">nClrEnd</span> <span style="color: #000000;">)</span>, .T. <span style="color: #000000;">)</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://img202.imageshack.us/img202/2843/toutlook2003.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://br.geocities.com/qiinformatica2000/regua.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://www.pflegeplus.com/fw_downloads/object.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(e_POSLEFT) + ;
"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(e_POSLEFT) + ;
"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(e_POSLEFT) + "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 ( NEW_COLOR(oInfoBar2) ) ;
BITMAP "colors" PROMPT SPACE(5) + "&Test" TEXTRIGHT
oBtn9:cToolTip = { "Bar-Color-Test", "Test", 1, CLR_BLACK, 14089979 }
.....
.....
//------------------------------
FUNCTION NEW_COLOR(oInfoBar2)
When you want to use CLASS - informations,
the function must know the OBJECT ( oInfoBar2 ).
The functions are allways belong to a OBJECT ( in this sample => oInfobar2 )
e_COLTEXT, e_COLOR1 and e_COLOR2 have the new values i want to test.
oInfoBar2:cPrompt := "Test" // Write "Test" to the Var => cPrompt
oInfoBar2:oFontPrompt := oBFont // Show a try-out Font for the Text
oInfoBar2:nClrPrompt := e_COLTEXT // Show a try-out Color for the Text
IF e_COLEND = 9 // Glass - look
oInfoBar2:nClrLabel := e_COLOR1 // Show a try-out Color for the text
oInfoBar2:lDrawGradient := .F.
oInfoBar2:lGlass := .T.
ELSE
oInfoBar2:nBeginColor := e_COLOR1 // Show a Color Start-Grad.
oInfoBar2:nEndColor := e_COLOR2 // Show a Color End-Grad
IF e_ORIENT = 1
oInfoBar2:lVertGradient := .F.
ENDIF
IF e_ORIENT = 2
oInfoBar2:lVertGradient := .T.
ENDIF
ENDIF
oInfoBar2:Paint() // METHOD Paint()
oInfoBar2:Refresh() // REFRESH oInfoBar2
// With this, the BAR => oInfoBar2 is UPDATED with the new Values !!!
// You send directly informations to the OBJECT oInfobar2
RETURN( NIL )
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(oInfoBar2)
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 ( Functions )
METHOD Paint() // I paint oInfoBar2 with the new values
.....
.....
[/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. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.