SRGWizSheet Class

class SRGWizSheet

This class allows user to interactively configure their chart at runtime. When started, the class will make a copy of the user's graph. Inside this wizard, all the modification is effective only on the copy of the graph. After exit from the wizard, user's can call SaveGraph function to copy the modified graph inside the wizard back to the user's graph. If the graph user passed in does not contain any component, the wizard will start from three easy steps to help user choose a graph type with a basic layout to work with. If the graph does contain some components, then the wizard will start right to the page to let user configurate their graphs

Defined in: WizSheet.h

Class Members

BOOL  m_bGraphEmpty

Flag if the passed in graph has any component in it

CSize  m_viewSize

The size of the drawing area of the chart given form the constructor

SRGWizView*  m_pGraphView

Actual view port rectangle in the wizard

SRGWizView*  m_pGraphView

The drawing area of the wizard

CMainPage  m_NewMain

The main setup page of the wizard

CAdvancedPage  m_Advanced

The advanced setup page of the wizard.

int  m_nCurSelComponent

The integer identifier of the currently selected component

BOOL  m_bAllowTracking

Set to TRUE if tracking is allowed.

SRGToolTipCtrl  m_ToolTip

A tool tip control to help to show some tip for some of the controls

CObArray  m_Layouts

ToolTip text for the view area

CObArray  m_Layouts

Store all the layout information

DWORD  m_nChartType

Graph type user selected from the Chart layout page

int  m_nCurIndex

The current index of the layout information of the topleft image on

virtual void  LoadCustomStandChart(CListBox& listBox)

Override this function to load custom created chart into the list box, by default, it does nothing

virtual void  LoadStandardChart(CListBox& listBox)

Load the all the standard chart type of Objective Chart into the lis tbox

virtual void  LoadCustomLayout(CObArray& layoutInfo)

Override this function to add custom layout, by default it does nothing

virtual void  LoadLayout(LPCTSTR lpResName, LPCTSTR lpResType)

Load some default layout from resource.

virtual void  LoadTypeResource(CComboBox& combo, LPCTSTR lpResName, LPCTSTR lpResType)

Fills the combobox from the specified resource file -- see CMainPage::LoadGraphType

virtual void  FillAxisType()

Override this function to add custom axis type

virtual void  FillAxisType()

Load the supporting axis type based on the graph type selected

virtual void  LoadGraphType(LPCTSTR lpResName, LPCTSTR lpResType)

Override this function to load custom graph types

virtual void  LoadGraphType(LPCTSTR lpResName, LPCTSTR lpResType)

Load the standard graph types

virtual void  SetCustomAxisStyle(SRGraphDisplay* pDisplay, DWORD dwAxisStyle)

Override this function to load a custom axis type

virtual void  SetCustomGraphStyle(SRGraphDisplay* pDisplay, DWORD dwGraphStyle)

Override this function to load a custom graph type

virtual void  SetGraphStyle(SRGraphDisplay* pd)

Sets the graph type for the display component according to user selection

virtual void  SetAxisStyle(SRGraphDisplay* pd)

Sets the axis type for the display component according to user selection

virtual void  SetupGraph(UINT nWhichPage)

Setup the specified page of the graph

virtual void  OnDeleteComponent()

Called to delete a component from the list.

virtual void  DoAdvancedButton()

Completes Layout portion and initiates Configuration part of Wizard

virtual  ~SRGWizSheet()

Destructor

afx_msg void  OnSysCommand(UINT nID, LPARAM lParam)

Handles SC_CLOSE message to prevent unintentional termination of the wizard

afx_msg void  OnApplyNow()

Message handler, called when the Apply button is clicked -- only applies changes

afx_msg void  OnOK()

Message handler called when click OK button in the wizard.

afx_msg LRESULT  OnChangeComponentType(WPARAM, LPARAM)

Message handler, called when the user selects a different component the combobox --

afx_msg LRESULT  OnChangeGraphType(WPARAM wParam, LPARAM lParam)

Message handler, called when the user changes the graph type from the main page

afx_msg LRESULT  OnChangeAxisType(WPARAM wParam, LPARAM lParam)

Message handler, called when the user changes the axis type of the chart.

afx_msg LRESULT  OnChangeComponentName(WPARAM wParam, LPARAM lParam)

Message handler, called when user change the component name in the component list

afx_msg LRESULT  OnNeedRedraw(WPARAM wParam, LPARAM lParam)

Message handler, called when any property page changes a graph setting that

afx_msg void  OnNextButton()

Handles Next button click to navigate to next page of Wizard

afx_msg void  OnBackButton()

Handles Back button click to navigate to previous page of Wizard

CFillStyle  m_FillPage

Fill Style setup page

CFontStyle  m_FontPage

Font Style setup page

virtual BOOL  EnableGeneralSetting(SRGraphComponent* gc)

Wizard call this function to decide whether to prevent user from modifying the

virtual BOOL  EnableFillSetting(SRGraphComponent* gc)

Wizard call this function to decide whether to prevent user from modifying the

virtual BOOL  EnableFontSetting(SRGraphComponent* gc)

Wizard call this function to decide whether to prevent user from modifying the

virtual void  RegisterToolTips()

Register some of the controls on the pages to have tool

virtual void  OnReArrangeComponent(int nSrcIndex, int nDestIndex)

Move component from one place to another.

virtual void  AddCustomComponents(SRGComboBox& combo)

Override this function to add user derived component to the available

virtual void  SwitchView(BOOL bUseScroll)

Switch between view with scroll bar or not

virtual void  AddToComponentComboBox(LPCTSTR lpszName, SRGraphComponent* pc)

Add the component with the given name to the graph

void  AddPage(CPropertyPage* page, LPCTSTR lpszCaption = NULL)

Adds a new property page to the sheet and optionally set the caption for its tab

virtual void  CopyGraph(SRGraph* pFromGraph, SRGraph* pToGraph, BOOL bCopyData = TRUE)

Copies the graph and its data using CSharedFile serialization

virtual void  SaveGraph(BOOL bSaveGraphData = FALSE)

Saves the local copy of the graph configuration to the user suppied graph object without modifying the user's data

virtual BOOL  InitializePages()

Initializes the property pages from the settings of the user supplied graph

void  SetShadowStyle(SRGraphStyle* pStyle, UINT nType)

Sets the shadow style bits in a SRGraphStyle object

void  SetMainPageOf(SRGraphComponent* gc)

Sets a component's style from the selections in the Main page -- called

void  SetFontStyleOf(SRGraphComponent* pc)

Setup the font style of the component from the settings in the Font Style page

void  SetFillStyleOf(SRGraphComponent* pc)

Setup the fill style of the component from the settings in the Fill Style page

virtual CString  GetComponentName(SRGraphComponent* gc)

Create a name for this component that will be visible in the component list of

virtual CString  GetNewSuffix()

Create a new suffix to prevent the name collision.

virtual void  ShowScopeSection(BOOL bShow)

Show or hide the controls related to the scope settings depending on the type

virtual void  OnAddComponent()

Add the user selected component to the graph.

void  InitMainPage(SRGraphComponent* gc)

Initializes the controls in the Main page that are common to all components

void  InitFillPage(SRGraphComponent* pc)

Sets the controls of the fill style page from the component data

void  InitFontPage(SRGraphComponent* pc)

Sets the controls of the font style page from the component data

SRGraph*  m_pRemoteGraph

Pointer to store the address of the user supplied graph

SRGraph*  m_pGraph

Local copy of the user's graph

BOOL  m_bUseOutData

Flag indicate whether the wizard will use the data of the passed graph or generate dummy data