QualitySliderDescriptor Class Reference

#include <qualops.h>

Inheritance diagram for QualitySliderDescriptor:

OpDescriptor MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 QualitySliderDescriptor (UINT32 toolID, UINT32 txID, CCRuntimeClass *Op, TCHAR *tok, pfnGetState gs, UINT32 helpId=0, UINT32 bubbleID=0, UINT32 resourceID=0, UINT32 controlID=0, BOOL ReceiveMessages=TRUE, BOOL Smart=FALSE, BOOL Clean=FALSE)
 Builds a new Quality Slider Op Descriptor.
virtual void OnControlCreate (OpDescControlCreateMsg *CreateMsg)
 Gets called when the control is first created to allow me to init it.
virtual void OnSliderSet (OpDescControlMsg *SelChangedMsg)
 Informs us when the slider position changes.
virtual BOOL OnDocViewMsg (DocView *pDocView, DocViewMsg::DocViewState State)
 Respond to a DocView changing message.
void OnQualityChanged (DocView *pView)
 Updates all the sliders visible sliders so that they show the changed view quality.

Static Public Member Functions

static OpState GetState (String_256 *Description, OpDescriptor *)
 Makes the opdescriptor always available.
static void Update ()
 Updates all the slider controls if the view quality has been changed by an outside influence (eg when loading a new document).

Public Attributes

INT32 CurrentSliderPos

Detailed Description

Definition at line 121 of file qualops.h.


Constructor & Destructor Documentation

QualitySliderDescriptor::QualitySliderDescriptor UINT32  toolID,
UINT32  txID,
CCRuntimeClass Op,
TCHAR tok,
pfnGetState  gs,
UINT32  helpId = 0,
UINT32  bubbleID = 0,
UINT32  resourceID = 0,
UINT32  controlID = 0,
BOOL  ReceiveMessages = TRUE,
BOOL  Smart = FALSE,
BOOL  Clean = FALSE
 

Builds a new Quality Slider Op Descriptor.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/11/94
Parameters:
As for OpDescriptor [INPUTS]
See also:
OpDescriptor::OpDescriptor

Definition at line 147 of file qualops.cpp.

00161     : OpDescriptor(toolID, txID, Op, tok, gs, helpId, bubbleID, resourceID, controlID,
00162                     ReceiveMessages, Smart, Clean, 0, GREY_WHEN_NO_CURRENT_DOC | DONT_GREY_WHEN_SELECT_INSIDE)
00163 {
00164     // Does nothing
00165 }


Member Function Documentation

OpState QualitySliderDescriptor::GetState String_256 Description,
OpDescriptor
[static]
 

Makes the opdescriptor always available.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/11/94
Parameters:
None used [INPUTS]
Returns:
Opstate

Definition at line 313 of file qualops.cpp.

00314 {
00315     // The state is unchanged
00316     OpState Blobby;
00317     return Blobby;
00318 }

void QualitySliderDescriptor::OnControlCreate OpDescControlCreateMsg CreateMsg  )  [virtual]
 

Gets called when the control is first created to allow me to init it.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/11/94
Parameters:
CreateMsg - Details about the control being created [INPUTS]

Reimplemented from OpDescriptor.

Definition at line 181 of file qualops.cpp.

00182 {
00183     // Get the dialog op details I need
00184     DialogOp* pDialogOp = CreateMsg->pDlgOp;
00185     CGadgetID GadgetID = CreateMsg->SetGadgetID;
00186 
00187     // And ask the control to use bitmaps
00188     pDialogOp->SetGadgetRange(GadgetID, 10, 110, 25);
00189     BOOL IsHorizontal = TRUE;
00190     if  (pDialogOp->IsKindOf(CC_RUNTIME_CLASS(DialogBarOp)))
00191          IsHorizontal = ((DialogBarOp *) pDialogOp)->IsHorizontal();
00192     
00193     if(IsHorizontal)
00194         pDialogOp->SetGadgetBitmaps(GadgetID, _R(IDB_QUALITYBASE),_R(IDB_QUALITYSLIDER));
00195     else
00196         pDialogOp->SetGadgetBitmaps(GadgetID, _R(IDB_QUALITYBASEVERT), _R(IDB_QUALITYSLIDERVERT));
00197 
00198     // If there is a view, set the position of the slider according to the
00199     // selected view's view quality
00200     DocView* pDocView = DocView::GetSelected();
00201     INT32 NewQuality;
00202     if (pDocView!=NULL)
00203     {
00204         // Ask the view about its view quality and set the sliders position
00205         NewQuality = pDocView->RenderQuality.GetQuality();
00206     }
00207     else
00208     {
00209         // Use the default quality value
00210         NewQuality = Quality::DefaultQuality.QualityValue;
00211     }
00212 
00213     // Set the slider position
00214     pDialogOp->SetLongGadgetValue(GadgetID, NewQuality /*110-NewQuality+10*/);
00215 }

