Backing out appearance manager changes because Apple won't be able to deliver an SDK that fits our needs and works with pre 8.5 systems. Code is still in the tree if it ever wants to be pulled out again later (appr sdagley).

git-svn-id: svn://10.0.0.236/trunk@2954 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pinkerton
1998-06-02 21:39:14 +00:00
parent d7608e4b39
commit 4d8c3a4949
7 changed files with 83 additions and 53 deletions

View File

@@ -61,7 +61,7 @@
#include "allxpstr.h"
#undef WANT_ENUM_STRING_IDS
//#include <LGAPopup.h>
#include <LGAPopup.h>
#ifdef PROFILE
#include <profiler.h>
@@ -261,8 +261,8 @@ void CEditView::FinishCreateSelf(void)
while (view->GetSuperView())
view = view->GetSuperView();
mParagraphToolbarPopup = (LControl *)view->FindPaneByID( cmd_Paragraph_Hierarchical_Menu );
mSizeToolbarPopup = (LControl *)view->FindPaneByID( cmd_Font_Size_Hierarchical_Menu );
mParagraphToolbarPopup = (LGAPopup *)view->FindPaneByID( cmd_Paragraph_Hierarchical_Menu );
mSizeToolbarPopup = (LGAPopup *)view->FindPaneByID( cmd_Font_Size_Hierarchical_Menu );
mAlignToolbarPopup = (CPatternButtonPopup *)view->FindPaneByID( cmd_Align_Hierarchical_Menu );
mFontToolbarPopup = (CFontMenuPopup *)view->FindPaneByID( 'Font' );
mColorPopup = (CColorPopup *)view->FindPaneByID( 'Colr' );

View File

@@ -27,6 +27,7 @@ Boolean GetCaretPosition(MWContext *context, LO_Element * element, int32 caretPo
int32* caretX, int32* caretYLow, int32* caretYHigh );
class LGAPopup;
class CPatternButtonPopup;
class CColorPopup;
class CComposeSession;
@@ -178,8 +179,8 @@ public:
CEditView &view;
};
LControl * mParagraphToolbarPopup;
LControl * mSizeToolbarPopup;
LGAPopup * mParagraphToolbarPopup;
LGAPopup * mSizeToolbarPopup;
CFontMenuPopup * mFontToolbarPopup;
CPatternButtonPopup * mAlignToolbarPopup;
CColorPopup * mColorPopup;

View File

@@ -20,8 +20,6 @@
#include <UEnvironment.h>
#include <Gestalt.h>
#include <Appearance.h>
// ---------------------------------------------------------------------------
// ¥ SetFeature
@@ -34,11 +32,6 @@ CEnvironment::SetAllFeatures()
Int32 theResponse;
OSErr theErr = ::Gestalt(gestaltDragMgrAttr, &theResponse);
// for Appearance Manager support, register as a client of the appearance mgr
UEnvironment::InitEnvironment();
if ( UEnvironment::HasFeature(env_HasAppearance) )
::RegisterAppearanceClient();
UEnvironment::SetFeature(
env_HasDragMgrImageSupport,
(((theErr == noErr) && (theResponse & (1L << gestaltDragMgrHasImageSupport)))));

View File

