SGalleryLinePropertiesDlg Class Reference

#include <sglinepr.h>

Inheritance diagram for SGalleryLinePropertiesDlg:

DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 SGalleryLinePropertiesDlg ()
 Constructor.
 ~SGalleryLinePropertiesDlg ()
 destructor
MsgResult Message (Msg *Message)
 Standard DialogOp message handler which handles redraw and commit stuff.
void Do (OpDescriptor *)
 'Does' a line properties dialogue op. DO NOT call this method - it must be invoked via DoWithParam
void DoWithParam (OpDescriptor *, OpParam *Param)
 'Does' a line properties dialogue op. Shows the dialogue.
BOOL Create ()
 Creates a Line Properties dialogue box.
void SetNameEditField (String_256 *pString)
 Can be called by sgline to set the name text from the dialog.
void GetNameEditField (String_256 *pString)
 Can be called by sgline to get the name text from the dialog.
void SetRepeatingBool (BOOL Repeating)
 Can be called by sgline to set the repeating button state from the dialog.
BOOL GetRepeatingBool ()
 Can be called by sgline to get the repeating button state from the dialog.
void SetRepeatingLong (INT32 Repeats)
 Set the UI corresponding to the number of fixed repeats for a brush (where 0 repeats really means optimal repeats).
INT32 GetRepeatingLong ()
 Get the number of fixed repeats for this brush from the UI. 0 means optimal.
void SetSliderMinMax (INT32 Min, INT32 Max)
void SetSliderPos (INT32 Value)
void GreyRepeats (BOOL Grey)
void SetOverrideFillBool (BOOL OverrideFill)
 Set the Override Fill button state from the dialog.
BOOL GetOverrideFillBool ()
 Get the Override Fill button state from the dialog.
void SetOverrideTransBool (BOOL OverrideTrans)
 Set the Override Trans button state from the dialog.
BOOL GetOverrideTransBool ()
 Get the Override Trans button state from the dialog.
void RedrawStrokesInDocuments (StrokeHandle Handle)
 Whizzes through all the documents, redrawing nodes containing the passed in stroke business.

Static Public Member Functions

static BOOL Init ()
 Initialises the Line Properties Dialogue Op.
static OpState GetState (String_256 *, OpDescriptor *)
 Get the state of the Line Properties Dialog Op.
static void InvokeDialog (SuperGallery *Parent)
 Creates a new instance of this dialogue type, connects it to the given gallery, and opens the dialogue on screen.

Public Attributes

SGDisplayNodem_pItem

Static Public Attributes

static const UINT32 IDD = _R(IDD_SGLINEPROPERTIES)
static const CDlgMode Mode = MODELESS

Protected Member Functions

virtual void RedrawDiagram (ReDrawInfoType *ExtraInfo)
 Redraws the diagram on the line properties dialog.
void InitValues (void)
 Initialises the line properties dialogue, and sets its controls Scope: private.
void SetControls (void)
 (Re)Initialises the line properties dialogue controls
void Commit (BOOL RedrawDocument=TRUE)
 Applies the current settings in the dialog to its parent gallery and the referenced stroke in the document.

Protected Attributes

SuperGalleryParentGallery

Detailed Description

Definition at line 125 of file sglinepr.h.


Constructor & Destructor Documentation

SGalleryLinePropertiesDlg::SGalleryLinePropertiesDlg  ) 
 

Constructor.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/3/95

Definition at line 163 of file sglinepr.cpp.

SGalleryLinePropertiesDlg::~SGalleryLinePropertiesDlg  ) 
 

destructor

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/3/95

Definition at line 183 of file sglinepr.cpp.

00184 {
00185     if (ParentGallery != NULL)
00186         ParentGallery->CurrentLinePropertiesDlg = NULL;
00187 }


Member Function Documentation

void SGalleryLinePropertiesDlg::Commit BOOL  RedrawDocument = TRUE  )  [protected]
 

Applies the current settings in the dialog to its parent gallery and the referenced stroke in the document.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/3/97
Parameters:
RedrawDocument - For things like changing the textual description of the [INPUTS] stroke, we don't really need to redraw the document each time. Normally it's safer to redraw the lot...

Definition at line 339 of file sglinepr.cpp.

