to Antonio : ERROR Violation <PROTECTED>: NTOPMARG

to Antonio : ERROR Violation <PROTECTED>: NTOPMARG

Postby Silvio » Thu Dec 17, 2009 11:38 am

I insert a button on ribbonbar with an action

ACTION ChangeColors( oRBar, { { 0.12, 16777215, 10674091 }, { 0.70, 10674091, 32768 }, { 0.18, 32768, 16777215 } } )


//your function to change color on ribbonbar


function ChangeColors( oRb, aGrad )

local hBmp := GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3,;
oRb:nBottom - oRb:nTopMargin + 1, aGrad )
local n, j, z, oControl

oRb:aGrad := aGrad

DeleteObject( oRb:hBrushEx )
oRb:hBrushEx = CreatePatternBrush( hBmp )
DeleteObject( hBmp )

oRb:Refresh()

for n = 1 to Len( oRb:aDialogs )
DeleteObject( oRb:aDialogs[ n ]:hBack )
oRb:aDialogs[ n ]:hBack = oRb:hBrushEx
if ! Empty( oRb:aDialogs[ n ]:aControls )
for j = 1 to len( oRb:aDialogs[ n ]:aControls )
oControl = oRb:aDialogs[ n ]:aControls[ j ]
if oControl:ClassName() == "TRBGROUP"
DeleteObject( oControl:hBrushUnsel )
oControl:hBrushUnsel = oRb:hBrushEx
DeleteObject( oControl:hBrushSel )
oControl:hBrushSel = nil
endif
next
endif

oRb:aDialogs[ n ]:Refresh()
next

return nil





WHY IT MAKE ERROR ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: to Antonio : ERROR Violation <PROTECTED>: NTOPMARG

Postby Otto » Thu Dec 17, 2009 1:00 pm

Hello Silvio,

why don’t you post a self-contained sample?
Regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: to Antonio : ERROR Violation <PROTECTED>: NTOPMARG

Postby Daniel Garcia-Gil » Thu Dec 17, 2009 1:22 pm

Hello Silvio...

This error is generated because you try change the nTopMargin value ... we can not modify this value
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: to Antonio : ERROR Violation <PROTECTED>: NTOPMARG

Postby Silvio » Thu Dec 17, 2009 1:55 pm

ChangeColors function wrote by Antonio Linares
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: to Antonio : ERROR Violation <PROTECTED>: NTOPMARG

Postby Daniel Garcia-Gil » Thu Dec 17, 2009 2:39 pm

Silvio...

I dont talk about this function.... maybe you have this error in other lines
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: to Antonio : ERROR Violation <PROTECTED>: NTOPMARG

Postby Silvio » Thu Dec 17, 2009 2:44 pm

NO
Image

I insert on circle button You can see in this picture a popupmenu

oBtnCircle:bAction:={ | nRow, nCol | Config_Ribbon(oBtnCircle, nRow, nCol,oRBar )}


.....



Function Config_Ribbon(obutton, nRow, nCol,oRBar )

local oMenu

MENU oMenu POPUP 2007
MENUITEM "&Green Style" ACTION ChangeColors( oRBar, { { 0.12, 16777215, 10674091 }, { 0.70, 10674091, 32768 }, { 0.18, 32768, 16777215 } } )
MENUITEM "&Silver Style"
MENUITEM "&Windows 7 Style"
MENUITEM "&Default" ACTION ChangeColors( oRBar, { {0.12, BLUE0, BLUE0 }, { 0.70, BLUE1, BLUE0 }, { 0.18, BLUE0, CLR_WHITE }} )
ENDMENU

ACTIVATE MENU oMenu AT nRow, nCol OF obutton


obutton :refresh()
oRBar:refresh()

return NIL





Any Idea ? How I can resolve the problem ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: to Antonio : ERROR Violation <PROTECTED>: NTOPMARG

Postby Silvio » Fri Dec 18, 2009 8:09 am

Daniel if I rem protected it run ok
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests