Landing of a bunch of appearance manager stuff. (appr sdagley).

This commit is contained in:
pinkerton 1998-05-22 04:19:24 +00:00
Родитель a1ab3d3e9a
Коммит fcc3270223
26 изменённых файлов: 206 добавлений и 243 удалений

Просмотреть файл

@ -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 = (LGAPopup *)view->FindPaneByID( cmd_Paragraph_Hierarchical_Menu );
mSizeToolbarPopup = (LGAPopup *)view->FindPaneByID( cmd_Font_Size_Hierarchical_Menu );
mParagraphToolbarPopup = (LControl *)view->FindPaneByID( cmd_Paragraph_Hierarchical_Menu );
mSizeToolbarPopup = (LControl *)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' );

Просмотреть файл

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

Просмотреть файл

@ -45,6 +45,18 @@
#include <LTextColumn.h>
#include <LSubOverlapView.h>
// ¥¥¥ AM wrappers classes and their AM implementations
#include <LStaticText.h>
#include <LAMStaticTextImp.h>
#include <LIconControl.h>
#include <LProgressBar.h>
#include <LPushButton.h>
#include <LAMPushButtonImp.h>
// ¥¥¥ Things that will go away after appearance conversion complete
#include "CProgressBar.h"
#include "CPatternBevelView.h"
// ¥¥¥ PowerPlant Grayscale Classes
#include <UGALibRegistry.h>
@ -66,8 +78,6 @@
#include "CClusterView.h"
#include "CTabSwitcher.h"
#include "CPatternTabControl.h"
#include "CProgressBar.h"
// #include "CProgressCaption.h"
#include "CTaskBarView.h"
#include "LTableHeader.h"
#include "LTableViewHeader.h"
@ -192,7 +202,6 @@ void RegisterAllBrowserClasses(void)
RegisterClass_(LTabGroup);
RegisterClass_(LActiveScroller);
//LRegistrar::RegisterClass('prto', (ClassCreatorFunc);LPrintout::CreateOldPrintoutStream);
#ifdef PP_NewClasses
#include <LCicnButton.h>
@ -213,6 +222,22 @@ void RegisterAllBrowserClasses(void)
// ¥¥¥ PowerPlant Grayscale Classes
RegisterGALibraryClasses();
// ¥¥¥ PowerPlant appearance manager classes and their implementations
RegisterClass_(LStaticText);
RegisterClassID_(LAMStaticTextImp, LStaticText::imp_class_ID);
RegisterClass_(LIconControl);
RegisterClassID_(LAMControlImp, LIconControl::imp_class_ID);
RegisterClass_(LProgressBar);
RegisterClassID_(LAMControlImp, LProgressBar::imp_class_ID);
RegisterClass_(LPushButton);
RegisterClassID_(LAMPushButtonImp, LPushButton::imp_class_ID);
// RegisterClass_(LBevelButton);
// RegisterClassID_(LAMControlImp, LBevelButton::imp_class_ID);
// ¥¥¥ Things that will go away after appearance port complete
RegisterClass_(CProgressBar);
RegisterClass_(CPatternBevelView);
// ¥¥¥ General Purpose UI Classes
RegisterClass_(CBevelButton);
RegisterClass_(CDeluxeBevelButton);
@ -227,7 +252,6 @@ void RegisterAllBrowserClasses(void)
RegisterClass_(CClusterView);
RegisterClass_(CPatternTabControl);
RegisterClass_(CTabSwitcher);
RegisterClass_(CProgressBar);
RegisterClass_(CKeyScrollAttachment);
RegisterClass_(CToolTipAttachment);
RegisterClass_(CDynamicTooltipPane);
@ -236,7 +260,6 @@ void RegisterAllBrowserClasses(void)
RegisterClass_(CPaneEnabler);
RegisterClass_(CSlaveEnabler);
RegisterClass_(CScrollerWithArrows);
RegisterClass_(CScrollArrowControl);
#ifdef MOZ_MAIL_NEWS
RegisterClass_(CSingleLineEditField);

Просмотреть файл