00340 {
00341     if (ParentGallery == NULL)
00342     {
00343         ERROR3("No parent gallery!");
00344         return;
00345     }
00346 
00347     if(m_pItem == NULL)
00348     {
00349         ERROR3("SGalleryLinePropertiesDlg::Commit - No associated item");
00350         return;
00351     }
00352 
00353     // Commit changes to item and redraw the various bits
00354     if(m_pItem->IsKindOf(CC_RUNTIME_CLASS(StrokeTypeItem)))
00355     {
00356         StrokeTypeItem *pItem = (StrokeTypeItem *)m_pItem;
00357 
00358         StrokeDefinition *pStroke = pItem->GetStrokeDefinition();
00359         if (pStroke != NULL)
00360         {
00361             // Apply the checkboxes
00362             pStroke->SetStrokeRepeating(GetRepeatingBool());
00363             pStroke->SetNumStrokeRepeats(GetRepeatingLong());
00364             pStroke->SetOverrideFill(GetOverrideFillBool());
00365             pStroke->SetOverrideTrans(GetOverrideTransBool());
00366 
00367             // Change the brush name
00368             String_256 NewName;
00369             GetNameEditField(&NewName);
00370             pStroke->SetStrokeName(&NewName);
00371 
00372             // Get the number of repeats
00373             INT32 Repeats = GetRepeatingLong();
00374             pStroke->SetNumStrokeRepeats(Repeats);
00375             SetSliderPos(Repeats);
00376 
00377             // Grey the fixed repeat stuff
00378             GreyRepeats(pItem->IsRepeating() == 0);
00379 
00380             pItem->UpdateGalleryItem();
00381             InvalidateGadget(_R(IDC_SGLINEPROPERTIES_DIAGRAM));
00382 
00383             if(RedrawDocument)
00384             {
00385                 StrokeHandle Handle = pItem->GetStrokeHandle();
00386                 RedrawStrokesInDocuments(Handle);
00387             }
00388         }
00389     }
00390 }

BOOL SGalleryLinePropertiesDlg::Create void   )  [virtual]
 

Creates a Line Properties dialogue box.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/3/95
Returns:
FALSE if it fails

Reimplemented from DialogOp.

Definition at line 540 of file sglinepr.cpp.

00541 {
00542     ERROR3IF(ParentGallery == NULL, "My ParentGallery is NULL!");
00543 
00544     if (DialogOp::Create())
00545     { 
00546         ParentGallery->CurrentLinePropertiesDlg = this;
00547 
00548         InitValues();
00549         return(TRUE);
00550     }
00551 
00552     return(FALSE);
00553 }

void SGalleryLinePropertiesDlg::Do OpDescriptor  )  [virtual]
 

'Does' a line properties dialogue op. DO NOT call this method - it must be invoked via DoWithParam

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/3/95
Parameters:
OPDescriptor - the Opdescriptor for this op [INPUTS]
Notes: To show this dialogue you should call InvokeDialog

See also:
SGalleryLinePropertiesDlg::InvokeDialog

Reimplemented from Operation.

Definition at line 574 of file sglinepr.cpp.

00575 {
00576     ERROR3("SGalleryLinePropertiesDlg - You must use DoWithParam (Call InvokeDialog)");
00577     End();
00578 }

void SGalleryLinePropertiesDlg::DoWithParam OpDescriptor ,
OpParam Param
[virtual]
 

'Does' a line properties dialogue op. Shows the dialogue.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/3/95
Parameters:
Bob - the Opdescriptor for this op [INPUTS] Param - The parameter. Must point at a LinePropertiesDlgParam object
Notes: To show this dialogue you should call InvokeDialog

See also:
SGalleryLinePropertiesDlg::InvokeDialog

Reimplemented from Operation.

Definition at line 599 of file sglinepr.cpp.

00600 {
00601     ERROR3IF(Param == NULL, "Null parameters are illegal");
00602 
00603     ParentGallery = ((LinePropertiesDlgParam *)Param)->ParentGal;
00604 
00605     ERROR3IF(ParentGallery == NULL, "SGalleryLinePropertiesDlg needs a non-NULL parent gallery!");  
00606 
00607     if (ParentGallery != NULL && Create())
00608         Open();
00609     else
00610         End();
00611 }