@@ -21,7 +21,7 @@
#include "CProgressListener.h"
#include "CProgressCaption.h"
#include "CPatternProgressBar.h"
#include "CNSContext.h" // for progress messages
#include "xp.h"
@@ -35,7 +35,7 @@ CProgressListener::CProgressListener(LView* super, LBroadcaster* context)
{
Assert_(super);
Assert_(context);
mProgressCaption = dynamic_cast<CProgressCaption*>(super->FindPaneByID('Stat'));
mProgressCaption = dynamic_cast<CPatternProgressCaption*>(super->FindPaneByID('Stat'));
mProgressLastTicks = 0;
mMessageLastTicks = 0;
mPercentLastTicks = 0;
@@ -67,12 +67,16 @@ void CProgressListener::ListenToMessage(MessageT inMessage, void *ioParam)
switch (inMessage)
{
// case msg_NSCStartLoadURL:
// case msg_NSCProgressBegin:
// // context is busy
// break;
case msg_NSCProgressEnd:
case msg_NSCAllConnectionsComplete:
case msg_NSCFinishedLayout:
if (mLaziness == lazy_VeryButForThisCommandOnly)
mLaziness = mPreviousLaziness;
mProgressCaption->SetValue(0);
mProgressCaption->SetValue(CPatternProgressCaption::eSeamless);
mProgressCaption->SetDescriptor("\p");
break;
@@ -84,6 +88,7 @@ void CProgressListener::ListenToMessage(MessageT inMessage, void *ioParam)
mProgressLastTicks = ::TickCount();
CContextProgress* progress = (CContextProgress*)ioParam;
mProgressCaption->SetDescriptor(progress->mMessage);
// mProgressCaption->SetValue(progress->mPercent);
}
}
break;
@@ -104,7 +109,6 @@ void CProgressListener::ListenToMessage(MessageT inMessage, void *ioParam)
mProgressCaption->SetDescriptor("\p");
}
break;
case msg_NSCProgressPercentChanged:
if (::TickCount() - mPercentLastTicks >= MIN_TICKS)
{

View File

@@ -23,7 +23,8 @@
#include <LListener.h>
class CProgressCaption;
class LCaption;
class CPatternProgressCaption;
class LBroadcaster;
//======================================
@@ -60,7 +61,7 @@ public:
lazy_VeryButForThisCommandOnly
};
CProgressListener(CProgressCaption* progressCaption)
CProgressListener(CPatternProgressCaption* progressCaption)
: mProgressCaption(progressCaption) {}
CProgressListener(LView* superview, LBroadcaster* broadcaster);
// The broadcaster is the one to listen to.
@@ -69,12 +70,12 @@ public:
void SetLaziness(ProgressBarLaziness inLaziness);
protected:
CProgressCaption* mProgressCaption;
unsigned long mProgressLastTicks;
unsigned long mMessageLastTicks;
unsigned long mPercentLastTicks;
ProgressBarLaziness mLaziness;
ProgressBarLaziness mPreviousLaziness;
// LCaption* mCaption;
// CProgressBar* mProgressBar;
CPatternProgressCaption* mProgressCaption;
unsigned long mProgressLastTicks;
unsigned long mMessageLastTicks;
unsigned long mPercentLastTicks;
ProgressBarLaziness mLaziness;
ProgressBarLaziness mPreviousLaziness;
}; // class ProgressListener

View File

