Quantità di record intorno ai 10000 sono assolutamente tranquilli per un DBF. Ma anche con 100000 non avresti problemi. C'è gente che usa DBF con milioni di record senza alcun problema.
EMG
Quantità di record intorno ai 10000 sono assolutamente tranquilli per un DBF. Ma anche con 100000 non avresti problemi. C'è gente che usa DBF con milioni di record senza alcun problema.
EMG

function NuovoRB()
local oWndChild, oBar, oBmp
LOCAL KMTotali,KMParziali,Titolo,Note1,Note2
LOCAL oGet1
DEFINE WINDOW oWndChild MDICHILD COLOR "N/W" of oWnd;
title "Nuovo RoadBook"
DEFINE BUTTONBAR oBar 3D SIZE 25, 25 OF oWndChild
DEFINE BUTTON OF oBar ACTION PutLabel( oBmp ) TOOLTIP "Testo"
DEFINE BUTTON OF oBar ACTION PutBitmap( oBmp ) TOOLTIP "Simboli"
DEFINE BUTTON OF oBar ACTION PreView( oBmp ) TOOLTIP "Anteprima di stampa"
// titolo
@ 2,0 get oGet1 VAR Note1 MEMO SIZE 700, 100 OF oWndChild
//Linea
@ 10,2 say "KM TOTALI" SIZE 80, 50 OF oWndChild
@ 14,2 say "KM PARZIALI" SIZE 80, 50 OF oWndChild
@ 10,10 get oGet2 VAR KMTotali SIZE 80, 50 OF oWndChild
@ 14,10 get oGet2 VAR KMParziali SIZE 80, 50 OF oWndChild
@ 10,20 BITMAP oBmp SIZE 200, 100 OF oWndChild
oBmp:bPainted = { | hDC | DrawSections( hDC ) }
* oBmp:oHScroll:SetRange( 1, 1200 )
* oBmp:oHScroll:nPgStep = 20
oWndChild:SetControl( oBmp )
ACTIVATE WINDOW oWndChildfunction DrawSections( hDC )
local oBrWhite, oBrCyan
DEFINE BRUSH oBrWhite COLOR CLR_WHITE
DEFINE BRUSH oBrCyan COLOR CLR_YELLOW
* FillRect( hDC, { 10, 20, 100, 641 }, oBrWhite:hBrush )
*FillRect( hDC, { 100, 50, 150, 641 }, oBrCyan:hBrush )
* FillRect( hDC, { 150, 0, 200, 641 }, oBrWhite:hBrush )
oBrWhite:End()
oBrCyan:End()Ti posso aiutare solo se:
Mi sottoponi un problema alla volta e me lo descrivi in modo sintetico e preciso.
Prepari un esempio minimale che lo mostri e che io possa poi restituirti corretto e funzionante.
EMG
ok te lo preparo dopo xchè adesso sono a scuola.
poi lo metto qui il test ?
Sì (oppure lo mandi direttamente alla mia email, come ti pare), ma è essernziale che sia piccolo e compilabile altrimenti non credo che potrò dedicarmici. Sei tu che devi fare lo sforzo iniziale per ridurlo ai minimi termini.
EMG
MA LA CLASSE :TMetaFile() COME SI USA ?
cioè io voglio creare un BMP oBMP con la metafile alla linea 14,30 e la dimensione deve essere 200x100
Non so mi crea un immagine grandiisima...
vabbe faccio il test intanto
Forse intendevi dire la classe TBitmap? Comunque ti sconsiglio di utilizzare classi per questo lavoro di "rendering" dei bitmap. Semplicemente disegnali alle giuste coordinate usando la funzione PalBmpDraw() all'interno dell'evento ON PAINT.
EMG