void SGalleryLinePropertiesDlg::GetNameEditField String_256 pString  ) 
 

Can be called by sgline to get the name text from the dialog.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/3/97
Returns:
pString - Copies the edit text into this string (which should have been allocated and passed to the function).

Definition at line 647 of file sglinepr.cpp.

00648 {
00649     if(pString != NULL)
00650     {
00651         *pString = "";
00652 
00653         BOOL Valid = FALSE;
00654         String_256 TheString = GetStringGadgetValue(_R(IDC_SGLINEPROPERTIES_NAMEEDIT), &Valid);
00655         if(Valid)
00656             *pString = TheString;
00657     }
00658 }

BOOL SGalleryLinePropertiesDlg::GetOverrideFillBool  ) 
 

Get the Override Fill button state from the dialog.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/3/97
Returns:
TRUE if the checkbox for 'Override Fill' is ticked

Definition at line 803 of file sglinepr.cpp.

00804 {
00805     BOOL Valid = FALSE;
00806     INT32 Value = GetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_OVERRIDE_FILL),0,1,0,&Valid);
00807     if(Valid && Value > 0)
00808         return TRUE;
00809 
00810     return FALSE;
00811 }

BOOL SGalleryLinePropertiesDlg::GetOverrideTransBool  ) 
 

Get the Override Trans button state from the dialog.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/3/97
Returns:
TRUE if the checkbox for 'Override Trans' is ticked

Definition at line 844 of file sglinepr.cpp.

00845 {
00846     BOOL Valid = FALSE;
00847     INT32 Value = GetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_OVERRIDE_TRANS),0,1,0,&Valid);
00848     if(Valid && Value > 0)
00849         return TRUE;
00850 
00851     return FALSE;
00852 }

BOOL SGalleryLinePropertiesDlg::GetRepeatingBool  ) 
 

Can be called by sgline to get the repeating button state from the dialog.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/3/97
Returns:
TRUE if the checkbox for 'repeating' is ticked

Definition at line 691 of file sglinepr.cpp.

00692 {
00693     BOOL Valid = FALSE;
00694     INT32 Value = GetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_REPEAT),0,1,0,&Valid);
00695     if(Valid && Value > 0)
00696         return TRUE;
00697 
00698     return FALSE;
00699 }

INT32 SGalleryLinePropertiesDlg::GetRepeatingLong  ) 
 

Get the number of fixed repeats for this brush from the UI. 0 means optimal.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/3/97
Returns:
Number of fixed repeats for the brush

Definition at line 731 of file sglinepr.cpp.

00732 {
00733     BOOL Valid = FALSE;
00734 
00735     INT32 Fixed = GetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_FIXED),0,1,0,&Valid);
00736     if(Fixed != 0 && Valid)
00737     {
00738         INT32 Value = GetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_FIXED_EDIT),0,255,0,&Valid);
00739         if(Valid && (Value > 0))
00740             return Value;
00741     }
00742 
00743 //  SetRepeatingLong(0);
00744 
00745     return 0;
00746 }

OpState SGalleryLinePropertiesDlg::GetState String_256 ,
OpDescriptor
[static]
 

Get the state of the Line Properties Dialog Op.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/3/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 489 of file sglinepr.cpp.

00490 {    
00491     OpState OpSt;
00492     return(OpSt);
00493 }

void SGalleryLinePropertiesDlg::GreyRepeats BOOL  Grey  ) 
 

Definition at line 760 of file sglinepr.cpp.

00761 {
00762     EnableGadget(_R(IDC_SGLINEPROPERTIES_FIXED), !Grey);
00763     EnableGadget(_R(IDC_SGLINEPROPERTIES_OPTIMAL), !Grey);
00764     EnableGadget(_R(IDC_SGLINEPROPERTIES_FIXED_EDIT), !Grey);
00765     EnableGadget(_R(IDC_SGLINEPROPERTIES_FIXED_SLIDER), !Grey);
00766 
00767 /*  SetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_FIXED), (Repeats > 0), TRUE, 0);
00768     SetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_OPTIMAL), (Repeats == 0), TRUE, 0);
00769     SetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_FIXED_EDIT), Repeats, TRUE, 0);*/
00770 }

