UTF8 enable HyperTree title and inline edit

This commit is contained in:
ftang%netscape.com 1998-10-21 14:32:48 +00:00
Родитель d37c63ac39
Коммит 219b89228c
10 изменённых файлов: 20 добавлений и 2815 удалений

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

@ -1,363 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
// BrowserClasses.cp
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
#include "BrowserClasses.h"
// ¥¥¥ PowerPlant Classes
#include <URegistrar.h>
#include <LButton.h>
#include <LCaption.h>
#include <LDialogBox.h>
#include <LEditField.h>
#include <LGroupBox.h>
#include <LIconPane.h>
#include <LListBox.h>
#include <LPicture.h>
#include <LPlaceHolder.h>
#include <LPrintout.h>
#include <LStdControl.h>
#include <LTable.h>
#include <LTextEditView.h>
#include <LWindow.h>
#include <LRadioGroup.h>
#include <LTabGroup.h>
#include <LTextColumn.h>
#include "CTextColumn.h" // Netscape's own LTextColumn
#include <LSubOverlapView.h>
// ¥¥¥ PowerPlant Grayscale Classes
#include <UGALibRegistry.h>
// ¥¥¥ AM wrappers classes and their AM implementations
#include <LProgressBar.h>
#include <LPushButton.h>
#include <LAMPushButtonImp.h>
#include <LAMControlImp.h>
#include <LAMTrackActionImp.h>
#include <LGAProgressBarImp.h>
#include <LScrollBar.h>
#include <LScrollerView.h>
#include <LStdScrollBarImp.h>
#if 0
// ¥¥¥ Things that will go away after appearance conversion complete
#include "CProgressBar.h"
#include "CPatternProgressBar.h"
#include "CConfigActiveScroller.h"
#include <LScroller.h> // outdated, replaced by LScrollerView
#include <LActiveScroller.h> // outdated, replaced by LScrollerView
#endif
// ¥¥¥ General Purpose UI Classes
#include "CBevelButton.h"
#include "CPatternButton.h"
#include "CGrayBevelView.h"
#include "CPatternBevelView.h"
#include "CPatternButtonPopup.h"
#include "CNavigationButtonPopup.h"
#include "CCloseAllAttachment.h"
#include "CColorEraseAttachment.h"
#include "CGABorderPane.h"
#include "CPatternPane.h"
#include "CIncludeView.h"
#include "CPlaceHolderView.h"
#include "COffscreenCaption.h"
#include "CClusterView.h"
#include "CTabSwitcher.h"
#include "CPatternTabControl.h"
#include "CProgressCaption.h"
#include "CTaskBarView.h"
#include "LTableHeader.h"
#include "LTableViewHeader.h"
#include "CSimpleDividedView.h"
#include "CKeyScrollAttachment.h"
#include "CToolTipAttachment.h"
#include "CTableTooltipPane.h"
#include "CDynamicTooltips.h"
#include "CPaneEnabler.h"
#include "CStringListToolTipPane.h"
#include "CSaveProgress.h"
#include "CTargetFramer.h"
#ifdef MOZ_MAIL_NEWS
#include "CBiffButtonAttachment.h"
#include "CSingleLineEditField.h"
#endif
// ¥¥¥ Browser Specific UI Classes
#include "CDragBar.h"
#include "CDragBarContainer.h"
#include "CRDFToolbarContainer.h"
#include "CRDFToolbar.h"
#include "CDragBarDockControl.h"
#include "CPatternedGrippyPane.h"
#include "CDividerGrippyPane.h"
#include "CSwatchBrokerView.h"
#include "CToolbarDragBar.h"
#include "CToolbarPatternBevelView.h"
#include "CProxyPane.h"
#include "CProxyCaption.h"
#include "PopupBox.h"
#include "CNavCenterWindow.h"
#include "CNavCenterContextMenuAtt.h"
#include "CNavCenterTitle.h"
#include "CNavCenterScroller.h"
#include "CInlineEditField.h"
#include "CTSMEditField.h"
// #include "CSimpleTextView.h"
#include "CDownloadProgressWindow.h"
#include "CURLEditField.h"
#include "CAutoCompleteURLEditField.h"
#include "CURLCaption.h"
#include "CHyperScroller.h"
#include "CButtonEnablerReloadStop.h"
#include "CBrowserWindow.h"
#include "CHTMLView.h"
#include "CBrowserView.h"
#include "CSpinningN.h"
#include "CBrowserSecurityButton.h"
#include "CMiniSecurityButton.h"
#include "mprint.h"
#include "macgui.h"
#include "findw.h"
// #include "prefw.h"
#include "BookmarksDialogs.h"
#include "mplugin.h"
#include "divview.h"
// #include "mattach.h"
#include "UFormElementFactory.h"
#include "CMenuTable.h"
#include "CPrefsMediator.h"
#include "CAssortedMediators.h"
#if defined (JAVA)
#include "mjava.h"
#endif
#include "CEditorWindow.h"
#include "CContextMenuAttachment.h"
#include "CHyperTreeFlexTable.h"
#include "CRDFCoordinator.h"
#include "CHyperTreeHeader.h"
//-----------------------------------
void RegisterAllBrowserClasses(void)
//-----------------------------------
{
// AutoRegister classes
RegisterClass_(CProxyPane);
RegisterClass_(CProxyCaption);
RegisterClass_(CCloseAllAttachment);
RegisterClass_(CColorEraseAttachment);
RegisterClass_(CGABorderPane);
RegisterClass_(CPatternPane);
RegisterClass_(LSubOverlapView);
// ¥¥¥ PowerPlant Classes
RegisterClass_(LButton);
RegisterClass_(LCaption);
RegisterClass_(LDialogBox);
RegisterClass_(LEditField);
RegisterClass_(LListBox);
RegisterClass_(LPane);
RegisterClass_(LPicture);
RegisterClass_(LPlaceHolder);
RegisterClass_(LPrintout);
RegisterClass_(LStdControl);
RegisterClass_(LStdButton);
RegisterClass_(LStdCheckBox);
RegisterClass_(LStdRadioButton);
RegisterClass_(LStdPopupMenu);
RegisterClass_(LTextEditView);
RegisterClass_(LView);
RegisterClass_(LWindow);
RegisterClass_(LRadioGroup);
RegisterClass_(LTabGroup);
#ifdef PP_NewClasses
#include <LCicnButton.h>
#include <LOffscreenView.h>
#include <LTextButton.h>
RegisterClass_(LCicnButton);
RegisterClass_(LOffscreenView);
RegisterClass_(LTextButton);
#endif
RegisterClass_(LTable);
RegisterClass_(LIconPane);
RegisterClass_(LGroupBox);
RegisterClass_(LTextColumn);
RegisterClass_(CTextColumn); // Netscape's own LTextColumn
RegisterClass_(CGAPopupMenu);
// ¥¥¥ PowerPlant Grayscale Classes
RegisterGALibraryClasses();
// ¥¥¥ PowerPlant appearance manager classes and their implementations
RegisterClass_(LProgressBar);
RegisterClassID_(LAMControlImp, LProgressBar::imp_class_ID);
RegisterClass_(LScrollBar);
RegisterClassID_(LAMTrackActionImp, LScrollBar::imp_class_ID);
RegisterClass_(LPushButton);
RegisterClassID_(LAMPushButtonImp, LPushButton::imp_class_ID);
RegisterClass_(LScrollerView);
#if 0
// ¥¥¥ Things that will go away after appearance port complete
RegisterClass_(CProgressBar);
RegisterClass_(CPatternProgressBar);
RegisterClass_(CPatternProgressCaption);
RegisterClass_(CConfigActiveScroller);
RegisterClass_(LScroller);
RegisterClass_(LActiveScroller);
#endif
// ¥¥¥ General Purpose UI Classes
RegisterClass_(CBevelButton);
RegisterClass_(CDeluxeBevelButton);
RegisterClass_(CPatternButton);
RegisterClass_(CPatternButtonPopup);
RegisterClass_(CGrayBevelView);
RegisterClass_(CPatternBevelView);
RegisterClass_(CIncludeView);
RegisterClass_(CPlaceHolderView);
RegisterClass_(COffscreenCaption);
RegisterClass_(CClusterView);
RegisterClass_(CPatternTabControl);
RegisterClass_(CTabSwitcher);
RegisterClass_(CKeyScrollAttachment);
RegisterClass_(CToolTipAttachment);
RegisterClass_(CDynamicTooltipPane);
RegisterClass_(CTableToolTipPane);
RegisterClass_(CTableToolTipAttachment);
RegisterClass_(CSharedToolTipAttachment);
RegisterClass_(CMenuTable);
RegisterClass_(CPaneEnabler);
RegisterClass_(CSlaveEnabler);
RegisterClass_(CTargetFramer);
#ifdef MOZ_MAIL_NEWS
RegisterClass_(CSingleLineEditField);
RegisterClass_(CSelectFolderMenu);
//#else
// RegisterClass_(CBiffButtonAttachment);
#endif // MOZ_MAIL_NEWS
RegisterClass_(CSimpleDividedView);
RegisterClass_(CProgressCaption);
RegisterClass_(CTaskBarView);
RegisterClass_(CToolTipPane);
RegisterClass_(CStringListToolTipPane);
RegisterClass_(LTableHeader);
RegisterClass_(LTableViewHeader);
RegisterClass_(CTextEdit);
RegisterClass_(CEditBroadcaster);
RegisterClass_(CNavigationButtonPopup);
// *** Browser Specific UI Classes
RegisterClass_(CDragBar);
RegisterClass_(CDragBarContainer);
RegisterClass_(CDragBarDockControl);
RegisterClass_(CRDFToolbarContainer);
RegisterClass_(CBrokeredView);
RegisterClass_(CSwatchBrokerView);
RegisterClass_(CToolbarDragBar);
RegisterClass_(CToolbarPatternBevelView);
RegisterClass_(CTSMEditField);
RegisterClass_(CDownloadProgressWindow);
RegisterClass_(CBrowserWindow);
RegisterClass_(CHTMLView);
RegisterClass_(CURLEditField);
RegisterClass_(CAutoCompleteURLEditField);
RegisterClass_(CURLCaption);
RegisterClass_(CSaveProgress);
RegisterClass_(CHyperScroller);
RegisterClass_(CButtonEnablerReloadStop);
RegisterClass_(CBrowserView);
RegisterClass_(CAdSpaceView);
RegisterClass_(CPatternedGrippyPane);
RegisterClass_(CDividerGrippyPane);
RegisterClass_(CSpinningN);
RegisterClass_(CBrowserSecurityButton);
RegisterClass_(CMiniSecurityButton);
RegisterClass_(CHyperTreeFlexTable);
RegisterClass_(CPopdownFlexTable);
RegisterClass_(CDockedRDFCoordinator);
RegisterClass_(CShackRDFCoordinator);
RegisterClass_(CWindowRDFCoordinator);
RegisterClass_(CPopdownRDFCoordinator);
RegisterClass_(CHyperTreeHeader);
RegisterClass_(CNavCenterScroller);
RegisterClass_(CInlineEditField);
RegisterClass_(CChameleonCaption);
RegisterClass_(CChameleonBroadcastCaption);
RegisterClass_(CNavCenterWindow);
RegisterClass_(CBookmarksFindDialog);
RegisterClass_(CPluginView);
RegisterClass_(LDividedView);
RegisterClass_(CTreeViewContextMenuAttachment);
RegisterClass_(CNavCenterTitle);
RegisterClass_(CNavCenterCommandStrip);
#ifdef EDITOR
CEditorWindow::RegisterViewTypes();
#endif // EDITOR
CFindWindow::RegisterViewTypes();
UFormElementFactory::RegisterFormTypes();
UHTMLPrinting::RegisterHTMLPrintClasses();
CPrefsMediator::RegisterViewClasses();
CPrefsDialog::RegisterViewClasses();
UAssortedPrefMediators::RegisterViewClasses();
RegisterClass_(CContextMenuAttachment);
#ifdef JAVA
RegisterClass_(CJavaView);
#endif
} // RegisterAllBrowserClasses

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,267 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
//
// Mike Pinkerton, Netscape Communications
//
// Contains:
//
// ¥ÊCHyperTreeFlexTable
// A subclass of CStandardFlexTable to handle working with XP RDF Hyper Trees
//
// ¥ CHyperTreeSelector
// Modifies the selection model used by PP to also consult HT to see if a row is
// selected
//
#pragma once
#include "CStandardFlexTable.h"
#include "LTableRowSelector.h"
#include "CDynamicTooltips.h"
#include "CURLDragHelper.h"
#include "CImageIconMixin.h"
// STL Headers
#include <vector.h>
#pragma mark -- class CHyperTreeFlexTable --
class CHyperTreeFlexTable :
public CStandardFlexTable, public CHTAwareURLDragMixin, public CTiledImageMixin
{
public:
enum {
class_ID = 'htFT',
nameColumn = 'NCnC'
};
friend class CTreeIcon;
CHyperTreeFlexTable(LStream *inStream);
~CHyperTreeFlexTable();
virtual void ChangeSort ( const LTableHeader::SortChange* inSortChange ) ;
virtual void OpenView(HT_View inHTView);
virtual void ExpandNode(HT_Resource inHTNode);
virtual void CollapseNode(HT_Resource inHTNode);
virtual void SyncSelectionWithHT ( ) ;
HT_View GetHTView() const { return mHTView; }
bool IsViewSameAsBeforeDrag() const { return mViewBeforeDrag == mHTView; }
// get/set the frame to which urls are dispatched. It's ok not to set
// this as the default will be the top-most HTML view.
virtual void SetTargetFrame ( const char* inFrame ) ;
virtual const char* GetTargetFrame ( ) const ;
virtual void RedrawRow ( HT_Resource ) const ;
virtual void SetupColumns ( ) ;
protected:
// Background image tiling stuff
virtual void DrawStandby ( const Point & inTopLeft, IconTransformType inTransform ) const;
virtual void DrawSelf ( ) ;
virtual void ImageIsReady ( ) ;
virtual void EraseTableBackground ( ) const;
// CStandardFlexTable Overrides
virtual void OpenRow ( TableIndexT inRow ) ;
virtual Boolean CellInitiatesDrag(const STableCell&) const;
virtual Boolean CellSelects ( const STableCell& inCell ) const;
virtual Boolean RowCanAcceptDrop ( DragReference inDragRef, TableIndexT inDropRow ) ;
virtual Boolean RowCanAcceptDropBetweenAbove( DragReference inDragRef, TableIndexT inDropRow ) ;
virtual void HiliteDropRow ( TableIndexT inRow, Boolean inDrawBarAbove ) ;
virtual Boolean RowIsContainer ( const TableIndexT & inRow ) const ;
virtual Boolean RowIsContainer ( const TableIndexT & inRow, Boolean* outIsExpanded ) const ;
virtual void DrawCellContents( const STableCell &inCell, const Rect &inLocalRect);
virtual void EraseCellBackground( const STableCell& inCell, const Rect& inLocalRect);
virtual ResIDT GetIconID(TableIndexT inRow) const;
virtual void DrawIconsSelf( const STableCell& inCell, IconTransformType inTransformType,
const Rect& inIconRect) const ;
virtual UInt16 GetNestedLevel(TableIndexT inRow) const;
virtual void SetCellExpansion( const STableCell& inCell, Boolean inExpand);
virtual Boolean CellHasDropFlag(const STableCell& inCell, Boolean& outIsExpanded) const;
virtual Boolean TableSupportsNaturalOrderSort ( ) const ;
#ifdef USE_SELECTION_PROP
virtual Boolean CellWantsClick( const STableCell & /*inCell*/ ) const ;
virtual void ClickCell ( const STableCell & inCell, const SMouseDownEvent & inMouse ) ;
#endif
// Stuff related to hiliting
virtual TableIndexT GetHiliteColumn() const { return FindTitleColumnID(); } ;
virtual Boolean GetHiliteTextRect ( TableIndexT inRow, Boolean inOkIfRowHidden, Rect& outRect) const ;
virtual void GetMainRowText( TableIndexT inRow, char* outText, UInt16 inMaxBufferLength) const ;
virtual void DoHiliteRgn ( RgnHandle inHiliteRgn ) const;
virtual void DoHiliteRect ( const Rect & inHiliteRect ) const;
virtual void HiliteSelection( Boolean inActively, Boolean inHilite) ;
virtual void SetUpTableHelpers() ;
virtual Uint32 FindTitleColumnID ( ) const ;
// Handle drag and drop
virtual OSErr DragSelection(const STableCell& inCell, const SMouseDownEvent &inMouseDown);
virtual void DoDragSendData ( FlavorType inFlavor, ItemReference inItemRef, DragReference inDragRef) ;
virtual Boolean ItemIsAcceptable ( DragReference inDragRef, ItemReference inItemRef ) ;
virtual void HandleDropOfHTResource ( HT_Resource node ) ;
virtual void HandleDropOfPageProxy ( const char* inURL, const char* inTitle ) ;
virtual void HandleDropOfLocalFile ( const char* inFileURL, const char* fileName,
const HFSFlavor & /*inFileData*/ ) ;
virtual void HandleDropOfText ( const char* inTextData ) ;
virtual void DeleteSelectionByDragToTrash ( LArray & inItems ) ;
virtual void ReceiveDragItem ( DragReference inDragRef, DragAttributes /*inDragAttrs*/,
ItemReference inItemRef, Rect & /*inItemBounds*/ ) ;
// for dynamic tooltip tracking and mouse cursor tracking
virtual void AdjustCursorSelf ( Point /*inPoint*/, const EventRecord& inEvent ) ;
virtual void CalcToolTipText( const STableCell& inCell,
StringPtr outText,
TextDrawingStuff& outStuff,
Boolean& outTruncationOnly);
// Tree behavior properties
virtual Boolean CanDoInlineEditing ( ) const;
virtual Boolean TableDesiresSelectionTracking( ) const;
// for inline editing
virtual void InlineEditorDone ( ) ;
// command stuff
virtual void DeleteSelection ( const EventRecord& inEvent );
virtual void FindCommandStatus ( CommandT inCommand, Boolean &outEnabled,
Boolean &outUsesMark, Char16 &outMark, Str255 outName) ;
HT_Resource TopNode ( ) const { return HT_TopNode(GetHTView()); }
//-----------------------------------
// Data
//-----------------------------------
HT_View mHTView;
HT_Notification mHTNotificationData;
DragSendDataUPP mSendDataUPP;
HT_View mViewBeforeDrag;
HT_Resource mDropNode; // the HT node that corresponds to mDropRow
STableCell mTooltipCell; // tracks where mouse is for tooltips
bool mHasBackgroundImage; // is there a background image to be drawn?
string mTargetFrame; // which frame are urls dispatched to?
}; // class CHyperTreeFlexTable
#pragma mark -- class CHyperTreeSelector --
//
// class CHyperTreeSelector
//
// A replacement for the standard selector class used by LTableView to sync the
// selection with the backend HT_API
//
class CHyperTreeSelector : public LTableRowSelector
{
public:
CHyperTreeSelector ( LTableView *inTableView, Boolean inAllowMultiple=true )
: LTableRowSelector ( inTableView, inAllowMultiple ), mTreeView(NULL) { } ;
// overridden to ask HT if row is selected
virtual Boolean CellIsSelected ( const STableCell &inCell ) const;
// keep us in sync with HT when a new view is opened
virtual void SyncSelectorWithHT ( ) ;
void TreeView ( HT_View inNewView ) { mTreeView = inNewView; } ;
protected:
virtual void DoSelect ( const TableIndexT inRow, Boolean inSelect, Boolean inHilite,
Boolean inNotify ) ;
HT_View mTreeView;
}; // class CHyperTreeSelector
#pragma mark -- class CPopdownFlexTable --
//
// class CPopdownFlexTable
//
// The flex table used by the popdown view. It needs to broadcast some messages to the
// coordinator (such as when to close up) and do funny things to handle closing when
// items are opened.
//
class CPopdownFlexTable : public CHyperTreeFlexTable
{
public:
enum { class_ID = 'pdFT' };
enum { msg_ClosePopdownTree = 'clos' };
CPopdownFlexTable(LStream *inStream);
~CPopdownFlexTable();
static HT_Pane HTPaneOriginatingDragAndDrop ( ) { return sPaneOriginatingDragAndDrop; }
private:
void OpenSelection();
void OpenRow ( TableIndexT inRow ) ;
OSErr DragSelection(const STableCell& inCell, const SMouseDownEvent &inMouseDown);
// this is a holder for the pane that originates the drag and drop so that when
// a drop is done on a different popdown tree, the HT_Resources still have a valid pane.
// This will be deleted once the d&d finishes.
static HT_Pane sPaneOriginatingDragAndDrop;
}; // class CPopdownFlexTable
#pragma mark -- class CTreeIcon --
//
// class CTreeIcon
//
// A very simple class that knows how to draw gifs as icons.
//
class CTreeIcon : public CImageIconMixin
{
public:
CTreeIcon ( const string & inURL, const CHyperTreeFlexTable* inTree, HT_Resource inNode ) ;
~CTreeIcon ( ) ;
private:
void ImageIsReady ( ) ;
void DrawStandby ( const Point & inTopLeft, IconTransformType inTransform ) const;
const CHyperTreeFlexTable* mTree;
HT_Resource mNode;
}; // class CTreeIcon

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

