TSkinButton

Fonte: source/classes/tskinbtn.prg

Standalone class (not a visual control, not from TControl)

TSkinButton is a color-skin definition class for skinned buttons. It is a non-visual data class that stores gradient arrays and border color pairs for four button states: focused, pressed, normal, and disabled. The default constructor values produce an Office 2007-inspired blue theme. Apply a TSkinButton instance to any compatible button control via oBtn:SetSkin( oSkin ).

Key DATA Members

DATATypeDescription
aClrFocusedArrayGradient array for the focused/hover state
aClrPressedArrayGradient array for the pressed state
aClrNormalArrayGradient array for the default/normal state
aClrDisabledArrayGradient array for the disabled state
nClrBorder0_FNumericBorder color 1, focused state
nClrBorder1_FNumericBorder color 2, focused state
nClrBorder0_PNumericBorder color 1, pressed state
nClrBorder1_PNumericBorder color 2, pressed state
nClrBorder0_NNumericBorder color 1, normal state
nClrBorder1_NNumericBorder color 2, normal state
nClrTextDisable_0NumericText color for disabled state
nClrTextDisable_1Numeric3D highlight text color for disabled state

Methods

MethodDescription
New( aClrFocused, aClrPressed, aClrNormal, aClrDisabled, nClrBdr0_F, nClrBdr1_F, nClrBdr0_P, nClrBdr1_P, nClrBdr0_N, nClrBdr1_N, nClrTxtDis0, nClrTxtDis1 )Create a TSkinButton skin definition with custom colors

Example: Custom Skin and Apply

#include "FiveWin.ch"

function Main()

   local oWnd, oBtn, oSkin

   DEFINE WINDOW oWnd TITLE "SkinButton Demo" SIZE 300, 200

   // Create a custom skin (Office 2007 blue defaults)
   oSkin := TSkinButton():New()

   // Apply to a button
   @ 20, 20 BTNBMP oBtn ;
      SIZE 100, 30 PIXEL OF oWnd ;
      PROMPT "Skinned"
   oBtn:SetSkin( oSkin )

   ACTIVATE WINDOW oWnd CENTERED

return nil

Notes

Veja Também