From 4d8c3a49496fafbbd128dbbbf9ea45c8c4fb330c Mon Sep 17 00:00:00 2001 From: pinkerton Date: Tue, 2 Jun 1998 21:39:14 +0000 Subject: [PATCH] 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 --- mozilla/cmd/macfe/Composer/CEditView.cp | 6 +- mozilla/cmd/macfe/Composer/CEditView.h | 5 +- mozilla/lib/mac/UserInterface/CEnvironment.cp | 7 -- .../mac/UserInterface/CProgressListener.cp | 14 ++-- .../lib/mac/UserInterface/CProgressListener.h | 21 +++--- .../mac/UserInterface/CScrollerWithArrows.cp | 66 ++++++++++++++----- .../mac/UserInterface/CScrollerWithArrows.h | 17 +++-- 7 files changed, 83 insertions(+), 53 deletions(-) diff --git a/mozilla/cmd/macfe/Composer/CEditView.cp b/mozilla/cmd/macfe/Composer/CEditView.cp index b5c406b9976..6c8d6cfd8fe 100644 --- a/mozilla/cmd/macfe/Composer/CEditView.cp +++ b/mozilla/cmd/macfe/Composer/CEditView.cp @@ -61,7 +61,7 @@ #include "allxpstr.h" #undef WANT_ENUM_STRING_IDS -//#include +#include #ifdef PROFILE #include @@ -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' ); diff --git a/mozilla/cmd/macfe/Composer/CEditView.h b/mozilla/cmd/macfe/Composer/CEditView.h index 126f5c359ae..22f68ae849f 100644 --- a/mozilla/cmd/macfe/Composer/CEditView.h +++ b/mozilla/cmd/macfe/Composer/CEditView.h @@ -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; diff --git a/mozilla/lib/mac/UserInterface/CEnvironment.cp b/mozilla/lib/mac/UserInterface/CEnvironment.cp index 674bb2f394d..94911e73538 100644 --- a/mozilla/lib/mac/UserInterface/CEnvironment.cp +++ b/mozilla/lib/mac/UserInterface/CEnvironment.cp @@ -20,8 +20,6 @@ #include #include -#include - // --------------------------------------------------------------------------- // ¥ 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))))); diff --git a/mozilla/lib/mac/UserInterface/CProgressListener.cp b/mozilla/lib/mac/UserInterface/CProgressListener.cp index 5159fb6677a..372fdf14a62 100644 --- a/mozilla/lib/mac/UserInterface/CProgressListener.cp +++ b/mozilla/lib/mac/UserInterface/CProgressListener.cp @@ -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(super->FindPaneByID('Stat')); + mProgressCaption = dynamic_cast(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) { diff --git a/mozilla/lib/mac/UserInterface/CProgressListener.h b/mozilla/lib/mac/UserInterface/CProgressListener.h index 2da1da9208b..14b08710cf3 100644 --- a/mozilla/lib/mac/UserInterface/CProgressListener.h +++ b/mozilla/lib/mac/UserInterface/CProgressListener.h @@ -23,7 +23,8 @@ #include -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 diff --git a/mozilla/lib/mac/UserInterface/CScrollerWithArrows.cp b/mozilla/lib/mac/UserInterface/CScrollerWithArrows.cp index 58d91e81f55..77c07ca446a 100644 --- a/mozilla/lib/mac/UserInterface/CScrollerWithArrows.cp +++ b/mozilla/lib/mac/UserInterface/CScrollerWithArrows.cp @@ -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 #include -#include +#include #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 \ No newline at end of file +} // 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 \ No newline at end of file diff --git a/mozilla/lib/mac/UserInterface/CScrollerWithArrows.h b/mozilla/lib/mac/UserInterface/CScrollerWithArrows.h index 07ff914c122..51ddfcec844 100644 --- a/mozilla/lib/mac/UserInterface/CScrollerWithArrows.h +++ b/mozilla/lib/mac/UserInterface/CScrollerWithArrows.h @@ -36,7 +36,7 @@ #pragma once -#include +#include 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 \ No newline at end of file