[Igarden-commit] Garden/source/Preferences DocumentFormatPrefsPanel.cpp, NONE, 1.1.2.1 DocumentFor
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2006-12-03 01:58:48
|
Update of /cvsroot/igarden/Garden/source/Preferences In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv24248 Added Files: Tag: Release_branch_v1 DocumentFormatPrefsPanel.cpp DocumentFormatPrefsPanel.h Log Message: Initial checkin --- NEW FILE: DocumentFormatPrefsPanel.h --- //*********************************************************************************************** // // The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at // http://www.mozilla.org/MPL/ // // Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF // ANY KIND, either express or implied. See the License for the specific language governing rights and // limitations under the License. // // The Original Code is iGarden Pringing Prefs Panel. // // The Initial Developer of the Original Code is Redstart Software. // Portions created by Initial Developer are Copyright (C) 2004 Redstart Software. All Rights Reserved. // // Contributor(s): // Jeffrey Bedell(je...@re...) // #ifndef __DocumentFormatPrefsPanel #define __DocumentFormatPrefsPanel #include "PreferencesPanel.h" class DocumentFormatPrefsPanel : public PreferencesPanel { public: // methods DocumentFormatPrefsPanel(PersistentTags* prefs); virtual ~DocumentFormatPrefsPanel(); virtual void SetupControls(XGView* panelView, XGDialog* dialog); virtual char* GetPanelName(); virtual int GetPanelResourceID(); virtual long HandleControlClick(XGDialog* dialog, PreferencesWindow* win, long arg); virtual void ActivatePanel(XGDialog* dialog, XGView* panelView); virtual void DeactivatePanel(XGDialog* dialog, XGView* panelView); protected: private: }; #endif --- NEW FILE: DocumentFormatPrefsPanel.cpp --- //*********************************************************************************************** // // The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at // http://www.mozilla.org/MPL/ // // Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF // ANY KIND, either express or implied. See the License for the specific language governing rights and // limitations under the License. // // The Original Code is iGarden PrintingPrefsPanel. // // The Initial Developer of the Original Code is Redstart Software. // Portions created by Initial Developer are Copyright (C) 2004 Redstart Software. All Rights Reserved. // // Contributor(s): // Jeffrey Bedell(je...@re...) // #include "RedstartGarden.h" #include "DocumentFormatPrefsPanel.h" #include <XGRadioButton.h> #include "Preferences.h" #include "RGPanelSet.h" using namespace yaaf; const short item_CompoundDoc = 1; const short item_XMLDoc = 2; // --------------------------------------------------------------------------- /// PrintingPrefsPanel // DocumentFormatPrefsPanel::DocumentFormatPrefsPanel( PersistentTags* prefs ) : PreferencesPanel(prefs) { } // --------------------------------------------------------------------------- /// ~PrintingPrefsPanel // DocumentFormatPrefsPanel::~DocumentFormatPrefsPanel() { } // --------------------------------------------------------------------------- /// SetupControls // void DocumentFormatPrefsPanel::SetupControls( XGView* panelView, XGDialog* dialog ) { #pragma unused(panelView, dialog) } // --------------------------------------------------------------------------- /// GetPanelName // char* DocumentFormatPrefsPanel::GetPanelName() { return "Document Format"; } // --------------------------------------------------------------------------- /// GetPanelResourceID // int DocumentFormatPrefsPanel::GetPanelResourceID() { return 192; } // --------------------------------------------------------------------------- /// HandleControlClick // long DocumentFormatPrefsPanel::HandleControlClick( XGDialog* dialog, PreferencesWindow* win, long arg ) { #pragma unused(win) XGRadioButton *compound, *xml; PanelSet *set; XGView *current; long val; set = dynamic_cast<PanelSet*>(dialog->FindViewByID(32003)); AssertValidView(set); current = set->GetCurrentPanel(); switch(arg) { case item_CompoundDoc: case item_XMLDoc: compound = dynamic_cast<XGRadioButton*>(current->FindViewByID(item_CompoundDoc)); xml = dynamic_cast<XGRadioButton*>(current->FindViewByID(item_XMLDoc)); AssertValidView(compound); AssertValidView(xml); if(arg == item_CompoundDoc) { compound->SetValue(1); xml->SetValue(0); } else { xml->SetValue(1); compound->SetValue(0); } _prefs->SetBoolPref(kUseCompoundFileFormat, compound->GetValue()); return 0; break; } return -1; } // --------------------------------------------------------------------------- /// ActivatePanel // void DocumentFormatPrefsPanel::ActivatePanel( XGDialog* dialog, XGView* panelView ) { #pragma unused(dialog) XGRadioButton *compound, *xml; compound = dynamic_cast<XGRadioButton*>(panelView->FindViewByID(item_CompoundDoc)); xml = dynamic_cast<XGRadioButton*>(panelView->FindViewByID(item_XMLDoc)); AssertValidView(compound); AssertValidView(xml); if(_prefs->GetBoolPref(kUseCompoundFileFormat)) { compound->SetValue(1); xml->SetValue(0); } else { compound->SetValue(0); xml->SetValue(1); } } // --------------------------------------------------------------------------- /// DeactivatePanel // void DocumentFormatPrefsPanel::DeactivatePanel( XGDialog* dialog, XGView* panelView ) { #pragma unused(dialog, panelView) } |