BOOL SGalleryLinePropertiesDlg::Init void   )  [static]
 

Initialises the Line Properties Dialogue Op.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/3/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from SimpleCCObject.

Definition at line 512 of file sglinepr.cpp.

00513 {
00514     return (RegisterOpDescriptor(
00515                                 0,
00516                                 _R(IDS_SGLINEPROPERTIESDLG),
00517                                 CC_RUNTIME_CLASS(SGalleryLinePropertiesDlg),
00518                                 OPTOKEN_SGLINEPROPERTIESDLG,
00519                                 SGalleryLinePropertiesDlg::GetState,
00520                                 _R(IDST_GALLERY_MENU),  // Status line help
00521                                 _R(IDBBL_GALLERY_MENU), // Bubble help
00522                                 0   /* bitmap ID */
00523                                 ));
00524 }

void SGalleryLinePropertiesDlg::InitValues void   )  [protected]
 

Initialises the line properties dialogue, and sets its controls Scope: private.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/3/95
See also:
SGalleryLinePropertiesDlg::SetControls

Definition at line 205 of file sglinepr.cpp.

00206 {
00207     if (ParentGallery == NULL)
00208     {
00209         ERROR3("SGalleryLinePropertiesDlg MUST be given a valid parent pointer");
00210         return;
00211     }
00212 
00213     // The fixed thingy slider
00214     SetSliderMinMax(0, SliderMax);
00215     SetGadgetBitmaps(_R(IDC_SGLINEPROPERTIES_FIXED_SLIDER), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER));
00216     SetSliderPos(0);
00217 
00218     // Set up the OK button to respond to Adjust (SOFT_COMMIT) clicks
00219     // Don't call this more than once per dialog - fireworks ensue !
00220 //  DualFunctionButton(IDOK);
00221 
00222     // Fill in the controls with the current settings
00223     SetControls();
00224 }

void SGalleryLinePropertiesDlg::InvokeDialog SuperGallery Parent  )  [static]
 

Creates a new instance of this dialogue type, connects it to the given gallery, and opens the dialogue on screen.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/3/95
Parameters:
Parent - the parent (owner) of this display dialogue. This pointer [INPUTS] is used to inform the parent of changes to display/sort modes. May NOT be NULL.

Definition at line 244 of file sglinepr.cpp.

00245 {
00246     if (Parent->CurrentLinePropertiesDlg != NULL)       // There's one already open!
00247     {
00248         // Update the settings in the dialog
00249         Parent->CurrentLinePropertiesDlg->SetControls();
00250 
00251         // Bring it to the front of the window stack, then return
00252         Parent->CurrentLinePropertiesDlg->BringToTop();
00253         return;
00254     }
00255 
00256     LinePropertiesDlgParam OptInfo(Parent);
00257     OpDescriptor *Dlg = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(SGalleryLinePropertiesDlg));
00258 
00259     ERROR3IF(Dlg == NULL, "I can't find the Dialog OpDescriptor");
00260 
00261     if (Dlg != NULL)
00262         Dlg->Invoke(&OptInfo);
00263 }

MsgResult SGalleryLinePropertiesDlg::Message Msg Message  )  [virtual]
 

Standard DialogOp message handler which handles redraw and commit stuff.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/3/95
Parameters:
Msg - The dialogue manager message to handle [INPUTS]
Returns:
A MsgResult

Reimplemented from DialogOp.

Definition at line 408 of file sglinepr.cpp.

