00001 // $Id: davedlg.cpp 1282 2006-06-09 09:46:49Z alex $ 00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE 00003 ================================XARAHEADERSTART=========================== 00004 00005 Xara LX, a vector drawing and manipulation program. 00006 Copyright (C) 1993-2006 Xara Group Ltd. 00007 Copyright on certain contributions may be held in joint with their 00008 respective authors. See AUTHORS file for details. 00009 00010 LICENSE TO USE AND MODIFY SOFTWARE 00011 ---------------------------------- 00012 00013 This file is part of Xara LX. 00014 00015 Xara LX is free software; you can redistribute it and/or modify it 00016 under the terms of the GNU General Public License version 2 as published 00017 by the Free Software Foundation. 00018 00019 Xara LX and its component source files are distributed in the hope 00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the 00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00022 See the GNU General Public License for more details. 00023 00024 You should have received a copy of the GNU General Public License along 00025 with Xara LX (see the file GPL in the root directory of the 00026 distribution); if not, write to the Free Software Foundation, Inc., 51 00027 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00028 00029 00030 ADDITIONAL RIGHTS 00031 ----------------- 00032 00033 Conditional upon your continuing compliance with the GNU General Public 00034 License described above, Xara Group Ltd grants to you certain additional 00035 rights. 00036 00037 The additional rights are to use, modify, and distribute the software 00038 together with the wxWidgets library, the wxXtra library, and the "CDraw" 00039 library and any other such library that any version of Xara LX relased 00040 by Xara Group Ltd requires in order to compile and execute, including 00041 the static linking of that library to XaraLX. In the case of the 00042 "CDraw" library, you may satisfy obligation under the GNU General Public 00043 License to provide source code by providing a binary copy of the library 00044 concerned and a copy of the license accompanying it. 00045 00046 Nothing in this section restricts any of the rights you have under 00047 the GNU General Public License. 00048 00049 00050 SCOPE OF LICENSE 00051 ---------------- 00052 00053 This license applies to this program (XaraLX) and its constituent source 00054 files only, and does not necessarily apply to other Xara products which may 00055 in part share the same code base, and are subject to their own licensing 00056 terms. 00057 00058 This license does not apply to files in the wxXtra directory, which 00059 are built into a separate library, and are subject to the wxWindows 00060 license contained within that directory in the file "WXXTRA-LICENSE". 00061 00062 This license does not apply to the binary libraries (if any) within 00063 the "libs" directory, which are subject to a separate license contained 00064 within that directory in the file "LIBS-LICENSE". 00065 00066 00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS 00068 ---------------------------------------------- 00069 00070 Subject to the terms of the GNU Public License (see above), you are 00071 free to do whatever you like with your modifications. However, you may 00072 (at your option) wish contribute them to Xara's source tree. You can 00073 find details of how to do this at: 00074 http://www.xaraxtreme.org/developers/ 00075 00076 Prior to contributing your modifications, you will need to complete our 00077 contributor agreement. This can be found at: 00078 http://www.xaraxtreme.org/developers/contribute/ 00079 00080 Please note that Xara will not accept modifications which modify any of 00081 the text between the start and end of this header (marked 00082 XARAHEADERSTART and XARAHEADEREND). 00083 00084 00085 MARKS 00086 ----- 00087 00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara 00089 designs are registered or unregistered trademarks, design-marks, and/or 00090 service marks of Xara Group Ltd. All rights in these marks are reserved. 00091 00092 00093 Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK. 00094 http://www.xara.com/ 00095 00096 =================================XARAHEADEREND============================ 00097 */ 00098 // 00099 00100 #include "camtypes.h" 00101 #include "davedlg.h" 00102 00103 //#include "bevres.h" //URL dialog resources 00104 //#include "resimmap.h" //URL import string resources 00105 00106 //#include "msg.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00107 00108 #include "xshelpid.h" //For the help ID 00109 00110 // includes for additions to the rendering tree 00111 //#include "nodeattr.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00112 #include "lineattr.h" 00113 //#include "attrmgr.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00114 00115 //#include "app.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00116 //#include "document.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00117 #include "page.h" 00118 //#include "spread.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00119 #include "nodebmp.h" 00120 #include "bitmpinf.h" 00121 #include "bmpfiltr.h" 00122 00123 //#include "rndrgn.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00124 #include "grnddib.h" 00125 00126 #include "bmpexdoc.h" 00127 00128 //#include "docview.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00129 00130 #include "chapter.h" 00131 00132 #include "beveler.h" 00133 00134 //#include "oilcoord.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00135 00136 //#include "justin3.h" 00137 00138 //#include "selop.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00139 #include "mkshapes.h" 00140 #include "groupops.h" 00141 00142 DECLARE_SOURCE("$Revision: 1282 $"); 00143 00144 CC_IMPLEMENT_DYNCREATE(DaveDlg, DialogOp) 00145 00146 #define new CAM_DEBUG_NEW 00147 00148 // Set up the dialog box details stored as statics in the class 00149 CDlgResID DaveDlg::IDD = _R(IDD_DAVES_DLG); 00150 const CDlgMode DaveDlg::Mode = MODELESS; 00151 00152 BOOL DaveDlg::DontHandleNextMessage = FALSE; 00153 BOOL DaveDlg::DialogWasCancelled = FALSE; 00154 00155 WebAddress DaveDlg::ms_url = WebAddress(); 00156 00157 /****************************************************************************************** 00158 00159 > BOOL DaveDlg::OpenAndGetURL(WebAddress* purlToReturn) 00160 00161 00162 Author: Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com> 00163 Created: 6/6/97 00164 Inputs: - 00165 00166 Outputs: purlToReturn Pointer to a Web Address object 00167 00168 Returns: TRUE - Import was pressed 00169 FALSE - Cancel was pressed 00170 Purpose: Starts up the Import from Internet dialog box 00171 Errors: - 00172 SeeAlso: - 00173 00174 ******************************************************************************************/ 00175 00176 BOOL DaveDlg::DoCreate() 00177 { 00178 return TRUE; 00179 } 00180 00181 00182 /****************************************************************************************** 00183 00184 > DaveDlg::DaveDlg(): DialogOp(DaveDlg::IDD, DaveDlg::Mode) 00185 00186 00187 Author: Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com> 00188 Created: 10/4/97 00189 Inputs: - 00190 Outputs: - 00191 Returns: - 00192 Purpose: Default constructor 00193 Errors: - 00194 SeeAlso: - 00195 00196 ******************************************************************************************/ 00197 00198 DaveDlg::DaveDlg(): DialogOp(DaveDlg::IDD, DaveDlg::Mode) 00199 { 00200 m_Indent = 0; 00201 m_Contrast = 0; 00202 m_Angle = 0; 00203 m_Type = 0; 00204 } 00205 00206 DaveDlg::~DaveDlg() 00207 { 00208 } 00209 00210 /****************************************************************************************** 00211 00212 > MsgResult DaveDlg::Message(CDlgMessage DlgMsg, CGadgetID Gadget) 00213 00214 00215 Author: Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com> 00216 Created: 10/4/97 00217 Inputs: - 00218 Outputs: - 00219 Returns: - 00220 Purpose: Handles all messages. 00221 00222 This function simply maps the message to one of our message handling 00223 functions below. 00224 00225 Errors: - 00226 SeeAlso: - 00227 00228 ******************************************************************************************/ 00229 00230 MsgResult DaveDlg::Message(Msg* Message) 00231 { 00232 return DialogOp::Message(Message); 00233 } 00234 00235 /******************************************************************************************** 00236 00237 DaveDlg message handling functions 00238 00239 The following group of functions are called from DaveDlg::Message 00240 when a message is received. 00241 00242 They call other functions which do whatever needs to be done. 00243 00244 ********************************************************************************************/ 00245 00246 00247 /******************************************************************************************** 00248 00249 void DaveDlg::OnCreate() 00250 00251 Author: Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com> 00252 Created: 10/4/97 00253 Inputs: - 00254 Outputs: - 00255 Returns: - 00256 00257 Purpose: Handles a message that the dialog has just been created. 00258 00259 Errors: - 00260 SeeAlso: DaveDlg::Message() 00261 00262 ********************************************************************************************/ 00263 00264 void DaveDlg::OnCreate() 00265 { 00266 //Put the keyboard focus in the edit field 00267 // SetKeyboardFocus(_R(IDC_DAVE_LW_EDIT)); 00268 } 00269 00270 /******************************************************************************************** 00271 00272 void DaveDlg::OnCommit() 00273 00274 Author: Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com> 00275 Created: 10/4/97 00276 Inputs: - 00277 Outputs: - 00278 Returns: - 00279 00280 Purpose: Handles a message that the "Import" button has been clicked 00281 00282 Errors: - 00283 SeeAlso: DaveDlg::Message() 00284 00285 ********************************************************************************************/ 00286 00287 void DaveDlg::OnCommit() 00288 { 00289 //Get the string from the edit field 00290 /* 00291 String_256 strUser=GetStringGadgetValue(_R(IDC_URLIMPORT_URL)); 00292 00293 //Now we want to correct this string. To do this we 00294 //need to set up some correction flags 00295 WebCorrectFlags wcfToUse; 00296 wcfToUse.SetForURLImport(); 00297 00298 //Now make a Web Address object out of the string 00299 //This will correct the string appropriately 00300 WebAddress urlToFetch(strUser, wcfToUse); 00301 00302 //And set our member variable 00303 ms_url=urlToFetch; 00304 */ 00305 00306 00307 } 00308 00309 /******************************************************************************************** 00310 00311 void DaveDlg::OnURLChanged() 00312 00313 Author: Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com> 00314 Created: 10/4/97 00315 Inputs: - 00316 Outputs: - 00317 Returns: - 00318 00319 Purpose: Handles a message that the user has typed in the "URL" field 00320 00321 Errors: - 00322 SeeAlso: DaveDlg::Message() 00323 00324 ********************************************************************************************/ 00325 00326 void DaveDlg::OnURLChanged() 00327 { 00328 //Does nothing at present 00329 //We may need to handle this if we want the Import... button to be greyed 00330 //until the user types in the field 00331 } 00332 00333 00334 /****************************************************************************************** 00335 00336 > static OpState DaveDlg::GetState(String_256*, OpDescriptor*) 00337 00338 Author: Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com> 00339 Created: 10/4/97 00340 Inputs: - 00341 Outputs: - 00342 Returns: - 00343 Purpose: DaveDlg GetState method 00344 Errors: - 00345 SeeAlso: - 00346 00347 ******************************************************************************************/ 00348 00349 OpState DaveDlg::GetState(String_256*, OpDescriptor*) 00350 { 00351 OpState OpSt; 00352 return(OpSt); 00353 } 00354 00355 00356 00357 00358 /****************************************************************************************** 00359 00360 > BOOL DaveDlg::Init() 00361 00362 Author: Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com> 00363 Created: 10/4/97 00364 Inputs: - 00365 Outputs: - 00366 Returns: - 00367 Purpose: DaveDlg Init method 00368 Errors: - 00369 SeeAlso: - 00370 00371 ******************************************************************************************/ 00372 00373 BOOL DaveDlg::Init() 00374 { 00375 BOOL InitOK; 00376 00377 InitOK = RegisterOpDescriptor( 00378 0, /* Tool ID */ 00379 _R(IDS_DAVEDLG), 00380 CC_RUNTIME_CLASS(DaveDlg), 00381 OPTOKEN_DAVEDLG, 00382 GetState, 00383 _R(IDH_Command_Import_from_Web), /* help ID */ 00384 0, /* bubble help */ 00385 0, /* resource ID */ 00386 0 /* control ID */ 00387 ); 00388 00389 return (InitOK); 00390 } 00391 00392 00393 /****************************************************************************************** 00394 00395 > void DaveDlg::Do(OpDescriptor*) 00396 00397 Author: Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com> 00398 Created: 11/4/97 00399 Inputs: - 00400 Outputs: - 00401 Returns: - 00402 Purpose: Creates then opens the dialog in response to a request from the user. 00403 Errors: - 00404 SeeAlso: - 00405 00406 ******************************************************************************************/ 00407 00408 void DaveDlg::Do(OpDescriptor*) 00409 { 00410 00411 } 00412 00413 /****************************************************************************************** 00414 00415 > void DaveDlg::DoWithParam(OpDescriptor*) 00416 00417 Author: Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com> 00418 Created: 11/4/97 00419 Inputs: - 00420 Outputs: - 00421 Returns: - 00422 Purpose: Creates then opens the dialog in response to a request from the user and 00423 allows values to be passed in and returned to the caller via the 00424 DaveDlgParam class. 00425 Errors: - 00426 SeeAlso: - 00427 00428 ******************************************************************************************/ 00429 00430 void DaveDlg::DoWithParam(OpDescriptor*, OpParam* Param) 00431 { 00432 00433 } 00434 00435 /****************************************************************************************** 00436 00437 > void DaveDlg::DoChangeInValue() 00438 00439 Author: David_McClarnon (Xara Group Ltd) <camelotdev@xara.com> 00440 Created: 17/12/98 00441 Inputs: - 00442 Outputs: - 00443 Returns: - 00444 Purpose: Changes the attribute value/s 00445 Errors: - 00446 SeeAlso: - 00447 00448 ******************************************************************************************/ 00449 00450 00451 void DaveDlg::DoChangeInValue() 00452 { 00453 } 00454 00455 BOOL DaveDlg::DoBevel() 00456 { 00457 return TRUE; 00458 } 00459 00460 BOOL DaveDlg::RemoveBevel() 00461 { 00462 return TRUE; 00463 } 00464 00465 void DaveDlg::UpdateControls() 00466 { 00467 } 00468 00469