Natter wrote:O'k, thanks !
Is it possible to enable/disable scolling metroPanel ?
oSBtn[1]:bMMoved = { | nRow, nCol, nFlags | SHOW_FRAME( oSBtn, 1, nOld ), nOld := 1 }
FUNCTION SHOW_FRAME(oBtn, n, nOld)
LOCAL I
FOR I := 1 TO LEN( oBtn )
IF I = nOld .and. n <> nOld
oBtn[i]:Refresh()
ENDIF
IF oBtn[I] <> NIL
IF oBtn[I]:lLarge = .F. .and. i = n
RoundBox( hDC := oBtn[n]:GETDC(), 2, 2, oBtn[i]:nWidth()-1, ;
oBtn[i]:nHeight()-1, , , aVal[81], aVal[82] )
ELSEIF oBtn[I]:lLarge = .T. .and. i = n
RoundBox( hDC := oBtn[n]:GETDC(), 2, 2, oBtn[i]:nWidth() -1, ;
oBtn[i]:nHeight()-1, , , aVal[81], aVal[82] )
ENDIF
ENDIF
NEXT
RETURN NIL
Natter wrote:As you can move metropanel to the extreme left/right position ?
METHOD NewAt( oWnd, cTitle, nClrText, nClrPane, bLClicked, nBtnSize, ;
nClrThumb, nClrScroll, nRow, nCol, nHeight, nWidth ) CLASS TMetroPanel
DEFAULT cTitle := "Start", nClrText := CLR_WHITE, nClrPane := CLR_GREEN
DEFAULT ::nBtnSize := IfNil( nBtnSize, 132 )
DEFAULT ::nMetroRows := Int( GetSysMetrics( 1 ) / ( ::nBtnSize + BTN_GAP ) ) - 1
DEFAULT ::nMetroTop := ::nBtnSize
DEFAULT ::nMetroMargin := ::nBtnSize
::Super:New( 0, 0, GetSysMetrics( 1 ) , GetSysMetrics( 0 ), oWnd ) // Here nRow, nCol, nHeight, nWidth
.../...
ukoenig wrote:Cristobal,
maybe adding as well a solution to get a button-focus-effect.
For the moment I added a little function to paint a border around the button
on focus and destroy the border on lost focus.
I had to find another solution because there is no action on
:bgotfocus and :bLostfocus.
That works fine and the user can select the border-color and pensize.
Also I asked for showing a button < disabled > if possible.
I still remember a question about < on button-move > saving the new button-positions
This option is disabled using my solution because of using < :bMMoved >
sample :
DEFINE METROBUTTON oSBtn[60] OF oMenu1 ;
COLOR aVal[73], aVal[72] ;
CAPTION "Rechnungen" ;
ALIGN "TOPLEFT" ;
GROUP 2 ;
BITMAP c_Pfad1 + "Save.bmp" ;
BMPALIGN "MIDDLECENTER" ;
SIZE 50, 50 ;
ACTION RECHNUNG("RECH0") ;
BODYTEXT "testen" ;
TEXTALIGN "BOTTOMCENTER"
oSBtn[60]:nClrCaption := aVal[74]
oSBtn[60]:oFont := oFontTiny
oSBtn[60]:oTextFont := oFontTiny
oSBtn[60]:bMMoved = { | nRow, nCol, nFlags | SHOW_FRAME( oSBtn, 60, nOld ), nOld := 60 }
- Code: Select all Expand view
oSBtn[1]:bMMoved = { | nRow, nCol, nFlags | SHOW_FRAME( oSBtn, 1, nOld ), nOld := 1 }
FUNCTION SHOW_FRAME(oBtn, n, nOld)
LOCAL I
FOR I := 1 TO LEN( oBtn )
IF I = nOld .and. n <> nOld
oBtn[i]:Refresh()
ENDIF
IF oBtn[I] <> NIL
IF oBtn[I]:lLarge = .F. .and. i = n
RoundBox( hDC := oBtn[n]:GETDC(), 2, 2, oBtn[i]:nWidth()-1, ;
oBtn[i]:nHeight()-1, , , aVal[81], aVal[82] )
ELSEIF oBtn[I]:lLarge = .T. .and. i = n
RoundBox( hDC := oBtn[n]:GETDC(), 2, 2, oBtn[i]:nWidth() -1, ;
oBtn[i]:nHeight()-1, , , aVal[81], aVal[82] )
ENDIF
ENDIF
NEXT
RETURN NIL
best regards
Uwe
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 56 guests