00409 {
00410     if (!(IS_OUR_DIALOG_MSG(Message))) return DialogOp::Message(Message);
00411 
00412     DialogMsg* TheMsg = (DialogMsg*)Message;
00413 
00414     switch(TheMsg->DlgMsg)
00415     {
00416         case DIM_SLIDER_POS_CHANGING:
00417         case DIM_SLIDER_POS_IDLE:
00418         case DIM_SLIDER_POS_SET:    
00419         {
00420             BOOL Valid = FALSE;
00421 
00422             INT32 Value = GetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_FIXED_SLIDER),0,SliderMax,0,&Valid);
00423             if(Value != 0 && Valid)
00424             {
00425                 SetRepeatingLong(SliderMax - Value);
00426             }
00427             break;
00428         }
00429 
00430         case DIM_LFT_BN_CLICKED:
00431         case DIM_RGT_BN_CLICKED:
00432             Commit();
00433             break;
00434 
00435         case DIM_TEXT_CHANGED:
00436             // Only commit if the user typed something rather than the code
00437             if(SGLinePrJustSetATextEditChangeMessage)
00438                 SGLinePrJustSetATextEditChangeMessage = FALSE;
00439             else
00440             {
00441                 CGadgetID GadgetID = TheMsg->GadgetID;
00442                 if(GadgetID == _R(IDC_SGLINEPROPERTIES_NAMEEDIT))
00443                     Commit(FALSE);  // No need to redraw the document here
00444                 else
00445                     Commit(TRUE);   // OK, we need to redraw the document
00446             }
00447             break;
00448 
00449         case DIM_COMMIT:                        // OK clicked
00450             Commit();
00451             // Drop through to CANCEL to close the dlg...
00452 
00453         case DIM_CANCEL:                        // Cancel clicked
00454             Close();
00455             End();
00456             break;
00457 
00458         case DIM_SOFT_COMMIT:                   // OK "adjust clicked"
00459             Commit();
00460             break;
00461 
00462         case DIM_REDRAW:                // handle redraw request for diagram gadget
00463             if (TheMsg->GadgetID == _R(IDC_SGLINEPROPERTIES_DIAGRAM))
00464                 RedrawDiagram((ReDrawInfoType*)TheMsg->DlgMsgParam);
00465             break;
00466 
00467     }
00468 
00469     return DialogOp::Message(Message);
00470 }

void SGalleryLinePropertiesDlg::RedrawDiagram ReDrawInfoType ExtraInfo  )  [protected, virtual]
 

Redraws the diagram on the line properties dialog.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/03/97

Definition at line 864 of file sglinepr.cpp.

00865 {
00866     INT32 dx = ExtraInfo->dx;   // In millipoints
00867     INT32 dy = ExtraInfo->dy;
00868     INT32 Dpi = ExtraInfo->Dpi; // The DPI of the screen
00869 
00870     if(m_pItem == NULL || !(m_pItem->IsKindOf(CC_RUNTIME_CLASS(StrokeTypeItem))))
00871     {
00872         ERROR3("SGalleryLinePropertiesDlg::RedrawDiagram - Dodgy or no item");
00873         return;
00874     }
00875 
00876     StrokeTypeItem *pItem = (StrokeTypeItem *)m_pItem;
00877 
00878     // Total size of control
00879     DocRect ControlRect;
00880     ControlRect.lox = 0;
00881     ControlRect.loy = 0;
00882     ControlRect.hix = dx;
00883     ControlRect.hiy = dy;
00884 
00885     // make a render region
00886     DocRect RendRect = ControlRect;
00887     RenderRegion* pRender=CreateGRenderRegion(&RendRect,ExtraInfo);
00888     if (pRender!=NULL)
00889     {
00890         // Renders the stroke into the render region
00891 //      pItem->RenderItem(pRender, &RendRect, (32000)); // 32pt line width
00892         pItem->RenderItem(pRender, &RendRect, dy); // almost as big as the control
00893 
00894         // Destroys and blits the render region
00895         DestroyGRenderRegion(pRender);
00896     }
00897 }

void SGalleryLinePropertiesDlg::RedrawStrokesInDocuments StrokeHandle  Handle  ) 
 

Whizzes through all the documents, redrawing nodes containing the passed in stroke business.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com> / Jason
Date:
7/3/97
Parameters:
Handle - the handle of the stroke to search for in the docs [INPUTS]

Definition at line 913 of file sglinepr.cpp.