BOOL QualitySliderDescriptor::OnDocViewMsg DocView pDocView,
DocViewMsg::DocViewState  State
[virtual]
 

Respond to a DocView changing message.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/11/94
Parameters:
pDocView - The new docview that is becoming active. [INPUTS]
Returns:
TRUE if it happened

Reimplemented from MessageHandler.

Definition at line 231 of file qualops.cpp.

00232 {
00233     // Only respond to the DocView changing
00234     if (State==DocViewMsg::SELCHANGED)
00235     {
00236         // see if it is valid
00237         if (pDocView != NULL)
00238         {
00239             // Its OK, change the sliders
00240             INT32 NewQuality = pDocView->RenderQuality.GetQuality();
00241 
00242             // update all slider controls that show the view quality
00243             List Gadgets;
00244             if (BuildGadgetList(&Gadgets))
00245             {
00246                 // Found some. Set the controls position according to the quality
00247                 GadgetListItem* pGadgetItem = (GadgetListItem*) Gadgets.GetHead();
00248 
00249                 while (pGadgetItem!=NULL)
00250                 {
00251                     // Set the sliders position
00252                     pGadgetItem->pDialogOp->SetLongGadgetValue(pGadgetItem->gidGadgetID, NewQuality /*110-NewQuality+10*/);
00253 
00254                     // go find the next gadget
00255                     pGadgetItem = (GadgetListItem*) Gadgets.GetNext(pGadgetItem);
00256                 }
00257         
00258                 // Clean out the list
00259                 Gadgets.DeleteAll();
00260             }
00261         }
00262     }
00263     return TRUE;
00264 }

void QualitySliderDescriptor::OnQualityChanged DocView pView  ) 
 

Updates all the sliders visible sliders so that they show the changed view quality.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/95
Parameters:
pView - the docview to look at [INPUTS]

Definition at line 362 of file qualops.cpp.

00363 {
00364     // see if it is valid
00365     if (pView != NULL)
00366     {
00367         // Its OK, change the sliders
00368         INT32 NewQuality = pView->RenderQuality.GetQuality();
00369 
00370         // update all slider controls that show the view quality
00371         List Gadgets;
00372         if (BuildGadgetList(&Gadgets))
00373         {
00374             // Found some. Set the controls position according to the quality
00375             GadgetListItem* pGadgetItem = (GadgetListItem*) Gadgets.GetHead();
00376 
00377             while (pGadgetItem!=NULL)
00378             {
00379                 // Set the sliders position
00380                 pGadgetItem->pDialogOp->SetLongGadgetValue(pGadgetItem->gidGadgetID, /*110-NewQuality+10*/ NewQuality);
00381 
00382                 // go find the next gadget
00383                 pGadgetItem = (GadgetListItem*) Gadgets.GetNext(pGadgetItem);
00384             }
00385     
00386             // Clean out the list
00387             Gadgets.DeleteAll();
00388         }
00389     }
00390 }

void QualitySliderDescriptor::OnSliderSet OpDescControlMsg SelChangedMsg  )  [virtual]
 

Informs us when the slider position changes.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/11/94
Parameters:
SelChangedMsg - The message details [INPUTS]

Reimplemented from OpDescriptor.

Definition at line 279 of file qualops.cpp.

00280 {
00281     // Go find the details we need
00282     DialogOp* pDialogOp = SelChangedMsg->pDlgOp;
00283     CGadgetID GadgetID = SelChangedMsg->SetGadgetID;
00284 
00285     // get the position of the slider
00286     BOOL Valid;
00287     INT32 NewPos = pDialogOp->GetLongGadgetValue(GadgetID, 10, 110, 0, &Valid);
00288 
00289     // If it worked, tell the operation
00290     if (Valid)
00291     {
00292         // Set the opdescriptors idea of the current slider position
00293         // and call the operation
00294 //      CurrentSliderPos = 110 - NewPos + 10;
00295         CurrentSliderPos = NewPos;
00296         Invoke();
00297     }
00298 }

void QualitySliderDescriptor::Update  )  [static]
 

Updates all the slider controls if the view quality has been changed by an outside influence (eg when loading a new document).

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

Definition at line 334 of file qualops.cpp.

00335 {
00336     // Get the "selected" DocView, ie. the view that the user has made top-most.
00337     DocView* pDocView = DocView::GetSelected();
00338     if (pDocView!=NULL)
00339     {
00340         // Find the Quality slider descriptot
00341         OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor( OPTOKEN_QUALITYSLIDER );
00342     
00343         // Update it with values of the Selected DocView.
00344         if (pOpDesc!= NULL)
00345             ((QualitySliderDescriptor*) pOpDesc)->OnQualityChanged(pDocView);
00346     }
00347 }


Member Data Documentation

INT32 QualitySliderDescriptor::CurrentSliderPos
 

Definition at line 157 of file qualops.h.


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