@ -1,314 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
//
// Mike Pinkerton, Netscape Communications
//
// Class that draws the header area for the nav center which shows the title
// of the currently selected view as well as harboring the closebox for
// an easy way to close up the navCenter shelf.
//
#include "CNavCenterTitle.h"
#include "URDFUtilities.h"
#include "CContextMenuAttachment.h"
#include "CRDFCoordinator.h"
CNavCenterStrip :: CNavCenterStrip ( LStream *inStream )
: CGrayBevelView (inStream),
mView(NULL)
{
}
CNavCenterStrip :: ~CNavCenterStrip()
{
// nothing to do
}
//
// FindCommandStatus
//
// Respond to commands from the context menu for Aurora popup-location.
//
void
CNavCenterStrip :: FindCommandStatus ( CommandT inCommand, Boolean &outEnabled,
Boolean &outUsesMark, Char16 &outMark, Str255 outName)
{
outEnabled = true;
outUsesMark = false; //¥¥¥ expand later to mark the current state
} // FindCommandStatus
//
// ClickSelf
//
// Handle context-clicks by passing them off to the attachement (if present)
//
void
CNavCenterStrip :: ClickSelf ( const SMouseDownEvent & inMouseDown )
{
CContextMenuAttachment::SExecuteParams params;
params.inMouseDown = &inMouseDown;
ExecuteAttachments ( CContextMenuAttachment::msg_ContextMenu, (void*)&params );
} // ClickSelf
//
// ListenToMessage
//
// We want to know when the selected workspace changes so that we can update the
// title string, etc. The RDFCoordinator sets us up as a listener which will broadcast,
// when things change.
//
void
CNavCenterStrip :: ListenToMessage ( MessageT inMessage, void* ioParam )
{
switch ( inMessage ) {
case CRDFCoordinator::msg_ActiveSelectorChanged:
{
mView = reinterpret_cast<HT_View>(ioParam);
if ( mView )
SetView(mView);
// if we're in the middle of a drag and drop, draw NOW, not
// when we get a refresh event.
if ( ::StillDown() ) {
FocusDraw();
Draw(nil);
}
}
default:
CTiledImageMixin::ListenToMessage ( inMessage, ioParam );
} // case of which message
} // ListenToMessage
//
// AdjustCursorSelf
//
// Handle changing cursor to contextual menu cursor if cmd key is down
//
void
CNavCenterStrip :: AdjustCursorSelf( Point /*inPoint*/, const EventRecord& inEvent )
{
ExecuteAttachments(CContextMenuAttachment::msg_ContextMenuCursor,
static_cast<void*>(const_cast<EventRecord*>(&inEvent)));
} // AdjustCursorSelf
//
// DrawBeveledFill
//
// If the HT_View currently has a bg image specified, draw it (or at least kick off the load)
// otherwise try to erase with the specified bg color.
//
void
CNavCenterStrip :: DrawBeveledFill ( )
{
StColorState saved;
if ( mView ) {
HT_Resource topNode = HT_TopNode(GetView());
if ( topNode ) {
char* url = NULL;
PRBool success = HT_GetTemplateData ( topNode, BackgroundURLProperty(), HT_COLUMN_STRING, &url );
if ( success && url ) {
// draw the background image tiled to fill the whole pane
Point topLeft = { 0, 0 };
SetImageURL ( url );
DrawImage ( topLeft, kTransformNone, mFrameSize.width, mFrameSize.height );
FocusDraw();
}
else
EraseBackground(topNode);
}
else
EraseBackground(NULL);
}
else
EraseBackground(NULL);
} // DrawBeveledFill
//
// ImageIsReady
//
// Called when the bg image is done loading and is ready to draw. Force a redraw and
// we'll pick it up
//
void
CNavCenterStrip :: ImageIsReady ( )
{
Refresh();
} // ImageIsReady
//
// DrawStandby
//
// Draw correctly when the image has yet to load.
//
void
CNavCenterStrip :: DrawStandby ( const Point & /*inTopLeft*/,
IconTransformType /*inTransform*/ ) const
{
// we're just waiting for the image to come in, who cares if we don't use
// HT's color?
EraseBackground(NULL);
} // DrawStandby
//
// EraseBackground
//
// Fill in the bg with either the correct HT color (from a property on |inTopNode|, the
// correct AM color, or the default GA implementation (if we are before AM 1.1).
//
void
CNavCenterStrip :: EraseBackground ( HT_Resource inTopNode ) const
{
// when we can get the right AM bg color (in AM 1.1), use that but for now just ignore it
if ( !inTopNode || ! URDFUtilities::SetupBackgroundColor(inTopNode, BackgroundColorProperty(),
kThemeListViewSortColumnBackgroundBrush) ) {
CNavCenterStrip* self = const_cast<CNavCenterStrip*>(this); // hack
self->CGrayBevelView::DrawBeveledFill();
}
else {
// use HT's color
Rect bounds;
CalcLocalFrameRect(bounds);
::EraseRect(&bounds);
}
} // EraseBackground
#pragma mark -
CNavCenterTitle :: CNavCenterTitle ( LStream *inStream )
: CNavCenterStrip (inStream),
mTitle(NULL)
{
}
CNavCenterTitle :: ~CNavCenterTitle()
{
// nothing to do
}
//
// FinishCreateSelf
//
// Last minute setup stuff....
//
void
CNavCenterTitle :: FinishCreateSelf ( )
{
mTitle = dynamic_cast<CChameleonCaption*>(FindPaneByID(kTitlePaneID));
Assert_(mTitle != NULL);
} // FinishCreateSelf
//
// SetView
//
// Set the caption to the title of the current view
//
void
CNavCenterTitle :: SetView ( HT_View inView )
{
// do not delete |buffer|
const char* buffer = HT_GetViewName ( GetView() );
TitleCaption().SetDescriptor(LStr255(buffer));
RGBColor textColor;
if ( URDFUtilities::GetColor(HT_TopNode(GetView()), ForegroundColorProperty(), &textColor) )
TitleCaption().SetColor ( textColor );
} // SetView
#pragma mark -
CNavCenterCommandStrip :: CNavCenterCommandStrip ( LStream *inStream )
: CNavCenterStrip (inStream),
mAddPage(NULL), mManage(NULL), mClose(NULL)
{
}
CNavCenterCommandStrip :: ~CNavCenterCommandStrip()
{
// nothing to do
}
//
// FinishCreateSelf
//
// Last minute setup stuff....
//
void
CNavCenterCommandStrip :: FinishCreateSelf ( )
{
// none of these are always present
mClose = dynamic_cast<CChameleonCaption*>(FindPaneByID(kClosePaneID));
mAddPage = dynamic_cast<CChameleonCaption*>(FindPaneByID(kAddPagePaneID));
mManage = dynamic_cast<CChameleonCaption*>(FindPaneByID(kManagePaneID));
} // FinishCreateSelf
//
// SetView
//
// Update the text colors to those of the current view
//
void
CNavCenterCommandStrip :: SetView ( HT_View inView )
{
RGBColor textColor;
if ( URDFUtilities::GetColor(HT_TopNode(GetView()), ForegroundColorProperty(), &textColor) ) {
if ( mClose ) mClose->SetColor ( textColor );
if ( mAddPage ) mAddPage->SetColor ( textColor );
if ( mManage ) mManage->SetColor ( textColor );
}
} // SetView

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