00914 {
00915     Document *pOurDoc = (Document *) GetApplication()->Documents.GetHead();
00916     while (pOurDoc != NULL)
00917     {
00918         ObjChangeFlags ChangeFlags;
00919         ChangeFlags.Attribute = TRUE;
00920 
00921         ObjChangeParam ChangeParam(OBJCHANGE_STARTING, ChangeFlags, NULL, NULL);
00922 
00923         Node *CurNode = Node::DocFindFirstDepthFirst(pOurDoc);
00924         while (CurNode != NULL)
00925         {
00926             if (CurNode->IsAnAttribute() && CurNode->IsKindOf(CC_RUNTIME_CLASS(AttrStrokeType)))
00927             {
00928                 // actually, in here, we could possibly just use NodeAttribute::operator== to
00929                 // see if it's the same as the Stroke Attribute that we're playing with
00930                 // - this would be better than IsKindOf's
00931 
00932                 // Have found a StrokeType Attribute. Check if it's a Vector Stroke attribute
00933                 // If it is one using the stroke we're after, then force a redraw of our parent node
00934                 AttrStrokeType *pNode = (AttrStrokeType *) CurNode;
00935 
00936                 StrokeTypeAttrValue *pValue = (StrokeTypeAttrValue *)pNode->GetAttributeValue();
00937 
00938                 PathProcessorStroke *pProcessor = pValue->GetPathProcessor();
00939 
00940                 if (pProcessor != NULL && pProcessor->IsKindOf(CC_RUNTIME_CLASS(PathProcessorStrokeVector)))
00941                 {
00942                     StrokeHandle ThisHandle = ((PathProcessorStrokeVector *)pProcessor)->GetStrokeDefinition();
00943                     if (ThisHandle == Handle || Handle == StrokeHandle_NoStroke)
00944                     {
00945                         Node *Parent = CurNode->FindParent();  
00946                         if (Parent != NULL && Parent->IsBounded())
00947                         {
00948                             // Invoke AllowOp on the node to tag it so that parents such as blends
00949                             // and moulds will also redraw if necessary. We ignore the return code
00950                             // because we're not actually going to touch the node at all.
00951                             CurNode->AllowOp(&ChangeParam);
00952 
00953                             // And redraw the directly affected node (our parent)
00954                             DocRect NodeBounds = ((NodeRenderableBounded *)Parent)->GetBoundingRect();
00955                             pOurDoc->ForceRedraw(Parent->FindParentSpread(), NodeBounds, FALSE, Parent);
00956                         }
00957                     }
00958                 }
00959             }
00960             CurNode = CurNode->DocFindNextDepthFirst();
00961         }
00962         
00963         // And make sure that the redraw occurs right away
00964         pOurDoc->FlushRedraw();
00965 
00966         ChangeParam.Define(OBJCHANGE_FINISHED, ChangeParam.GetChangeFlags(), NULL, NULL);
00967         UpdateAllChangedNodes(&ChangeParam);
00968 
00969         pOurDoc = (Document *) GetApplication()->Documents.GetNext(pOurDoc);
00970     }
00971 }

void SGalleryLinePropertiesDlg::SetControls void   )  [protected]
 

(Re)Initialises the line properties dialogue controls

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/3/97

Definition at line 279 of file sglinepr.cpp.

00280 {
00281     if (ParentGallery == NULL)
00282     {
00283         ERROR3("ParentGallery is NULL!");
00284         return;
00285     }
00286 
00287     // Call gallery first
00288     BOOL Result = ParentGallery->ApplyAction(SGACTION_SETLINEPROPERTIES);
00289 
00290     // Now set values in the dialog
00291     SGDisplayNode *pNode = ParentGallery->DisplayTree->FindNextSelectedItem(NULL);
00292     if(pNode != NULL && pNode->IsKindOf(CC_RUNTIME_CLASS(StrokeTypeItem)))
00293     {
00294         StrokeTypeItem *pItem = (StrokeTypeItem *)pNode;
00295         m_pItem = pItem;
00296     
00297         // Set the edit name field
00298         String_256 ItemText;
00299         pItem->GetNameText(&ItemText);
00300         SetNameEditField(&ItemText);
00301 
00302         // Set the repeating button
00303         SetRepeatingBool(pItem->IsRepeating());
00304 
00305         // Set the fixed repeating values
00306         SetRepeatingLong(pItem->NumRepeats());
00307 
00308         // Grey the fixed repeat stuff
00309         GreyRepeats(pItem->IsRepeating() == 0);
00310 
00311         // Set the override fill button
00312         SetOverrideFillBool(pItem->OverridesFill());
00313 
00314         // Set the override transparency button
00315         SetOverrideTransBool(pItem->OverridesTrans());
00316     }
00317 
00318     InvalidateGadget(_R(IDC_SGLINEPROPERTIES_DIAGRAM));
00319 }

