No longer using extra icons for hilighted and disabled state, but drawing them with toolbox transform modes.

This commit is contained in:
pinkerton 1998-04-17 22:39:57 +00:00
parent bc4117282b
commit a153945b9c
3 changed files with 19 additions and 12 deletions

View File

@ -84,6 +84,7 @@ CButton::CButton(LStream *inStream)
{
mButtonMask = NULL;
mGraphicHandle = NULL;
mIconTransform = kTransformNone;
SetTrackInside(false);
*inStream >> mTrackBehaviour;
@ -342,7 +343,7 @@ void CButton::DrawButtonGraphic(void)
else if (mGraphicType == 'ICN#')
{
CIconFamily theFamily(GetGraphicID());
theFamily.Plot(mCachedGraphicFrame, mGraphicAlignment);
theFamily.Plot(mCachedGraphicFrame, mGraphicAlignment, mIconTransform);
}
else
{

View File

@ -119,6 +119,7 @@ class CButton : public LControl, public MPaneEnablerPolicy
Int16 mGraphicPadPixels;
CIconHandle mGraphicHandle;
IconTransformType mIconTransform;
private:
virtual void HandleEnablingPolicy();

View File

@ -91,27 +91,32 @@ void CPatternButton::DrawButtonContent(void)
void CPatternButton::DrawButtonGraphic(void)
{
ResIDT theSaveID = GetGraphicID();
ResIDT theNewID = theSaveID;
bool useMouseOverIcon = false;
mIconTransform = kTransformNone;
if (IsEnabled() && IsActive())
{
{
if (!IsBehaviourButton() && (GetValue() == Button_On))
{
// do something different if IsTrackInside()
theNewID += 2;
//theNewID += 2;
}
else if (IsTrackInside())
theNewID += 3;
mIconTransform = kTransformSelected;
else if (IsMouseInFrame())
theNewID += 2;
}
useMouseOverIcon = true;
}
else
theNewID += 1;
mIconTransform = kTransformDisabled;
SetGraphicID(theNewID);
ResIDT theIconID;
if ( useMouseOverIcon ) {
theIconID = GetGraphicID();
SetGraphicID(theIconID + 2);
}
CToolbarButton::DrawButtonGraphic();
SetGraphicID(theSaveID);
if ( useMouseOverIcon )
SetGraphicID(theIconID);
}
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