@ -1,126 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
//
// Mike Pinkerton, Netscape Communications
//
// Class that draws the header area for the nav center which shows the title
// of the currently selected view as well as harboring the closebox for
// an easy way to close up the navCenter shelf.
//
#include "htrdf.h"
#include "CGrayBevelView.h"
#include "CImageIconMixin.h"
#include "CColorCaption.h"
extern RDF_NCVocab gNavCenter; // RDF vocab struct for NavCenter
class CNavCenterStrip
: public CGrayBevelView, public CTiledImageMixin, public LCommander
{
// Construction, Destruction
CNavCenterStrip(LStream *inStream);
~CNavCenterStrip();
protected:
// override to use various RDF properties
virtual void* BackgroundURLProperty ( ) const = 0;
virtual void* BackgroundColorProperty ( ) const = 0;
virtual void* ForegroundColorProperty ( ) const = 0;
// override to change properties based on a new view
virtual void SetView ( HT_View inView ) = 0;
virtual HT_View GetView ( ) const { return mView; }
// PowerPlant overrides
virtual void ListenToMessage ( MessageT inMessage, void* ioParam ) ;
virtual void AdjustCursorSelf( Point inPoint, const EventRecord& inEvent ) ;
virtual void FindCommandStatus ( CommandT inCommand, Boolean &outEnabled,
Boolean &outUsesMark, Char16 &outMark, Str255 outName) ;
virtual void ClickSelf ( const SMouseDownEvent & inMouseDown ) ;
virtual void DrawBeveledFill ( ) ;
virtual void DrawStandby ( const Point & inTopLeft, IconTransformType inTransform ) const;
virtual void EraseBackground ( HT_Resource inTopNode ) const ;
virtual void ImageIsReady ( ) ;
private:
HT_View mView; // ref back to current view for custom drawing
}; // class CNavCenterTitle
class CNavCenterTitle : public CNavCenterStrip
{
public:
enum { class_ID = 'hbar', kTitlePaneID = 'titl' };
CNavCenterTitle(LStream *inStream);
~CNavCenterTitle();
// Provide access to the LCaption that displays the title
CChameleonCaption& TitleCaption ( ) { return *mTitle; }
const CChameleonCaption& TitleCaption ( ) const { return *mTitle; }
protected:
virtual void SetView ( HT_View inView ) ;
virtual void FinishCreateSelf ( ) ;
virtual void* BackgroundURLProperty ( ) const { return gNavCenter->titleBarBGURL; }
virtual void* BackgroundColorProperty ( ) const { return gNavCenter->titleBarBGColor; }
virtual void* ForegroundColorProperty ( ) const { return gNavCenter->titleBarFGColor; }
private:
CChameleonCaption* mTitle;
}; // class CNavCenterTitle
class CNavCenterCommandStrip : public CNavCenterStrip
{
public:
enum { class_ID = 'tcmd', kAddPagePaneID = 'addp', kManagePaneID = 'edit', kClosePaneID = 'clos' } ;
enum { msg_CloseShelfNow = 'clos', msg_AddPage = 'addp', msg_Manage = 'edit' } ;
// Construction, Destruction
CNavCenterCommandStrip(LStream *inStream);
~CNavCenterCommandStrip();
private:
virtual void SetView ( HT_View inView ) ;
virtual void FinishCreateSelf ( ) ;
virtual void* BackgroundURLProperty ( ) const { return gNavCenter->controlStripBGURL; }
virtual void* BackgroundColorProperty ( ) const { return gNavCenter->controlStripBGColor; }
virtual void* ForegroundColorProperty ( ) const { return gNavCenter->controlStripFGColor; }
CChameleonCaption* mAddPage;
CChameleonCaption* mManage;
CChameleonCaption* mClose;
}; // class CNavCenterCommandStrip

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

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

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