void SGalleryLinePropertiesDlg::SetNameEditField String_256 pString  ) 
 

Can be called by sgline to set the name text from the dialog.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/3/97
Parameters:
pString - The string to copy into the edit field [INPUTS]

Definition at line 626 of file sglinepr.cpp.

00627 {
00628     if(pString != NULL)
00629     {
00630         SGLinePrJustSetATextEditChangeMessage = TRUE;
00631         SetStringGadgetValue(_R(IDC_SGLINEPROPERTIES_NAMEEDIT), pString);
00632     }
00633 }

void SGalleryLinePropertiesDlg::SetOverrideFillBool BOOL  OverrideFill  ) 
 

Set the Override Fill button state from the dialog.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/3/97
Parameters:
OverrideFill - TRUE and we'll put a tick by the Override Fill item [INPUTS]

Definition at line 783 of file sglinepr.cpp.

00784 {
00785     INT32 RadioValue = 0;
00786     if(OverrideFill)
00787         RadioValue = 1;
00788 
00789     SetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_OVERRIDE_FILL), RadioValue, TRUE, 0);
00790 }

void SGalleryLinePropertiesDlg::SetOverrideTransBool BOOL  OverrideTrans  ) 
 

Set the Override Trans button state from the dialog.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/3/97
Parameters:
OverrideTrans - TRUE and we'll put a tick by the Override Trans item [INPUTS]

Definition at line 824 of file sglinepr.cpp.

00825 {
00826     INT32 RadioValue = 0;
00827     if(OverrideTrans)
00828         RadioValue = 1;
00829 
00830     SetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_OVERRIDE_TRANS), RadioValue, TRUE, 0);
00831 }

void SGalleryLinePropertiesDlg::SetRepeatingBool BOOL  Repeating  ) 
 

Can be called by sgline to set the repeating button state from the dialog.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/3/97
Parameters:
Repeating - TRUE and we'll put a tick by the repeating item [INPUTS]

Definition at line 671 of file sglinepr.cpp.

00672 {
00673     INT32 RadioValue = 0;
00674     if(Repeating)
00675         RadioValue = 1;
00676 
00677     SetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_REPEAT), RadioValue, TRUE, 0);
00678 }

void SGalleryLinePropertiesDlg::SetRepeatingLong INT32  Repeats  ) 
 

Set the UI corresponding to the number of fixed repeats for a brush (where 0 repeats really means optimal repeats).

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/3/97
Parameters:
Repeats - Number of fixed repeats for the brush [INPUTS]

Definition at line 713 of file sglinepr.cpp.

00714 {
00715     SetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_FIXED), (Repeats > 0), TRUE, 0);
00716     SetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_OPTIMAL), (Repeats == 0), TRUE, 0);
00717     SetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_FIXED_EDIT), Repeats, TRUE, 0);
00718 }

void SGalleryLinePropertiesDlg::SetSliderMinMax INT32  Min,
INT32  Max
 

Definition at line 749 of file sglinepr.cpp.

00750 {
00751     SetGadgetRange(_R(IDC_SGLINEPROPERTIES_FIXED_SLIDER), Min, Max, 1);
00752 }

void SGalleryLinePropertiesDlg::SetSliderPos INT32  Value  ) 
 

Definition at line 754 of file sglinepr.cpp.

00755 {
00756     SetLongGadgetValue(_R(IDC_SGLINEPROPERTIES_FIXED_SLIDER), SliderMax - Value); 
00757 }


Member Data Documentation

const UINT32 SGalleryLinePropertiesDlg::IDD = _R(IDD_SGLINEPROPERTIES) [static]
 

Definition at line 142 of file sglinepr.h.

SGDisplayNode* SGalleryLinePropertiesDlg::m_pItem
 

Definition at line 183 of file sglinepr.h.

const CDlgMode SGalleryLinePropertiesDlg::Mode = MODELESS [static]
 

Definition at line 143 of file sglinepr.h.

SuperGallery* SGalleryLinePropertiesDlg::ParentGallery [protected]
 

Definition at line 186 of file sglinepr.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:00:54 2007 for Camelot by  doxygen 1.4.4