@ -29,14 +29,13 @@
#include "resgui.h"
#include "xp_file_mac.h"
#include "DirectoryCopy.h"
#include <LGARadioButton.h>
#include <LGAPushButton.h>
#include <LGAEditField.h>
// for multi-user profile support in PE
#include "MUC.h"
#include <CodeFragments.h>
#include <LString.h>
#include <LPushButton.h>
#define updateWizardDialog 9800
@ -305,11 +304,11 @@ CUserProfile::GetUserProfile( const FSSpec& usersFolder, FSSpec& profileFolder,
return result;
}
static void PrefToEditField(const char * prefName, LGAEditField * field);
static void EditFieldToPref(LGAEditField * field, const char * prefName);
static void PrefToEditField(const char * prefName, LEditField * field);
static void EditFieldToPref(LEditField * field, const char * prefName);
#define PREF_STRING_LEN 255
void PrefToEditField(const char * prefName, LGAEditField * field)
const Uint32 PREF_STRING_LEN = 255;
void PrefToEditField(const char * prefName, LEditField * field)
{
int prefStringLen;
char prefString[PREF_STRING_LEN];
@ -321,7 +320,7 @@ void PrefToEditField(const char * prefName, LGAEditField * field)
}
}
void EditFieldToPref(LGAEditField * field, const char * prefName)
void EditFieldToPref(LEditField * field, const char * prefName)
{
Str255 s;
field->GetDescriptor(s);
@ -337,11 +336,11 @@ CUserProfile::DoNetExtendedProfileDialog(LCommander * super)
StDialogHandler theHandler(9911, super);
LWindow *theDialog = theHandler.GetDialog();
LGAEditField *ldapAddressField = (LGAEditField*)theDialog->FindPaneByID('addr');
LGAEditField *searchBaseField = (LGAEditField*)theDialog->FindPaneByID('sbas');
LGAEditField *httpAddressField = (LGAEditField*)theDialog->FindPaneByID('hurl');
LGARadioButton * ldapRadio = (LGARadioButton *)theDialog->FindPaneByID('ldap');
LGARadioButton * httpRadio = (LGARadioButton *)theDialog->FindPaneByID('http');
LEditField *ldapAddressField = dynamic_cast<LEditField*>(theDialog->FindPaneByID('addr'));
LEditField *searchBaseField = dynamic_cast<LEditField*>(theDialog->FindPaneByID('sbas'));
LEditField *httpAddressField = dynamic_cast<LEditField*>(theDialog->FindPaneByID('hurl'));
LControl * ldapRadio = dynamic_cast<LControl*>(theDialog->FindPaneByID('ldap'));
LControl * httpRadio = dynamic_cast<LControl*>(theDialog->FindPaneByID('http'));
ThrowIfNil_(ldapAddressField);
ThrowIfNil_(searchBaseField);
@ -405,8 +404,8 @@ CUserProfile::DoNetProfileDialog()
StDialogHandler theHandler(9910, CFrontApp::GetApplication());
LWindow *theDialog = theHandler.GetDialog();
LGAEditField *usernameField = (LGAEditField*)theDialog->FindPaneByID('user');
LGAEditField *passwordField = (LGAEditField*)theDialog->FindPaneByID('pass');
LEditField *usernameField = dynamic_cast<LEditField*>(theDialog->FindPaneByID('user'));
LEditField *passwordField = dynamic_cast<LEditField*>(theDialog->FindPaneByID('pass'));
ThrowIfNil_(usernameField);
ThrowIfNil_(passwordField);
@ -565,7 +564,7 @@ ProfileErr CUserProfile::HandleProfileDialog(
profileManagerDialog : profileSelectDialog;
Boolean success = false;
LListBox* listBox;
LGAPushButton* okButton;
LPushButton* okButton;
LPane* newButton;
LPane* deleteButton;
LPane* renameButton;
@ -588,12 +587,15 @@ ProfileErr CUserProfile::HandleProfileDialog(
listBox->AddListener( &dialog );
listBox->SwitchTarget( listBox );
okButton = (LGAPushButton*)dialog.GetDialog()->FindPaneByID( 'ok ' );
okButton = dynamic_cast<LPushButton*>(dialog.GetDialog()->FindPaneByID( 'ok ' ));
deleteButton = dialog.GetDialog()->FindPaneByID( 2 );
renameButton = dialog.GetDialog()->FindPaneByID( 3 );
newButton = dialog.GetDialog()->FindPaneByID( 1 );
optionsButton = dialog.GetDialog()->FindPaneByID( 'Ebut' );
if ( okButton )
okButton->SetDefaultButton(true);
if ( wantsProfileManager )
ThrowIfNil_( okButton && deleteButton && renameButton && newButton );
else

Просмотреть файл

@ -22,7 +22,6 @@
#include "CDownloadProgressWindow.h"
#include "CNSContext.h"
#include "CProgressBar.h"
#include "COffscreenCaption.h"
#include "Netscape_Constants.h"
#include "PascalString.h"
@ -31,6 +30,7 @@
#include "resgui.h"
#include <PP_Messages.h>
#include <LProgressBar.h>
#define MIN_TICKS (60/4) // Don't refresh the progress bar more than 4x /sec.
@ -99,7 +99,7 @@ void CDownloadProgressWindow::FinishCreateSelf(void)
{
CMediatedWindow::FinishCreateSelf();
mBar = dynamic_cast<CProgressBar*>(FindPaneByID(PaneID_ProgressBar));
mBar = dynamic_cast<LProgressBar*>(FindPaneByID(PaneID_ProgressBar));
Assert_(mBar != NULL);
mMessage = dynamic_cast<COffscreenCaption*>(FindPaneByID(PaneID_ProgressMessage));

Просмотреть файл

@ -23,7 +23,7 @@
#include "CSaveWindowStatus.h"
#include <LListener.h>
class CProgressBar;
class LProgressBar;
class COffscreenCaption;
const ResIDT WIND_DownloadProgress = 1011;
@ -80,7 +80,7 @@ class CDownloadProgressWindow :
virtual void NoteProgressEnd(const CContextProgress& inProgress);
CNSContext* mContext;
CProgressBar* mBar;
LProgressBar* mBar;
COffscreenCaption* mMessage;
COffscreenCaption* mComment;
Boolean mClosing;

Просмотреть файл

@ -25,7 +25,8 @@
#include "CContextMenuAttachment.h"
#include "Netscape_constants.h"
#include "UGAColorRamp.h"
//#include "UGAColorRamp.h"
#include <Appearance.h>
#pragma mark -- CNavCenterSelectorPane methods --
@ -79,9 +80,12 @@ CNavCenterSelectorPane::DrawSelf()
CalcLocalFrameRect(cellBounds);
// erase the background
StColorState saved;
::RGBBackColor(&UGAColorRamp::GetColor(colorRamp_Gray2));
::EraseRect(&cellBounds);
StColorPenState saved;
// ::SetThemeBackground( kThemeActiveWindowHeaderTextColor, 8, false );
Rect bevelRect = cellBounds;
InsetRect ( &bevelRect, -3, -3 );
::DrawThemeWindowListViewHeader ( &bevelRect, kThemeStateActive );
// ::EraseRect(&cellBounds);
// find the bounds of the first cell
cellBounds.top = 0;
@ -766,10 +770,7 @@ TitleImage :: TitleImage ( const LStr255 & inTitle, ResIDT inIconID )
void
TitleImage :: DrawInCurrentView( const Rect& inBounds, unsigned long inMode ) const
{
StColorState saved;
::RGBBackColor(&UGAColorRamp::GetColor(colorRamp_Gray2));
::EraseRect(&inBounds);
StColorPenState saved;
Rect iconRect = inBounds;
Rect textbg = { 0, 0, 0, 0 };

Просмотреть файл

@ -30,12 +30,14 @@
#include "CSharedPatternWorld.h"
#include "UGraphicGizmos.h"
#include <Appearance.h>
CPatternedGrippyPane::CPatternedGrippyPane(LStream* inStream)
: LPane(inStream)
{
ResIDT theBackgroundID;
*inStream >> theBackgroundID;
ResIDT ignoredEntry;
*inStream >> ignoredEntry; // read in but ignore (used to be background pattern id)
ResIDT theBackgroundHiliteID;
*inStream >> theBackgroundHiliteID;
@ -47,9 +49,6 @@ CPatternedGrippyPane::CPatternedGrippyPane(LStream* inStream)
ResIDT theTriangleID;
*inStream >> theTriangleID;
mBackPattern = CSharedPatternWorld::CreateSharedPatternWorld(theBackgroundID);
ThrowIfNULL_(mBackPattern);
mBackPattern->AddUser(this);
mBackPatternHilite = CSharedPatternWorld::CreateSharedPatternWorld(theBackgroundHiliteID);
ThrowIfNULL_(mBackPatternHilite);
mBackPatternHilite->AddUser(this);
@ -75,7 +74,6 @@ CPatternedGrippyPane::~CPatternedGrippyPane()
{
mGrippy->RemoveUser(this);
mGrippyHilite->RemoveUser(this);
mBackPattern->RemoveUser(this);
mBackPatternHilite->RemoveUser(this);
::DisposeCIcon(mTriangle);
}
@ -97,13 +95,18 @@ void CPatternedGrippyPane::DrawSelf(void)
// because we may be being drawn offscreen.
CGrafPtr thePort;
::GetPort(&(GrafPtr)thePort);
if ( mMouseInside )
mBackPatternHilite->Fill(thePort, theFrame, theAlignment);
else
mBackPattern->Fill(thePort, theFrame, theAlignment);
UGraphicGizmos::BevelTintRect(theFrame, 1, 0x4000, 0x4000);
else {
// fill and bevel with appearance manager look
Rect bevelFrame = theFrame;
--bevelFrame.top; // get rid of thick bevels on top/left/right
--bevelFrame.left;
++bevelFrame.right;
::DrawThemeWindowListViewHeader ( &bevelFrame, kThemeStateActive );
}
Rect theTriangleFrame = (**mTriangle).iconPMap.bounds;
Rect theTriangleDest = theFrame;
theTriangleDest.bottom = theTriangleDest.top + RectWidth(theFrame);
@ -118,14 +121,13 @@ void CPatternedGrippyPane::DrawSelf(void)
// hack to make it look centered for both drag bars and expand/collapse widget
if ( thePatternDest.right - thePatternDest.left > 5 )
theAlignment.h++;
++theAlignment.h;
if ( mMouseInside )
mGrippyHilite->Fill(thePort, thePatternDest, theAlignment);
else
mGrippy->Fill(thePort, thePatternDest, theAlignment);
// UGraphicGizmos::DrawArithPattern(theFrame, mBottomShadePat, 0x6000, false);
}

Просмотреть файл

@ -22,8 +22,8 @@
// Interface for class that draws a "grippy" pattern in the pane rectangle so users know
// they can drag/click in this area. Also hilights when mouse enters (roll-over feedback).
//
// I didn't actually write this class, just moved it out of DragBar.h.
//
// It is fully Apperance Manager savvy.
//
#pragma once
@ -50,11 +50,10 @@ class CPatternedGrippyPane : public LPane
virtual void DrawSelf(void);
CIconHandle mTriangle;
CSharedPatternWorld* mBackPattern; // back pattern when mouse outside
CSharedPatternWorld* mBackPatternHilite; // back pattern when mouse inside
CSharedPatternWorld* mBackPatternHilite; // back pattern when mouse inside
Boolean mMouseInside;
CSharedPatternWorld* mGrippy; // grippy pattern (gray bg)
CSharedPatternWorld* mGrippyHilite; // grippy pattern hilite (purple bg)
CSharedPatternWorld* mGrippyHilite; // grippy pattern hilite (blue bg)
}; // CPatternedGrippyPane

Просмотреть файл

@ -23,6 +23,8 @@
#include <vector.h>
#include <algorithm>
#include <Appearance.h>
#include "CPersonalToolbarTable.h"
#include "uapp.h"
#include "LTableMultiGeometry.h"
@ -642,8 +644,9 @@ CPersonalToolbarTable :: DrawCell ( const STableCell &inCell, const Rect &inLoca
if ( mDropOn ) { // handle drop on folder
mTextHiliteRect = ComputeTextRect ( iconAndName, inLocalRect );
StColorState savedColorForTextDrawing;
::RGBBackColor(&black);
StColorPenState savedColorForTextDrawing;
::SetThemeBackground ( kThemeDragHiliteBrush, 8, false );
::EraseRect(&mTextHiliteRect);
::TextMode(srcXor);
}
@ -651,6 +654,11 @@ CPersonalToolbarTable :: DrawCell ( const STableCell &inCell, const Rect &inLoca
TextFace(underline);
RGBForeColor( &blue );
}
else {
// it should be the window header text color, but that's not right for some reason
// ::SetThemePen ( kThemeActiveWindowHeaderTextColor, 8, false );
::SetThemePen ( kThemeListViewTextColor, 8, false );
}
::MoveTo(inLocalRect.left + 22, inLocalRect.bottom - 4);
::DrawString(iconAndName.name);

Просмотреть файл

@ -682,47 +682,29 @@ void TurnOn( LControl* control )
control->BroadcastMessage( msg_ControlClicked, (void*)control );
}
Boolean SetPopupToNamedItem( LStdPopupMenu* whichMenu, const CStr255& itemText )
//
// Why pass both the control _and_ the menu when one will do? This is an artifact of
// trying to get rid of the LGA* stuff from all files that don't need it. Once we can do
// that, we can return this routine to it's old glory of only taking the control (pinkerton).
//
Boolean SetMenuToNamedItem( LControl* inControl, MenuHandle inMenu, const CStr255& itemText )
{
MenuHandle menuH;
short menuSize;
Str255 fontName;
menuH = whichMenu->GetMacMenuH();
menuSize = CountMItems( menuH );
short menuSize = CountMItems( inMenu );
for ( short i = 1; i <= menuSize; i++ )
{
::GetMenuItemText( menuH, i, fontName );
if ( itemText == (CStr255)fontName )
CStr255 currItemName;
::GetMenuItemText( inMenu, i, currItemName );
if ( itemText == currItemName )
{
whichMenu->SetValue( i );
inControl->SetValue( i );
return TRUE;
}
}
return FALSE;
}
Boolean SetLGAPopupToNamedItem( LGAPopup* whichMenu, const CStr255& itemText )
{
MenuHandle menuH;
short menuSize;
Str255 fontName;
menuH = whichMenu->GetMacMenuH();
menuSize = CountMItems( menuH );
for ( short i = 1; i <= menuSize; i++ )
{
::GetMenuItemText( menuH, i, fontName );
if ( itemText == (CStr255)fontName )
{
whichMenu->SetValue( i );
return TRUE;
}
}
return FALSE;
}
unsigned long GetFreeSpaceInBytes( short vRefNum )
{

Просмотреть файл

@ -185,9 +185,8 @@ void * StructCopy(const void * struc, UInt32 size);
// ¥ return the free space available on the volume referenced by vRefNum in bytes
unsigned long GetFreeSpaceInBytes( short vRefNum );
// ¥Êsets the std poup to the named item
Boolean SetPopupToNamedItem( LStdPopupMenu* whichMenu, const CStr255& itemText );
Boolean SetLGAPopupToNamedItem( LGAPopup* whichMenu, const CStr255& itemText );
// ¥Êsets the std popup to the named item
Boolean SetMenuToNamedItem( LControl* inControl, MenuHandle inMenu, const CStr255& itemText ) ;
// ¥
void TurnOn( LControl* control );

Просмотреть файл

@ -1559,10 +1559,10 @@ CAppearanceFontsMediator::UpdateMenus()
Str255 fontName;
LGAPopup *propFontMenu = (LGAPopup *)FindPaneByID(ePropFontMenu);
XP_ASSERT(propFontMenu);
if (!SetLGAPopupToNamedItem(propFontMenu, mEncodings[selectedEncMenuItem - 1].mPropFont))
if (!SetMenuToNamedItem(propFontMenu, propFontMenu->GetMacMenuH(), mEncodings[selectedEncMenuItem - 1].mPropFont))
{
GetFontName(applFont, fontName);
if (!SetLGAPopupToNamedItem(propFontMenu, fontName))
if (!SetMenuToNamedItem(propFontMenu, propFontMenu->GetMacMenuH(), fontName))
{
propFontMenu->SetValue(1);
}
@ -1579,10 +1579,10 @@ CAppearanceFontsMediator::UpdateMenus()
LGAPopup *fixedFontMenu = (LGAPopup *)FindPaneByID(eFixedFontMenu);
XP_ASSERT(fixedFontMenu);
if (!SetLGAPopupToNamedItem(fixedFontMenu, mEncodings[selectedEncMenuItem - 1].mFixedFont))
if (!SetMenuToNamedItem(fixedFontMenu, fixedFontMenu->GetMacMenuH(), mEncodings[selectedEncMenuItem - 1].mFixedFont))
{
GetFontName(applFont, fontName);
if (!SetLGAPopupToNamedItem(fixedFontMenu, fontName))
if (!SetMenuToNamedItem(fixedFontMenu, fixedFontMenu->GetMacMenuH(), fontName))
{
fixedFontMenu->SetValue(1);
}

Двоичные данные
cmd/macfe/projects/client/Navigator.mcp

Двоичный файл не отображается.

Просмотреть файл

@ -27,7 +27,7 @@
// PowerPlant
#include <LTableArrayStorage.h>
#include <LDropFlag.h>
#include <UGAColorRamp.h>
#include <Appearance.h>
#include "CHyperTreeHeader.h"
#include "URDFUtilities.h"
@ -319,17 +319,20 @@ void CHyperTreeFlexTable::DrawCellContents( const STableCell& inCell, const Rect
Rect backRect = inLocalRect;
backRect.bottom--; // leave a one pixel line on the bottom as separator
backRect.right++; // cover up vertical dividing line on right side
Uint8 backColor = inCell.col == header->GetSortedColumn(columnPane) ? colorRamp_Gray3 : colorRamp_Gray1;
::RGBBackColor(&UGAColorRamp::GetColor(backColor));
ThemeBrush backColor = inCell.col == header->GetSortedColumn(columnPane) ?
kThemeListViewSortColumnBackgroundBrush : kThemeListViewBackgroundBrush;
::SetThemeBackground( backColor, 8, false );
::EraseRect(&backRect);
}
::SetThemeTextColor ( kThemeListViewTextColor, 8, false );
// Get cell data
HT_Resource node = HT_GetNthItem(GetHTView(), URDFUtilities::PPRowToHTRow(inCell.row) );
if (node)
{
if ( HT_IsSeparator(node) ) {
const static RGBColor black = { 0, 0, 0 };
Uint16 left = inLocalRect.left;
if ( inCell.col == FindTitleColumnID() ) {
@ -337,7 +340,9 @@ void CHyperTreeFlexTable::DrawCellContents( const STableCell& inCell, const Rect
left += CStandardFlexTable::kDistanceFromIconToText;
}
::RGBForeColor ( &black );
StColorPenState saved;
::SetThemePen( kThemeListViewTextColor, 8, false );
::MoveTo ( left,
inLocalRect.top + ((inLocalRect.bottom - inLocalRect.top) / 2) );
::PenSize ( 2, 2 );

Просмотреть файл

@ -27,7 +27,7 @@
#include "CNavCenterTitle.h"
#include "CNavCenterSelectorPane.h" // for message id's
#include <Appearance.h>
#include <LCaption.h>
CNavCenterTitle :: CNavCenterTitle ( LStream *inStream )

Просмотреть файл

@ -27,6 +27,8 @@
#include "htrdf.h"
#include "CAMSavvyBevelView.h"
class LCaption;
class CNavCenterTitle
: public CAMSavvyBevelView, public LListener
@ -48,8 +50,8 @@ protected:
virtual void FinishCreateSelf ( ) ;
// Provide access to the LCaption that displays the title
LCaption& TitleCaption ( ) { return *mTitle; }
const LCaption& TitleCaption ( ) const { return *mTitle; }
LCaption & TitleCaption ( ) { return *mTitle; }
const LCaption & TitleCaption ( ) const { return *mTitle; }
private:

Просмотреть файл

@ -88,7 +88,7 @@
#include "URobustCreateWindow.h"
#include "BookmarksDialogs.h"
#include "divview.h"
#include "LGAIconSuiteControl.h"
#include "LIconControl.h"
const char* CRDFCoordinator::Pref_EditWorkspace = "browser.editWorkspace";
@ -164,8 +164,7 @@ CRDFCoordinator::FinishCreateSelf()
// If the close box is there, register this class as a listener so we get the
// close message. It won't be there in the standalone window version
LGAIconSuiteControl* closeBox =
dynamic_cast<LGAIconSuiteControl*>(FindPaneByID(CNavCenterTitle::kCloseBoxPaneID));
LIconControl* closeBox = dynamic_cast<LIconControl*>(FindPaneByID(CNavCenterTitle::kCloseBoxPaneID));
if ( closeBox )
closeBox->AddListener(this);

Двоичные данные
cmd/macfe/rsrc/CrossProduct/Mozilla_Custom_CPPbs

Двоичный файл не отображается.

Двоичные данные
cmd/macfe/rsrc/communicator/NavCenter.cnst

Двоичный файл не отображается.

Двоичные данные
cmd/macfe/rsrc/navigator/BrowserRat.cnst

Двоичный файл не отображается.

Двоичные данные
cmd/macfe/rsrc/navigator/ProfileRat.cnst

Двоичный файл не отображается.

Просмотреть файл

@ -16,15 +16,6 @@
* Reserved.
*/
//
// a public service announcement from pinkerton:
//
// Right now this class is in a state of flux because it is drawing partially with
// appearance, but can still draw the old way when appearance is not present. I want
// to rip out all the non-appearance stuff at some point, but we need a way to go back
// to the old way if appearance doesn't work out for us.
//
#ifdef PowerPlant_PCH
#include PowerPlant_PCH
#endif
@ -32,87 +23,71 @@
#include <Appearance.h>
#include "CAMSavvyBevelView.h"
#include "UGraphicGizmos.h"
#include "CSharedPatternWorld.h"
//
// Constructor and Destructor
//
// Since there is no stream data, or any local data at all for that matter, the
// constructor/destructor don't need to do anything
//
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
// ¥
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
CAMSavvyBevelView::CAMSavvyBevelView(LStream *inStream)
: CBevelView(inStream)
{
ResIDT theBevelTraitsID;
*inStream >> theBevelTraitsID;
ResIDT thePatternResID;
*inStream >> thePatternResID;
*inStream >> mPatternOrientation;
if ( ! UEnvironment::HasFeature(env_HasAppearance) ) {
UGraphicGizmos::LoadBevelTraits(theBevelTraitsID, mArithBevelColors);
mPatternWorld = CSharedPatternWorld::CreateSharedPatternWorld(thePatternResID);
ThrowIfNULL_(mPatternWorld);
mPatternWorld->AddUser(this);
}
// nothing
}
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
// ¥
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
CAMSavvyBevelView::~CAMSavvyBevelView()
{
if ( !UEnvironment::HasFeature(env_HasAppearance) )
mPatternWorld->RemoveUser(this);
// nothing
}
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
// ¥
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
void CAMSavvyBevelView::DrawBeveledFill(void)
//
// DrawBevelFill
//
// Use Appearance Manager to draw the entire area, both bevel and interior. We use
// the Window List View Header rather than the Window Header because the list view
// header doesn't draw the dark bevel at the bottom and it looks nicer when you put
// multiple bevel rects next to each other.
//
void
CAMSavvyBevelView :: DrawBeveledFill ( )
{
Rect theFrame;
CalcLocalFrameRect(theFrame);
StClipRgnState theClipSaver(mBevelRegion);
if ( UEnvironment::HasFeature(env_HasAppearance) ) {
--theFrame.top;
--theFrame.left;
::DrawThemeWindowListViewHeader ( &theFrame, kThemeStateActive );
}
else {
Point theAlignment;
CSharedPatternWorld::CalcRelativePoint(this, CSharedPatternWorld::eOrientation_Port, theAlignment);
CGrafPtr thePort = (CGrafPtr)GetMacPort();
mPatternWorld->Fill(thePort, theFrame, theAlignment);
}
}
--theFrame.top; // get rid of thick top/left bevels
--theFrame.left;
::DrawThemeWindowListViewHeader ( &theFrame, kThemeStateActive );
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
// ¥
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
} // DrawBeveledFill
void CAMSavvyBevelView::DrawBeveledFrame(void)
//
// DrawBeveledFrame
//
// Since the Appearance Manager draws both the bevel and the interior, we
// don't need to do anything separately like we would have if we were drawing
// by hand (the old way).
//
void
CAMSavvyBevelView :: DrawBeveledFrame ( )
{
if ( ! UEnvironment::HasFeature(env_HasAppearance) ) {
Rect theFrame;
CalcLocalFrameRect(theFrame);
UGraphicGizmos::BevelTintRect(theFrame, mMainBevel, 0x4000, 0x4000);
}
// do nothing
}
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
// ¥
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
void CAMSavvyBevelView::DrawBeveledSub(const SSubBevel& inDesc)
//
// DrawBeveledSub
//
// Draw sub-bevels using appearance manager.
//
void
CAMSavvyBevelView :: DrawBeveledSub( const SSubBevel& inDesc )
{
Rect subFrame = inDesc.cachedLocalFrame;
Int16 theInsetLevel = inDesc.bevelLevel;
@ -126,12 +101,8 @@ void CAMSavvyBevelView::DrawBeveledSub(const SSubBevel& inDesc)
theInsetLevel = -theInsetLevel;
::InsetRect(&subFrame, -(theInsetLevel), -(theInsetLevel));
if ( UEnvironment::HasFeature(env_HasAppearance) ) {
--subFrame.top;
::DrawThemeWindowListViewHeader ( &subFrame, kThemeStateActive );
}
else
UGraphicGizmos::BevelTintRect(subFrame, inDesc.bevelLevel, 0x4000, 0x4000);
--subFrame.top;
::DrawThemeWindowListViewHeader ( &subFrame, kThemeStateActive );
}
}

Просмотреть файл

@ -21,12 +21,17 @@
#include "CBevelView.h"
#include "UStdBevels.h"
class CSharedPatternWorld;
//
// CAMSavvyBevelView
//
// A view that bevels itself and its sub views by using appearanace manager
// routines to draw as a window header. This is a concrete implementation
// of the abstract CBevelView class.
//
class CAMSavvyBevelView : public CBevelView
{
public:
enum { class_ID = 'BvPv' };
enum { class_ID = 'BvAM' };
CAMSavvyBevelView(LStream *inStream);
virtual ~CAMSavvyBevelView();
@ -37,7 +42,4 @@ class CAMSavvyBevelView : public CBevelView
virtual void DrawBeveledFrame(void);
virtual void DrawBeveledSub(const SSubBevel& inDesc);
SBevelColorDesc mArithBevelColors;
CSharedPatternWorld* mPatternWorld;
Int16 mPatternOrientation;
};
}; // class CAMSavvyBevelView

Просмотреть файл

@ -23,7 +23,8 @@
// See header file for class descriptions.
//
// NOTES:
// - does not yet autoscroll when doing drag and drop
// - does not yet autoscroll when doing drag and drop. Autoscroll seems to be broken with
// new AM implementation for arrows.
// - 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
@ -34,7 +35,7 @@
#include <LStdControl.h>
#include <PP_Types.h>
#include <UGAColorRamp.h>
#include <Appearance.h>
#pragma mark -- class CScrollArrowControl
@ -186,22 +187,18 @@ CScrollerWithArrows :: MakeOneScrollArrow ( const SPaneInfo &inPaneInfo,
ScrollDir inScrollWhichWay )
{
ResIDT iconID = 0;
SControlInfo controlInfo;
controlInfo.value = 0;
controlInfo.minValue = 0;
controlInfo.maxValue = 0;
MessageT value = 0;
if ( inScrollWhichWay == kUpLeft ) {
controlInfo.valueMessage = kControlUpButtonPart;
iconID = IsVertical() ? CScrollArrowControl::kIconUp : CScrollArrowControl::kIconLeft;
value = kControlUpButtonPart;
iconID = IsVertical() ? CScrollArrowControl::kIconUp : CScrollArrowControl::kIconLeft;
}
else {
controlInfo.valueMessage = kControlDownButtonPart;
value = kControlDownButtonPart;
iconID = IsVertical() ? CScrollArrowControl::kIconDown : CScrollArrowControl::kIconRight;
}
return new CScrollArrowControl ( inPaneInfo, controlInfo, iconID );
return new CScrollArrowControl ( inPaneInfo, value, iconID );
} // MakeOneScrollArrow
@ -466,20 +463,14 @@ CScrollerWithArrows::ListenToMessage( MessageT inMessage, void *ioParam)
#pragma mark -- class CScrollArrowControl
CScrollArrowControl :: CScrollArrowControl ( const SPaneInfo &inPaneInfo,
const SControlInfo &inControlInfo,
ResIDT inIconResID )
: LGAIconButton ( inPaneInfo, inControlInfo, controlMode_Button, inIconResID,
sizeSelector_SmallIconSize, iconPosition_Center )
{
// nothing else needed
}
CScrollArrowControl :: CScrollArrowControl ( LStream* inStream )
:LGAIconButton(inStream)
CScrollArrowControl :: CScrollArrowControl (
const SPaneInfo &inPaneInfo,
MessageT inValueMessage,
Int16 inContentResID )
: LIconControl ( inPaneInfo, inValueMessage, kControlIconSuiteNoTrackProc, inContentResID )
{
// nothing else needed
SetIconAlignment( kAlignAbsoluteCenter );
}
@ -492,31 +483,8 @@ CScrollArrowControl :: CScrollArrowControl ( LStream* inStream )
void
CScrollArrowControl :: HotSpotAction ( Int16 inHotSpot, Boolean inCurrInside, Boolean inPrevInside )
{
LGAIconButton::HotSpotAction ( inHotSpot, inCurrInside, inPrevInside );
LIconControl::HotSpotAction ( inHotSpot, inCurrInside, inPrevInside );
if ( inCurrInside )
BroadcastValueMessage();
} // 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
} // HotSpotAction

Просмотреть файл

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