@@ -23,8 +23,7 @@
// See header file for class descriptions.
//
// NOTES:
// - does not yet autoscroll when doing drag and drop. Autoscroll seems to be broken with
// new AM implementation for arrows.
// - does not yet autoscroll when doing drag and drop
// - icons for horizontal orientation are incorrect, but we don't have any better ones
// in the app so I just put the vertical ones in as place holders.
// - has only been tested in vertical orientation
@@ -35,7 +34,7 @@
#include <LStdControl.h>
#include <PP_Types.h>
#include <Appearance.h>
#include <UGAColorRamp.h>
#pragma mark -- class CScrollArrowControl
@@ -187,18 +186,22 @@ CScrollerWithArrows :: MakeOneScrollArrow ( const SPaneInfo &inPaneInfo,
ScrollDir inScrollWhichWay )
{
ResIDT iconID = 0;
MessageT value = 0;
SControlInfo controlInfo;
controlInfo.value = 0;
controlInfo.minValue = 0;
controlInfo.maxValue = 0;
if ( inScrollWhichWay == kUpLeft ) {
value = kControlUpButtonPart;
iconID = IsVertical() ? CScrollArrowControl::kIconUp : CScrollArrowControl::kIconLeft;
controlInfo.valueMessage = kControlUpButtonPart;
iconID = IsVertical() ? CScrollArrowControl::kIconUp : CScrollArrowControl::kIconLeft;
}
else {
value = kControlDownButtonPart;
controlInfo.valueMessage = kControlDownButtonPart;
iconID = IsVertical() ? CScrollArrowControl::kIconDown : CScrollArrowControl::kIconRight;
}
return new CScrollArrowControl ( inPaneInfo, value, iconID );
return new CScrollArrowControl ( inPaneInfo, controlInfo, iconID );
} // MakeOneScrollArrow
@@ -463,14 +466,20 @@ CScrollerWithArrows::ListenToMessage( MessageT inMessage, void *ioParam)
#pragma mark -- class CScrollArrowControl
CScrollArrowControl :: CScrollArrowControl (
const SPaneInfo &inPaneInfo,
MessageT inValueMessage,
Int16 inContentResID )
: LIconControl ( inPaneInfo, inValueMessage, kControlIconSuiteNoTrackProc, inContentResID )
CScrollArrowControl :: CScrollArrowControl ( const SPaneInfo &inPaneInfo,
const SControlInfo &inControlInfo,
ResIDT inIconResID )
: LGAIconButton ( inPaneInfo, inControlInfo, controlMode_Button, inIconResID,
sizeSelector_SmallIconSize, iconPosition_Center )
{
SetIconAlignment( kAlignAbsoluteCenter );
// nothing else needed
}
CScrollArrowControl :: CScrollArrowControl ( LStream* inStream )
:LGAIconButton(inStream)
{
// nothing else needed
}
@@ -483,8 +492,31 @@ CScrollArrowControl :: CScrollArrowControl (
void
CScrollArrowControl :: HotSpotAction ( Int16 inHotSpot, Boolean inCurrInside, Boolean inPrevInside )
{
LIconControl::HotSpotAction ( inHotSpot, inCurrInside, inPrevInside );
LGAIconButton::HotSpotAction ( inHotSpot, inCurrInside, inPrevInside );
if ( inCurrInside )
BroadcastValueMessage();
} // HotSpotAction
} // HotSpotAction
//
// DrawSelf
//
// While the cursor tracking, etc of LGAIconButton is great, we don't want a border around
// the scroll triangle (it just looks bad). Only paint the background and draw the icon
//
void
CScrollArrowControl :: DrawSelf ( )
{
StColorPenState::Normalize ();
// Get the frame for the control and paint it
Rect localFrame;
CalcLocalFrameRect ( localFrame );
localFrame.right--;
::RGBForeColor ( &UGAColorRamp::GetColor(2));
::PaintRect ( &localFrame );
DrawIcon();
} // DrawSelf

View File

@@ -36,7 +36,7 @@
#pragma once
#include <LIconControl.h>
#include <LGAIconButton.h>
class CScrollerWithArrows : public LView,
@@ -92,20 +92,19 @@ protected:
}; // class CScrollerWithArrows
class CScrollArrowControl : public LIconControl
class CScrollArrowControl : public LGAIconButton
{
public:
enum { class_ID = 'CSAC', imp_class_ID = 'iSAC' } ;
enum { kIconUp = 14505, kIconDown = 14505, kIconLeft = 14504, kIconRight = 14505 } ;
enum { class_ID = 'CSAC' } ;
enum { kIconUp = 14504, kIconDown = 14505, kIconLeft = 14504, kIconRight = 14505 } ;
CScrollArrowControl(
const SPaneInfo &inPaneInfo,
MessageT inValueMessage,
Int16 inContentResID );
CScrollArrowControl ( const SPaneInfo &inPaneInfo, const SControlInfo &inControlInfo,
ResIDT inIconResID );
CScrollArrowControl ( LStream* inStream ) ;
protected:
// virtual void DrawSelf ( ) ;
virtual void DrawSelf ( ) ;
virtual void HotSpotAction ( Int16 inHotSpot, Boolean inCurrInside, Boolean inPrevInside );
}; // class CScrollArrowControl