#include <urldlg.h>
Inheritance diagram for URLImportDlg:
Public Member Functions | |
URLImportDlg () | |
Default constructor. | |
void | DoWithParam (OpDescriptor *, OpParam *Param) |
Creates then opens the dialog in response to a request from the user and allows values to be passed in and returned to the caller via the URLImportDlgParam class. | |
void | Do (OpDescriptor *) |
Creates then opens the dialog in response to a request from the user. | |
virtual MsgResult | Message (Msg *Message) |
Handles all messages. | |
Static Public Member Functions | |
static BOOL | Init () |
URLImportDlg Init method. | |
static BOOL | OpenAndGetURL (WebAddress *purlToReturn) |
Starts up the Import from Internet dialog box. | |
static OpState | GetState (String_256 *, OpDescriptor *) |
URLImportDlg GetState method. | |
Static Public Attributes | |
static CDlgResID | IDD = _R(IDD_URLIMPORT) |
static const CDlgMode | Mode = MODAL |
Protected Member Functions | |
void | OnCreate () |
Handles a message that the dialog has just been created. | |
void | OnCommit () |
Handles a message that the "Import" button has been clicked. | |
void | OnURLChanged () |
Handles a message that the user has typed in the "URL" field. | |
Static Protected Attributes | |
static WebAddress | ms_url = WebAddress() |
static BOOL | DialogWasCancelled = FALSE |
static BOOL | DontHandleNextMessage = FALSE |
Definition at line 120 of file urldlg.h.
|
Default constructor.
Definition at line 182 of file urldlg.cpp. 00182 : DialogOp(URLImportDlg::IDD, URLImportDlg::Mode) 00183 { 00184 00185 }
|
|
Creates then opens the dialog in response to a request from the user.
Reimplemented from Operation. Definition at line 444 of file urldlg.cpp. 00445 { 00446 BOOL ok; 00447 00448 // Force the dialog box to be created, as it is modal it will be opened via a message 00449 ok = Create(); 00450 00451 if ( !ok ) 00452 { 00453 // Could not create the dialog box so call inform error 00454 InformError(); 00455 End(); 00456 } 00457 }
|
|
Creates then opens the dialog in response to a request from the user and allows values to be passed in and returned to the caller via the URLImportDlgParam class.
Reimplemented from Operation. Definition at line 476 of file urldlg.cpp. 00477 { 00478 BOOL ok; 00479 00480 // Force the dialog box to be created, as it is modal it will be opened via a message 00481 ok = Create(); 00482 00483 if ( !ok ) 00484 { 00485 // Could not create the dialog box so call inform error 00486 InformError(); 00487 End(); // End the operation 00488 } 00489 }
|
|
URLImportDlg GetState method.
Definition at line 385 of file urldlg.cpp. 00386 { 00387 OpState OpSt; 00388 return(OpSt); 00389 }
|
|
URLImportDlg Init method.
Reimplemented from SimpleCCObject. Definition at line 409 of file urldlg.cpp. 00410 { 00411 BOOL InitOK; 00412 00413 InitOK = RegisterOpDescriptor( 00414 0, /* Tool ID */ 00415 _R(IDS_URLIMPORT), 00416 CC_RUNTIME_CLASS(URLImportDlg), 00417 OPTOKEN_URLIMPORTDLG, 00418 GetState, 00419 _R(IDH_Command_Import_from_Web), /* help ID */ 00420 0, /* bubble help */ 00421 0, /* resource ID */ 00422 0 /* control ID */ 00423 ); 00424 00425 return (InitOK); 00426 }
|
|
Handles all messages.
Reimplemented from DialogOp. Definition at line 207 of file urldlg.cpp. 00208 { 00209 //If the message came from within our dialog 00210 if (IS_OUR_DIALOG_MSG(Message)) 00211 { 00212 //Then cast it into a dialog message and handle it 00213 DialogMsg* Msg = (DialogMsg*)Message; 00214 00215 //If this flag gets set, we should close the dialog 00216 BOOL EndDialog = FALSE; 00217 00218 //Now pass the message to a message handling function 00219 switch (Msg->DlgMsg) 00220 { 00221 case DIM_CREATE: 00222 OnCreate(); 00223 break; 00224 00225 case DIM_COMMIT: 00226 OnCommit(); 00227 EndDialog=TRUE; 00228 break; 00229 00230 case DIM_CANCEL: 00231 DialogWasCancelled=TRUE; 00232 EndDialog = TRUE; 00233 break; 00234 00235 case DIM_LFT_BN_CLICKED: 00236 // A control on the dialog box has been clicked... 00237 if(Msg->GadgetID==_R(IDC_URLIMPORT_IMPORT)) 00238 { 00239 OnCommit(); 00240 EndDialog=TRUE; 00241 } 00242 break; 00243 00244 00245 case DIM_TEXT_CHANGED: 00246 // The user has typed in an edit field 00247 switch (Msg->GadgetID) 00248 { 00249 case _R(IDC_URLIMPORT_URL): 00250 if (URLImportDlg::DontHandleNextMessage) 00251 URLImportDlg::DontHandleNextMessage=FALSE; 00252 else 00253 OnURLChanged(); 00254 break; 00255 00256 } 00257 break; 00258 00259 } 00260 00261 //And end the dialog if necessary 00262 if (EndDialog) 00263 { 00264 Close(); 00265 End(); 00266 } 00267 } 00268 00269 //Now pass the message down to the base class 00270 return DialogOp::Message(Message); 00271 }
|
|
Handles a message that the "Import" button has been clicked.
Definition at line 325 of file urldlg.cpp. 00326 { 00327 //Get the string from the edit field 00328 String_256 strUser=GetStringGadgetValue(_R(IDC_URLIMPORT_URL)); 00329 00330 //Now we want to correct this string. To do this we 00331 //need to set up some correction flags 00332 WebCorrectFlags wcfToUse; 00333 wcfToUse.SetForURLImport(); 00334 00335 //Now make a Web Address object out of the string 00336 //This will correct the string appropriately 00337 WebAddress urlToFetch(strUser, wcfToUse); 00338 00339 //And set our member variable 00340 ms_url=urlToFetch; 00341 00342 00343 }
|
|
Handles a message that the dialog has just been created.
Definition at line 302 of file urldlg.cpp. 00303 { 00304 //Put the keyboard focus in the edit field 00305 SetKeyboardFocus(_R(IDC_URLIMPORT_URL)); 00306 }
|
|
Handles a message that the user has typed in the "URL" field. void URLImportDlg::OnURLChanged()
Definition at line 362 of file urldlg.cpp. 00363 { 00364 //Does nothing at present 00365 //We may need to handle this if we want the Import... button to be greyed 00366 //until the user types in the field 00367 }
|
|
Starts up the Import from Internet dialog box.
Definition at line 147 of file urldlg.cpp. 00148 { 00149 //Say that the dialog wasn't cancelled 00150 DialogWasCancelled=FALSE; 00151 00152 //Find the dialog's op descriptor 00153 OpDescriptor *OpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(URLImportDlg)); 00154 00155 //And start up the dialog 00156 if (OpDesc != NULL) 00157 OpDesc->Invoke(); 00158 00159 //And return the member variable 00160 *purlToReturn=URLImportDlg::ms_url; 00161 00162 return !DialogWasCancelled; 00163 }
|
|
|
|
|
|
|
|
|
|
|