METHOD Paint() CLASS TTabs
local aInfo := ::DispBegin()
local hDarkPen := CreatePen( PS_SOLID, 1, GetSysColor( COLOR_BTNSHADOW ) )
local hGrayPen := CreatePen( PS_SOLID, 1, GetSysColor( COLOR_BTNFACE ) )
local hLightPen := CreatePen( PS_SOLID, 1, GetSysColor( COLOR_BTNHIGHLIGHT ) )
local n, nCol := 5, nHeight := 15
local hOldFont, hOldBrush, hOldPen
local hDC := ::hDC
local hGrayBrush := CreateSolidBrush( ::nClrPane )
local hDarkBrush := CreateSolidBrush( GetSysColor( COLOR_INACTIVECAPTION ) )
local lNeedButtons := .f.
if LargeFonts()
nHeight += 3
endif
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
hOldFont = SelectObject( hDC, ::oFont:hFont )
hOldPen = SelectObject( hDC, hDarkPen )
hOldBrush = SelectObject( hDC, hDarkBrush )
MoveTo( hDC, 0, 0 )
LineTo( hDC, ::nWidth(), 0 )
SetBlackPen( hDC )
MoveTo( hDC, 0, 1 )
LineTo( hDC, ::nWidth(), 1 )
SetTextColor( hDC, CLR_WHITE )
if Len( ::aSizes ) < Len( ::aPrompts )
::Default()
endif
DEFAULT ::nOffset := 1
for n = ::nOffset to Len( ::aPrompts )
SelectObject( hDC, If( n == ::nOption, hGrayBrush, hDarkBrush ) )
SetBlackPen( hDC )
if n == ::nOffset .or. n == ::nOption
PolyPolygon( hDC, { { nCol, 1 },;
{ nCol + 5, nHeight },;
{ nCol + 9 + ::aSizes[ n ], nHeight },;
{ nCol + 14 + ::aSizes[ n ], 1 },;
{ nCol, 1 } } )
else
PolyPolygon( hDC, { { nCol + 2, 7 },;
{ nCol + 5, nHeight },;
{ nCol + 9 + ::aSizes[ n ], nHeight },;
{ nCol + 14 + ::aSizes[ n ], 1 },;
{ nCol + 4, 1 },;
{ nCol + 2, 7 } } )
endif
if n == ::nOption
SelectObject( hDC, hGrayPen )
MoveTo( hDC, nCol, 0 )
LineTo( hDC, nCol + 14 + ::aSizes[ n ], 0 )
MoveTo( hDC, nCol + 1, 1 )
LineTo( hDC, nCol + 14 + ::aSizes[ n ], 1 )
SelectObject( hDC, hLightPen )
MoveTo( hDC, nCol + 1, 2 )
LineTo( hDC, nCol + 6, nHeight - 1 )
SelectObject( hDC, hDarkPen )
LineTo( hDC, nCol + ::aSizes[ n ] + 8, nHeight - 1 )
LineTo( hDC, nCol + ::aSizes[ n ] + 13, 0 )
SetTextColor( hDC, ::nClrText )
SetBkColor( hDC, ::nClrPane )
DrawText( hDC, ::aPrompts[ n ],;
{ 1, nCol + 4, 15, nCol + 5 + ::aSizes[ n ] + 5 },;
nOr( DT_CENTER, DT_VCENTER ) )
else
SetTextColor( hDC, GetSysColor( COLOR_INACTIVECAPTIONTEXT ) )
SetBkColor( hDC, GetSysColor( COLOR_INACTIVECAPTION ) )
DrawText( hDC, ::aPrompts[ n ],;
{ 2, nCol + 3, 19, nCol + 5 + ::aSizes[ n ] + 6 },;
nOr( DT_CENTER, DT_VCENTER ) )
endif
nCol += ::aSizes[ n ] + 4 + 6
if ( nCol ) > ::nWidth
lNeedButtons := .t.
exit
endif
next
if ! Empty( ::oBtnLeft )
if ::nOffset > 1 .or. lNeedButtons
::oBtnLeft:Move( 4, ::nWidth - 24, 11, 15, .t. )
::oBtnRight:Move( 4, ::nWidth - 25 + 12, 11, 15, .t. )
::oBtnLeft:Show()
::oBtnRight:Show()
::oBtnLeft:Paint()
::oBtnRight:Paint()
if ::nOffset > 1
::oBtnLeft:Enable()
else
::oBtnLeft:Disable()
endif
if ! lNeedButtons
::oBtnRight:Disable()
else
::oBtnRight:Enable()
endif
else
::oBtnLeft:Hide()
::oBtnRight:Hide()
endif
endif
SelectObject( hDC, hOldPen )
SelectObject( hDC, hOldFont )
SelectObject( hDC, hOldBrush )
DeleteObject( hDarkPen )
DeleteObject( hGrayPen )
DeleteObject( hLightPen )
DeleteObject( hDarkBrush )
DeleteObject( hGrayBrush )
::DispEnd( aInfo )
return nilSilvio wrote:si ma Linares mi ha detto di creare un user control
Anche a me mi sembra la soluzione giusta
Silvio wrote:cioè dovrei disegnare questo inizialmente
[img=http://img387.imageshack.us/img387/1993/linearoadb2ah.png]
Silvio wrote:mi daresti solo una dritta a disegnare il rettangolo , e il bitmap in mezzo
Ora l'immagine la vedo.
EMG
Function DrawLine( hDC, x, y , high, widht, color)
LOCAL n, hPen, hOldPen
hPen := CreatePen( 0, 2, color )
hOldPen := SelectObject( hDc, hPen )
MoveTo( hDC, y, x )
LineTo( hDC, widht, high)
SelectObject( hDc, hOldPen )
DeleteObject( hPen )
return NILSilvio wrote:con questo metodo sarebbe più facile a disegnare ste linee
DrawLine( hDC, 0, 0 , 0,100,CLR_BLACK) peresempio
Silvio wrote:Adesso però ho un problema
per intenderci la classe tab disegna il suo controllo in fondo mentre io voglio disegnarlo sopra dove è l'istruzione che fa questo ?
Silvio wrote:HAI RICEVUTO I FILES ?
ok
ho trovato l'errore c'era scritto ownd:bottom() o qualcosa di simile e quindi adesso va ok
ho inserito anche la bitmap al centro : se vedi il metodo new per intenderci
Quindi adesso la classe disegna la linea bene o male e cmq fno a qui ci siamo ( poi la potrei modificare alla fine)
io la richiamo semplicemente con
@ 0,0 Rbook oRB of oWnd
niente di piu' facile
adesso devo mettere i get
e dove li metto ?
cioè se li metto in metodo Paint poi li posso editare ?
oppure li devo inserire nel metodo New/redefine?