#include <brshname.h>
Inheritance diagram for CBaseBrushNameDlg:
Protected Member Functions | |
CBaseBrushNameDlg (CDlgResID idRes, CDlgMode nMode) | |
Create a CBaseBrushNameDlg, an abstract base class for the Name name and dialogs. | |
virtual StringBase * | GetDescription (StringBase *pstrDesc)=0 |
virtual StringBase * | GetSuggestion (StringBase *pstrDesc)=0 |
virtual UINT32 | IsValid (const StringBase &strName) |
virtual BOOL | DoCommit (const StringBase &strName)=0 |
virtual void | HandleCancel () |
virtual void | Do (OpDescriptor *) |
Creates and runs a CBaseBrushNameDlg. Shouldn't really use this as we will have no definition to name. | |
virtual void | DoWithParam (OpDescriptor *, OpParam *pParam) |
Creates and runs a CBaseBrushNameDlg to get a name for the brush definition included in our param. | |
virtual MsgResult | Message (Msg *pMessage) |
Handles kernel messages for the CBaseBrushNameDlg dialog operation. | |
virtual void | InitGadgetText (String_32 *pString=NULL, BOOL resizeDialog=TRUE)=0 |
Protected Attributes | |
BrushHandle | m_BrushHandle |
String_32 | m_strSuggest |
Static Private Attributes | |
static BOOL | m_bModeless = FALSE |
Definition at line 116 of file brshname.h.
|
Create a CBaseBrushNameDlg, an abstract base class for the Name name and dialogs.
Definition at line 130 of file brshname.cpp. 00131 : DialogOp(idRes, nMode) 00132 { 00133 m_BrushHandle = BrushHandle_NoBrush; 00134 }
|
|
Creates and runs a CBaseBrushNameDlg. Shouldn't really use this as we will have no definition to name.
Reimplemented from Operation. Definition at line 149 of file brshname.cpp. 00150 { 00151 // Try to run this operation. 00152 if (!Create()) 00153 { 00154 InformError(0, _R(IDS_OK)); 00155 End(); 00156 } 00157 if (m_bModeless == TRUE) 00158 Open(); 00159 00160 }
|
|
Implemented in CNameBrushDlg, and CInitBrushNameDlg. |
|
Creates and runs a CBaseBrushNameDlg to get a name for the brush definition included in our param.
Reimplemented from Operation. Definition at line 172 of file brshname.cpp. 00173 { 00174 if (pParam == NULL) 00175 { 00176 ERROR3("Param is null in CBaseBrushNameDlg::DoWithParam"); 00177 return; 00178 } 00179 // first extract the brush handle 00180 m_BrushHandle = static_cast<BrushHandle> (pParam->Param1); 00181 00182 // now do it 00183 Do(pDesc); 00184 }
|
|
Implemented in CNameBrushDlg. |
|
Implemented in CNameBrushDlg. |
|
Reimplemented in CInitBrushNameDlg. Definition at line 136 of file brshname.h.
|
|
Implemented in CNameBrushDlg, and CInitBrushNameDlg. |
|
Reimplemented in CNameBrushDlg. Definition at line 288 of file brshname.cpp.
|
|
Handles kernel messages for the CBaseBrushNameDlg dialog operation.
Reimplemented from DialogOp. Definition at line 194 of file brshname.cpp. 00195 { 00196 // A message from the dialog or its gadgets? 00197 if (IS_OUR_DIALOG_MSG(pMessage)) 00198 { 00199 DialogMsg* pMsg = (DialogMsg*) pMessage; 00200 switch (pMsg->DlgMsg) 00201 { 00202 case DIM_CREATE: 00203 InitGadgetText(); 00204 break; 00205 00206 case DIM_TEXT_CHANGED: 00207 // Disable the OK/Apply button if there's no document or entered text. 00208 EnableGadget(_R(IDOK), !GetStringGadgetValue(_R(IDC_EDITBRUSHNAME), 0).IsEmpty() 00209 && Document::GetSelected() != 0); 00210 break; 00211 00212 case DIM_LFT_BN_CLICKED: // enter messages when the edit box has the focus get cast to this 00213 if (pMsg->GadgetID == _R(ID_CC_HELP_BUTTON)) 00214 break; 00215 case DIM_COMMIT: 00216 { 00217 // Check name for validity. 00218 String_256 strEnter = GetStringGadgetValue(_R(IDC_EDITBRUSHNAME), 0); 00219 UINT32 nErrID = IsValid(strEnter); 00220 00221 if (nErrID != 0) 00222 { 00223 // Invalid, reinitialise. 00224 InformError(nErrID); 00225 if (nErrID == _R(IDS_BRUSHNAME_INVALID)) 00226 { 00227 String_32 s(strEnter); 00228 InitGadgetText(&s, FALSE); 00229 } 00230 else 00231 InitGadgetText(NULL); 00232 break; 00233 } 00234 else 00235 { 00236 // Entry is valid, try committing it. 00237 String_32 FinalString(strEnter); 00238 if (DoCommit(strEnter)) 00239 { 00240 // Don't close, reinitialise (dialog is modeless). 00241 InitGadgetText(); 00242 pMsg->DlgMsg = DIM_NONE; // stop base class closing it 00243 break; 00244 } 00245 else 00246 { 00247 // Close(); 00248 // End(); - base class will close 00249 break; 00250 } 00251 } 00252 00253 } 00254 break; 00255 case DIM_CANCEL: 00256 HandleCancel(); // base class will close 00257 break; 00258 default: 00259 break; 00260 } 00261 } 00262 00263 00264 // Has the document been switched or closed? 00265 else if (MESSAGE_IS_A(pMessage, DocChangingMsg)) 00266 { 00267 DocChangingMsg* pMsg = (DocChangingMsg*) pMessage; 00268 if (pMsg->State == DocChangingMsg::SELCHANGED) 00269 EnableGadget(_R(IDOK), pMsg->pNewDoc != 0); 00270 } 00271 00272 // Pass everything on to the base class . . . 00273 return DialogOp::Message(pMessage); 00274 }
|
|
Definition at line 119 of file brshname.h. |
|
Definition at line 147 of file brshname.h. |
|
Definition at line 150 of file brshname.h. |