@ -86,10 +86,16 @@ CChameleonCaption :: DrawSelf()
::RGBForeColor ( &textColor );
// ¥ Now we can finally get the text drawn
UTextDrawing::DrawWithJustification ( (Ptr)&mText[1], mText[0], localFrame, just );
this->DrawText(localFrame, just);
}
} // DrawSelf
void
CChameleonCaption :: DrawText(Rect frame, Int16 inJust)
{
UTextDrawing::DrawWithJustification ( (Ptr)&mText[1], mText[0], frame, inJust );
}
#pragma mark -

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

@ -42,6 +42,7 @@ public:
protected:
virtual void DrawSelf();
virtual void DrawText(Rect frame, Int16 inJust);
RGBColor mTextColor;
RGBColor mBackColor;

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

@ -1161,13 +1161,17 @@ void CStandardFlexTable::DoInlineEditing(const STableCell &inCell, Rect& inTextR
GetHiliteText(mRowBeingEdited, nameString, sizeof(nameString), false, &inTextRect);
InsetRect(&inTextRect, -2, -2);
inTextRect.bottom += 2;
mNameEditor->ResizeFrameTo(inTextRect.right - inTextRect.left,
inTextRect.bottom - inTextRect.top, true);
mNameEditor->UpdateEdit(CStr255(nameString), &imagePoint, nil);
SetEditParam(inTextRect.right - inTextRect.left, inTextRect.bottom - inTextRect.top, nameString, imagePoint);
SelectionChanged();
} // DoInlineEditing
//----------------------------------------------------------------------------------------
void CStandardFlexTable::SetEditParam(int w, int h, char* str, SPoint32& ImagePoint)
{
mNameEditor->ResizeFrameTo(w, h, true);
mNameEditor->UpdateEdit(CStr255(str), &ImagePoint, nil);
} // SetEditParam
//----------------------------------------------------------------------------------------
Boolean CStandardFlexTable::CellSelects(const STableCell& /*inCell*/) const
// Determines if a cell is allowed to select the row.

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

@ -260,6 +260,10 @@ protected:
virtual void InlineEditorTextChanged( ) { }
virtual void InlineEditorDone( ) { }
virtual void DoInlineEditing( const STableCell &inCell, Rect & inTextRect );
virtual void SetEditParam(int w, int h, char* str, SPoint32& ImagePoint);
virtual Boolean CanDoInlineEditing( ) const { return true; }
virtual void DrawCell(