From 79d15bbd1d67951dedc652d6384c9d653757d6aa Mon Sep 17 00:00:00 2001 From: fabiantheblind Date: Mon, 26 Sep 2011 15:38:30 +0200 Subject: [PATCH] last version of plugin --- .DS_Store | Bin 15364 -> 15364 bytes MPOLnchActionComponent.cpp | 91 ++++++++++++++++++++++++-- MPOLnchHelper.cpp | 130 +++++++++++++++++++++++++++++-------- MPOLnchHelper.h | 13 +++- 4 files changed, 202 insertions(+), 32 deletions(-) diff --git a/.DS_Store b/.DS_Store index a7480d67da337dc0a629ec47f10018bbdbdccd46..8692b8fc177ea2147d67048a7e66839279310a1d 100644 GIT binary patch delta 21 ccmZpvXsOt+O@M`gfq`-I2VwEe7X^&90aOJC6951J delta 16 XcmZpvXsOt+ODoAddItem(widget); + this->DoRestoreScripts(widget); break; } case kMPOLnchFCQueriesActionID: @@ -292,7 +305,7 @@ void MPOLnchActionComponent::ShowFC() /* DoAddItem */ -void MPOLnchActionComponent::DoAddItem(IPMUnknown *invokedWidget) +void MPOLnchActionComponent::DoRestoreScripts(IPMUnknown *invokedWidget) { // building the scripts @@ -303,6 +316,40 @@ void MPOLnchActionComponent::DoAddItem(IPMUnknown *invokedWidget) } +/* handleSetOptions + */ +void MPOLnchActionComponent::handleSetOptions() +{ + do + { + const int32 cCountOfOptions = 1; + K2Vector optionsVec(cCountOfOptions); + PMString assetPathTitle("Select a folder", PMString::kTranslateDuringCall); + assetPathTitle.SetTranslatable(kFalse); + SDKFolderChooser folderChooser; + folderChooser.SetTitle(assetPathTitle); + folderChooser.ShowDialog(); + if(!folderChooser.IsChosen()) + { + break; + } + + PMString folder = folderChooser.GetPath(); + if(folder.empty() == kTrue) + { + break; + } + optionsVec.push_back(folder); + if(folder.empty() == kFalse) + { + // this->processSetOptionsCommand(optionsVec); + this->handleRefresh(); + } + } while(kFalse); + +} + + /* DoRemoveItem */ @@ -342,6 +389,42 @@ void MPOLnchActionComponent::DoRemoveItem(IPMUnknown *invokedWidget) } +/* handleRefresh + */ +void MPOLnchActionComponent::handleRefresh() +{ + do + { + IControlView* treeWidget = MPOLnchHelper::GetWidgetOnPanel( + kMPOLnchPanelWidgetID, kMPOLnchListBoxWidgetID); + ASSERT(treeWidget); + if(!treeWidget) { + break; + } + + // InterfacePtr model(treeWidget, UseDefaultIID()); +// ASSERT(model); +// if(!model) { +// break; +// } +// PMString folderRootPath = PnlTrvUtils::GetFolderSelectedPath(); +// if(folderRootPath.empty()) { +// break; +// } +// model->Rebuild(folderRootPath); +// InterfacePtr +// iTreeViewMgr(treeWidget, UseDefaultIID()); +// ASSERT(iTreeViewMgr); +// if(!iTreeViewMgr){ +// break; +// } +// +// +// iTreeViewMgr->ClearTree(); +// iTreeViewMgr->ChangeRoot(kTrue); + + } while(kFalse); +} // End, MPOLnchActionComponent.cpp. diff --git a/MPOLnchHelper.cpp b/MPOLnchHelper.cpp index 2e1a191..b290e5a 100644 --- a/MPOLnchHelper.cpp +++ b/MPOLnchHelper.cpp @@ -14,7 +14,7 @@ MPOLnchHelper::MPOLnchHelper(){ } int MPOLnchHelper::MAXITEMS = 13; int MPOLnchHelper::METAMAXITEMS = 3; -int MPOLnchHelper::FCGREPMAXITEMS = 19; +int MPOLnchHelper::FCGREPMAXITEMS = 68; int MPOLnchHelper::FCOBJECTMAXITEMS = 1; int MPOLnchHelper::FCTEXTMAXITEMS = 1; int MPOLnchHelper::MISCMAXITEMS = 5; @@ -138,32 +138,81 @@ PMString MPOLnchHelper::GetObjectFCFile(int i){ PMString MPOLnchHelper::GetGrepFCFile(int i){ - PMString theFileName[19] = { - - "__JMRaute 2 Raute whitespace.xml", - "JM__ANAB_01.xml", - "JM__ANAB_02.xml", - "JM__APOSTROPH.xml", - "JM__BISSTRICH.xml", - "JM__EURO_hin.xml", - "JM__EURO_zurueck.xml", - "JM__INTERPUNKTION.xml", - "JM__KOMMABLANK.xml", - "JM__LEERZEICHEN_DOPPELTE.xml", - "JM__MALZEICHEN.xml", - "JM__PREISSTRICH.xml", - "JM__PUNKTBLANK.xml", - "JM__ZOLL_HIN.xml", - "JM__ZOLL_ZURUECK.xml", - "JM__ZOLLZEICHEN.xml", - "JM_MIDI.xml", - "JM_Plug-in.xml", - "mySpecsFinder.xml"}; - - - - if (i > 19) { - i = 19; + PMString theFileName[68] = { + + "JM_NEU_SAVE_0_d_blank_zoll.xml", + "JM_NEU_SAVE_0a_Anfuehrungen_I_hin.xml", + "JM_NEU_SAVE_0b_Anfuehrungen_II_hin.xml", + "JM_NEU_SAVE_0c_ABFUEHRUNGEN.xml", + "JM_NEU_SAVE_0d_AN_AB_ersetzen.xml", + "JM_NEU_SAVE_0e_ABFUEHRUNGEN.xml", + "JM_NEU_SAVE_0f_AN_AB_ersetzen.xml", + "JM_NEU_SAVE_0g_AN_AB_ersetzen.xml", + "JM_NEU_SAVE_0h_Anab_in_Anab.xml", + "JM_NEU_SAVE_1e_Zoll.xml", + "JM_NEU_SAVE_2_aufzaehlungen.xml", + "JM_NEU_SAVE_2b_ellipse.xml", + "JM_NEU_SAVE_3a_blank_ellipse.xml", + "JM_NEU_SAVE_3b_ellipse_blank.xml", + "JM_NEU_SAVE_4a_blank_mm.xml", + "JM_NEU_SAVE_4b_blank_cm.xml", + "JM_NEU_SAVE_4d_blank_interpunktion.xml", + "JM_NEU_SAVE_4e_komma_blank.xml", + "JM_NEU_SAVE_4f_punkt_blank.xml", + "JM_NEU_SAVE_4g_blank_ausrufezeichen.xml", + "JM_NEU_SAVE_4h_blank_doppelpunkt.xml", + "JM_NEU_SAVE_4i_blank_semikolon.xml", + "JM_NEU_SAVE_4j_klammern_blank.xml", + "JM_NEU_SAVE_4k_klammern_punct.xml", + "JM_NEU_SAVE_4l_klammern_umbruch.xml", + "JM_NEU_SAVE_4m_slash_blanks.xml", + "JM_NEU_SAVE_5a_zoll_blank.xml", + "JM_NEU_SAVE_5b_malzeichen_I_nach_zoll.xml", + "JM_NEU_SAVE_5c_malzeichen_breite_hoehe_tiefe.xml", + "JM_NEU_SAVE_5c1_malzeichen_breite_hoehe_tiefe_in_zahlen.xml", + "JM_NEU_SAVE_5d_malzeichen_dxddzoll.xml", + "JM_NEU_SAVE_5e_malzeichen_sdx.xml", + "JM_NEU_SAVE_5f_malzeichen_sdx.xml", + "JM_NEU_SAVE_6_Gedankenstrich.xml", + "JM_NEU_SAVE_7_kHz.xml", + "JM_NEU_SAVE_8a_X_teilig.xml", + "JM_NEU_SAVE_8b_X_fach.xml", + "JM_NEU_SAVE_9a_z_B.xml", + "JM_NEU_SAVE_9b_aaO.xml", + "JM_NEU_SAVE_9c_dh.xml", + "JM_NEU_SAVE_9d_mE.xml", + "JM_NEU_SAVE_9e_oae.xml", + "JM_NEU_SAVE_9f_so.xml", + "JM_NEU_SAVE_9g_su.xml", + "JM_NEU_SAVE_9h_ua.xml", + "JM_NEU_SAVE_9i_uU.xml", + "JM_NEU_SAVE_9j_va.xml", + "JM_NEU_SAVE_9k_zH.xml", + "JM_NEU_SAVE_9l_zT.xml", + "JM_NEU_SAVE_10a_seitenzahl.xml", + "JM_NEU_SAVE_10b_seitenzahl_1_24stel.xml", + "JM_NEU_SAVE_13_Apostroph.xml", + "JM_NEU_SAVE_14c_Preisstrich.xml", + "JM_NEU_SAVE_15a_Plugin.xml", + "JM_NEU_SAVE_15b_Midi.xml", + "JM_NEU_SAVE_15c_specs.xml", + "JM_NEU_SAVE_15d_Features.xml", + "JM_NEU_SAVE_16_Bisstrich_Ziffern.xml", + "JM_NEU_SAVE_17a_Beschreibung_Marke.xml", + "JM_NEU_SAVE_17a1_Beschreibung_Marke.xml", + "JM_NEU_SAVE_17b_aufzaehlung_ranziehen.xml", + "JM_NEU_SAVE_17c_textflussende_ranziehen.xml", + "JM_NEU_SAVE_18_doubleblanks.xml", + "JM_NEU_SAVE_19a_Euro_hin.xml", + "JM_NEU_SAVE_19b_Euro_zurueck.xml", + "JM_NEU_SAVE_20a_gfL.xml", + "JM_NEU_SAVE_20b_gfL.xml", + "JM_FUSS_FIXER.xml"}; + + + + if (i > 68) { + i = 68; } return theFileName[i]; } @@ -483,3 +532,30 @@ void MPOLnchHelper::RestoreMPOLnchScrpts(){ CAlert::InformationAlert("Copied the missing files"); } + +/* GetWidgetOnPanel + */ +IControlView* MPOLnchHelper::GetWidgetOnPanel( + const WidgetID& panelWidgetID, const WidgetID& widgetID) +{ + IControlView* controlView=nil; + do + { + InterfacePtr + panelData(Utils()->QueryPanelByWidgetID(panelWidgetID)); + // Don't assert, fail silently, the tree view panel may be closed. + if(panelData == nil) + { + break; + } + controlView = panelData->FindWidget(widgetID); + ASSERT(controlView); + if(controlView == nil) + { + break; + } + } while(0); + + return controlView; +} + diff --git a/MPOLnchHelper.h b/MPOLnchHelper.h index 87d2c05..5e2b228 100644 --- a/MPOLnchHelper.h +++ b/MPOLnchHelper.h @@ -14,7 +14,10 @@ #include "FileUtils.h" #include "CAlert.h" #include "StreamUtil.h" - +#include "ITreeViewController.h" +#include "IPanelControlData.h" +#include "Utils.h" +#include "IPalettePanelUtils.h" class MPOLnchHelper @@ -53,6 +56,14 @@ class MPOLnchHelper PMString MissingScrptFileStr(PMString fn); // Error warning PMString MissingHelpFileStr(PMString fn); // Error warning + /** Get a widget from the specified panel by WidgetID, returning nil if it can't be found. + @param panelWidgetID [IN] specifies the parent widget + @param widgetID [IN] sought dependent widget + @return interface ptr to widget found or nil if it can't be found; not a reference incremented one though. + */ + static IControlView* GetWidgetOnPanel( + const WidgetID& panelWidgetID, const WidgetID& widgetID); + private: