#include <optspntr.h>
Inheritance diagram for PointersTab:
Public Member Functions | |
PointersTab () | |
PointersTab constructor. Creates a non-undoable operation. | |
~PointersTab () | |
PointersTab destructor. | |
virtual BOOL | Init () |
PointersTab initialisation routine. | |
virtual BOOL | HandleMsg (DialogMsg *Msg) |
Handles all the Edit options tabs messages. | |
virtual BOOL | InitSection () |
Sets initial values for the Pointers section of the options dialog box. This section includes the:-
| |
virtual BOOL | CommitSection () |
Takes the values in the Pointers section tab of the options dialog box and sets the associated preference values accordingly Called when ok is pressed on the dialog box. Middle button removed for now as nothing seems to use it. | |
virtual BOOL | GreySection () |
Called when the user has closed all documents. | |
virtual BOOL | UngreySection () |
Called when the user has selected a new document. | |
BOOL | ChangeControlStatus (const BOOL Status) |
Called to grey/ungrey all controls on this tab. | |
virtual BOOL | UpdateSection (String_256 *DocumentName) |
Called when we have switched to a new document and need to update all the controls on this tab. Should only init the tab if the page is present. The document name allows the info field on the tab to be filled in correctly. | |
virtual BOOL | NewUnitsInSection () |
Function called when new default units come into operation. We must convert all units fields to display in the newly specified units. | |
virtual CDlgResID | GetPageID () |
Allows the options dialog code to determine the dialog ID of this section. | |
virtual BOOL | IsDocumentOption () |
Allows the document options dialog code to determine if this tab belongs to the group of document options. | |
virtual BOOL | IsProgramOption () |
Allows the program options dialog code to determine if this tab belongs to the group of program options. | |
Protected Member Functions | |
BOOL | InitClickLists () |
Sets initial values for the click modifier lists in the Pointers section of the options dialog box. Middle button removed for now as nothing seems to use it. | |
BOOL | InitMagneticRadii () |
Sets initial values for the the magnetic radii fields in the Pointers section of the options dialog box. | |
Private Attributes | |
BOOL | GreyStatus |
Definition at line 125 of file optspntr.h.
|
PointersTab constructor. Creates a non-undoable operation.
Definition at line 140 of file optspntr.cpp.
|
|
PointersTab destructor.
Definition at line 161 of file optspntr.cpp.
|
|
Called to grey/ungrey all controls on this tab.
Definition at line 482 of file optspntr.cpp. 00483 { 00484 // Grey/ungrey the controls 00485 // pPrefsDlg->EnableGadget(_R(IDC_OPTS_INFO), Status); 00486 00487 // pPrefsDlg->EnableGadget(_R(IDC_OPTS_BUTTONGRP), Status); 00488 // pPrefsDlg->EnableGadget(_R(IDC_OPTS_LEFTBUTTON), Status); 00489 // pPrefsDlg->EnableGadget(_R(IDC_OPTS_MIDDLEBUTTON), Status); 00490 // pPrefsDlg->EnableGadget(_R(IDC_OPTS_RIGHTBUTTON), Status); 00491 // pPrefsDlg->EnableGadget(_R(IDC_OPTS_LEFTTXT), Status); 00492 // pPrefsDlg->EnableGadget(_R(IDC_OPTS_MIDDLETXT), Status); 00493 // pPrefsDlg->EnableGadget(_R(IDC_OPTS_RIGHTTXT), Status); 00494 // 00495 // pPrefsDlg->EnableGadget(_R(IDC_OPTS_RESET), Status); 00496 00497 pPrefsDlg->EnableGadget(_R(IDC_OPTS_MAGNETICGROUP), Status); 00498 pPrefsDlg->EnableGadget(_R(IDC_OPTS_POINTRADIUSTXT), Status); 00499 pPrefsDlg->EnableGadget(_R(IDC_OPTS_LINERADIUSTXT), Status); 00500 pPrefsDlg->EnableGadget(_R(IDC_OPTS_POINTRADIUS), Status); 00501 pPrefsDlg->EnableGadget(_R(IDC_OPTS_LINERADIUS), Status); 00502 00503 return TRUE; 00504 }
|
|
Takes the values in the Pointers section tab of the options dialog box and sets the associated preference values accordingly Called when ok is pressed on the dialog box. Middle button removed for now as nothing seems to use it.
Implements OptionsTabs. Definition at line 268 of file optspntr.cpp. 00269 { 00270 TRACEUSER( "Neville", _T("commit PointersTab section\n")); 00271 ERROR2IF(pPrefsDlg == NULL,FALSE,"PointersTab::CommitSection called with no dialog pointer"); 00272 00273 BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_POINTERS)); // The pointers page identifier 00274 if (!ok) 00275 return TRUE; // Talk to page failed to return now 00276 00277 // Section = Pointers 00278 00279 // Ok has been pressed so take the values from this section of the dialog box 00280 BOOL Valid=FALSE; // Flag for validity of value 00281 // BOOL State=FALSE; // Flag for state of button/switch 00282 BOOL SetOk=TRUE; // Preference value set ok 00283 00284 // Middle button removed for now as nothing seems to use it. 00285 00286 // 0, 1 or 2 indicating Left Middle or Right mouse button 00287 ButtonFunction LeftButton = (ButtonFunction)pPrefsDlg->GetSelectedValueIndex(_R(IDC_OPTS_LEFTBUTTON)); 00288 // ButtonFunction MiddleButton = (ButtonFunction)pPrefsDlg->GetSelectedValueIndex(_R(IDC_OPTS_MIDDLEBUTTON)); 00289 ButtonFunction RightButton = (ButtonFunction)pPrefsDlg->GetSelectedValueIndex(_R(IDC_OPTS_RIGHTBUTTON)); 00290 ClickModifiers::SetButtonFunc(0, LeftButton); 00291 // ClickModifiers::SetButtonFunc(1, MiddleButton); 00292 ClickModifiers::SetButtonFunc(2, RightButton); 00293 00294 // All units work off the selected document and so we must do nothing if there is no 00295 // selected document. Check our clas variable to see if this is true or not. 00296 // Units should have been set up by the caller. 00297 if (pDocument == NULL || pSpread == NULL) 00298 return (TRUE); 00299 00300 // Now the magnetic radii 00301 INT32 LineRadius = 0; 00302 INT32 PointRadius = 0; 00303 LineRadius = pPrefsDlg->GetUnitGadgetValue(_R(IDC_OPTS_LINERADIUS), CurrentPageUnits, 00304 0, INT_MAX, _R(IDE_OPTS_INVALIDLINERAD), &Valid); 00305 TRACEUSER( "Neville", _T("commit LineRadius distance='%d' Valid ='%d'\n"),LineRadius, Valid); 00306 if (Valid) 00307 { 00308 SetOk = Camelot.SetPrefValue(TEXT("Magnetic Options"), TEXT("Line Radius"), &LineRadius); 00309 ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_EDIT)); 00310 } 00311 else 00312 return FALSE; // Magnetic line radius incorrect, user has been warned already 00313 00314 PointRadius = pPrefsDlg->GetUnitGadgetValue(_R(IDC_OPTS_POINTRADIUS), CurrentPageUnits, 00315 0, INT_MAX, _R(IDE_OPTS_INVALIDPOINTRAD), &Valid); 00316 TRACEUSER( "Neville", _T("commit PointRadius distance='%d' Valid ='%d'\n"),PointRadius, Valid); 00317 if (Valid) 00318 { 00319 SetOk = Camelot.SetPrefValue(TEXT("Magnetic Options"), TEXT("Point Radius"), &PointRadius); 00320 ERROR2IF(!SetOk,2,_R(IDE_OPTS_SETPREF_EDIT)); 00321 } 00322 else 00323 return FALSE; // Magnetic point radius incorrect, user has been warned already 00324 00325 00326 return TRUE; 00327 }
|
|
Allows the options dialog code to determine the dialog ID of this section.
Implements OptionsTabs. Definition at line 202 of file optspntr.cpp. 00203 { 00204 return _R(IDD_OPTSTAB_POINTERS); 00205 }
|
|
Called when the user has closed all documents.
Reimplemented from OptionsTabs. Definition at line 410 of file optspntr.cpp. 00411 { 00412 TRACEUSER( "Neville", _T("GreySection in PointersTab section\n")); 00413 ERROR2IF(pPrefsDlg == NULL,FALSE,"PointersTab::GreySection called with no dialog pointer"); 00414 00415 BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_POINTERS)); // The PointersTab identifier 00416 if (!ok) 00417 return TRUE; // Talk to page failed to return now 00418 00419 // Only update if we are not already grey 00420 if (GreyStatus == TRUE) 00421 return TRUE; 00422 00423 // Call our central greying/ungreying function 00424 ok = ChangeControlStatus(FALSE); 00425 00426 GreyStatus = TRUE; 00427 00428 return ok; 00429 }
|
|
Handles all the Edit options tabs messages.
Implements OptionsTabs. Definition at line 559 of file optspntr.cpp. 00560 { 00561 TRACEUSER( "Neville", _T("PointersTab::HandleMsg\n")); 00562 ERROR2IF(Msg == NULL,FALSE,"PointersTab::Message null message received"); 00563 ERROR2IF(pPrefsDlg == NULL,FALSE,"PointersTab::HandleMsg called with no dialog pointer"); 00564 00565 BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_POINTERS)); // The edit page identifier 00566 if (!ok) 00567 return TRUE; // no page present = handled message 00568 00569 switch(Msg->DlgMsg) 00570 { 00571 case DIM_CREATE: // Initialise controls 00572 GreyStatus = FALSE; // we are ungreyed by default 00573 ok = InitSection(); 00574 if (!ok) 00575 InformError(); 00576 break; 00577 case DIM_LFT_BN_CLICKED: 00578 OptionsTabs::SetApplyNowState(TRUE); 00579 // A control on the dialog box has been clicked... 00580 if (Msg->GadgetID == _R(IDC_OPTS_RESET)) 00581 { 00582 // Somebody has pressed the reset defaults button 00583 // Go and call the nice function which resets the values and then 00584 // update our values again. 00585 ClickModifiers::RestoreDefaults(); 00586 InitClickLists(); 00587 } 00588 break; 00589 case DIM_SELECTION_CHANGED: 00590 case DIM_TEXT_CHANGED: 00591 OptionsTabs::SetApplyNowState(TRUE); 00592 break; 00593 default: 00594 break; 00595 } 00596 return TRUE; 00597 }
|
|
PointersTab initialisation routine.
Reimplemented from OptionsTabs. Definition at line 181 of file optspntr.cpp. 00182 { 00183 return TRUE; 00184 }
|
|
Sets initial values for the click modifier lists in the Pointers section of the options dialog box. Middle button removed for now as nothing seems to use it.
Definition at line 652 of file optspntr.cpp. 00653 { 00654 TRACEUSER( "Neville", _T("InitClickLists\n")); 00655 ERROR2IF(pPrefsDlg == NULL,FALSE,"PointersTab::InitClickLists called with no dialog pointer"); 00656 00657 BOOL ok = TRUE; // Flag for whether value set up ok 00658 00659 // Middle button removed for now as nothing seems to use it. 00660 00661 // Make sure that the lists are empty 00662 pPrefsDlg->DeleteAllValues(_R(IDC_OPTS_LEFTBUTTON)); 00663 // pPrefsDlg->DeleteAllValues(_R(IDC_OPTS_MIDDLEBUTTON)); 00664 pPrefsDlg->DeleteAllValues(_R(IDC_OPTS_RIGHTBUTTON)); 00665 00666 // 0, 1 or 2 indicating Left Middle or Right mouse button 00667 ButtonFunction LeftButton = ClickModifiers::GetButtonFunc(0); 00668 // ButtonFunction MiddleButton = ClickModifiers::GetButtonFunc(1); 00669 ButtonFunction RightButton = ClickModifiers::GetButtonFunc(2); 00670 00671 // Safety checks on the current button function values 00672 if (LeftButton < (ButtonFunction)0 || LeftButton >= BUTTFUNC_LAST) 00673 LeftButton = BUTTFUNC_NORMAL; 00674 // if (MiddleButton < (ButtonFunction)0 || MiddleButton >= BUTTFUNC_LAST) 00675 // MiddleButton = BUTTFUNC_ZOOMIN; 00676 if (RightButton < (ButtonFunction)0 || RightButton >= BUTTFUNC_LAST) 00677 RightButton = BUTTFUNC_MENU; 00678 00679 String_32 FunctionName; 00680 ButtonFunction bf = (ButtonFunction)0; // BUTTFUNC_NORMAL; 00681 for (INT32 i = (INT32)bf ; i < (INT32)BUTTFUNC_LAST; i++) 00682 { 00683 bf = (ButtonFunction)i; 00684 ClickModifiers::GetButtonFuncName(bf, &FunctionName); 00685 pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_LEFTBUTTON), FunctionName); 00686 // pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_MIDDLEBUTTON), FunctionName); 00687 pPrefsDlg->SetStringGadgetValue(_R(IDC_OPTS_RIGHTBUTTON), FunctionName); 00688 } 00689 // Set the length of the list 00690 pPrefsDlg->SetComboListLength(_R(IDC_OPTS_LEFTBUTTON)); 00691 // pPrefsDlg->SetComboListLength(_R(IDC_OPTS_MIDDLEBUTTON)); 00692 pPrefsDlg->SetComboListLength(_R(IDC_OPTS_RIGHTBUTTON)); 00693 00694 // Set up the default option displayed 00695 ok = pPrefsDlg->SetSelectedValueIndex(_R(IDC_OPTS_LEFTBUTTON), (INT32)LeftButton); 00696 // ok = pPrefsDlg->SetSelectedValueIndex(_R(IDC_OPTS_MIDDLEBUTTON), (INT32)MiddleButton); 00697 ok = pPrefsDlg->SetSelectedValueIndex(_R(IDC_OPTS_RIGHTBUTTON), (INT32)RightButton); 00698 00699 return TRUE; 00700 }
|
|
Sets initial values for the the magnetic radii fields in the Pointers section of the options dialog box.
Definition at line 718 of file optspntr.cpp. 00719 { 00720 TRACEUSER( "Neville", _T("InitMagneticRadii\n")); 00721 ERROR2IF(pPrefsDlg == NULL,FALSE,"PointersTab::InitMagneticRadii() called with no dialog pointer"); 00722 // All units work off the selected document and so we must do nothing if there is no 00723 // selected document. Check our clas variable to see if this is true or not. 00724 // Units should have been set up by the caller. 00725 if (pDocument == NULL || pSpread == NULL) 00726 { 00727 // If this fails then there is no document and so we must ensure 00728 // things which need a selected document are greyed. 00729 GreySection(); 00730 return (TRUE); 00731 } 00732 00733 // General flags 00734 BOOL ok = TRUE; 00735 BOOL ReadOk = TRUE; 00736 00737 // Now the magnetic radii 00738 // These should just be shown in distance measurements rather than scaled distance 00739 // measurements as they define distance on screen rather than on the page. 00740 INT32 LineRadius = 0; 00741 INT32 PointRadius = 0; 00742 ReadOk = Camelot.GetPrefValue(TEXT("Magnetic Options"), TEXT("Line Radius"), &LineRadius); 00743 ok = pPrefsDlg->SetUnitGadgetValue(_R(IDC_OPTS_LINERADIUS), CurrentPageUnits, LineRadius, FALSE, -1); 00744 ERROR2IF(!ReadOk,FALSE,_R(IDE_OPTS_READPREF_EDIT)); 00745 00746 ReadOk = Camelot.GetPrefValue(TEXT("Magnetic Options"), TEXT("Point Radius"), &PointRadius); 00747 ok = pPrefsDlg->SetUnitGadgetValue(_R(IDC_OPTS_POINTRADIUS), CurrentPageUnits, PointRadius, FALSE, -1); 00748 ERROR2IF(!ReadOk,FALSE,_R(IDE_OPTS_READPREF_EDIT)); 00749 00750 return TRUE; 00751 }
|
|
Sets initial values for the Pointers section of the options dialog box. This section includes the:-
Implements OptionsTabs. Definition at line 618 of file optspntr.cpp. 00619 { 00620 TRACEUSER( "Neville", _T("PointersTab::InitSection\n")); 00621 ERROR2IF(pPrefsDlg == NULL,FALSE,"PointersTab::InitSection called with no dialog pointer"); 00622 00623 // BOOL ReadOk = FALSE; // Flag to say whether the preference value was read ok 00624 BOOL ok = TRUE; // Flag for whether value set up ok 00625 00626 // Set up the click lists for the left, right and middle mouse buttons 00627 ok = InitClickLists(); 00628 00629 // Now set up the magnetic radii section 00630 ok = InitMagneticRadii(); 00631 00632 return TRUE; 00633 }
|
|
Allows the document options dialog code to determine if this tab belongs to the group of document options.
Implements OptionsTabs. Definition at line 223 of file optspntr.cpp. 00224 { 00225 return FALSE; // This tab is not a document option 00226 }
|
|
Allows the program options dialog code to determine if this tab belongs to the group of program options.
Implements OptionsTabs. Definition at line 244 of file optspntr.cpp. 00245 { 00246 return TRUE; // This tab is a program option 00247 }
|
|
Function called when new default units come into operation. We must convert all units fields to display in the newly specified units.
Reimplemented from OptionsTabs. Definition at line 345 of file optspntr.cpp. 00346 { 00347 TRACEUSER( "Neville", _T("New units in edit section\n")); 00348 ERROR2IF(pPrefsDlg == NULL,FALSE,"PointersTab::NewUnitsInSection called with no dialog pointer"); 00349 00350 BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_POINTERS)); // The edit page identifier 00351 if (!ok) 00352 return TRUE; // Talk to page failed to return now 00353 00354 // Set up the common variables 00355 // BOOL Valid=FALSE; // Flag for validity of value 00356 00357 // We will not error on any of the conversions as this might mean double errors 00358 // when say an apply is used but instead just ignore the conversion. This also means 00359 // not specifying an error message in the GetUnitGadgetValue calls. 00360 00361 // Call the normal code which inits the magnetic radii section 00362 InitMagneticRadii(); 00363 00364 return TRUE; 00365 }
|
|
Called when the user has selected a new document.
Reimplemented from OptionsTabs. Definition at line 446 of file optspntr.cpp. 00447 { 00448 TRACEUSER( "Neville", _T("UngreySection in PointersTab section\n")); 00449 ERROR2IF(pPrefsDlg == NULL,FALSE,"PointersTab::UngreySection called with no dialog pointer"); 00450 00451 BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_POINTERS)); // The PointersTab identifier 00452 if (!ok) 00453 return TRUE; // Talk to page failed to return now 00454 00455 // Only update if we are not already ungrey 00456 if (GreyStatus == FALSE) 00457 return TRUE; 00458 00459 // Call our central greying/ungreying function 00460 ok = ChangeControlStatus(TRUE); 00461 00462 GreyStatus = FALSE; 00463 00464 return ok; 00465 }
|
|
Called when we have switched to a new document and need to update all the controls on this tab. Should only init the tab if the page is present. The document name allows the info field on the tab to be filled in correctly.
Reimplemented from OptionsTabs. Definition at line 523 of file optspntr.cpp. 00524 { 00525 TRACEUSER( "Neville", _T("PointersTab::UpdateSection\n")); 00526 ERROR2IF(pPrefsDlg == NULL,FALSE,"PointersTab::UpdateSection called with no dialog pointer"); 00527 00528 BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_POINTERS)); // The PointersTab identifier 00529 if (!ok) 00530 return TRUE; // page not present 00531 00532 // Remove any lists that we have created. 00533 //pPrefsDlg->DeleteAllValues(_R(IDC_OPTS_SIZELIST)); 00534 00535 // Call the normal init section code 00536 // but only need to update the magnetic radii section so do this instead 00537 // Stops excesive updates of the pull down lists. 00538 InitMagneticRadii(); 00539 00540 return TRUE; 00541 }
|
|
Definition at line 165 of file optspntr.h. |