Changeset 1344
- Timestamp:
- 01/10/08 15:31:35 (9 months ago)
- Location:
- trunk/src/buzelib
- Files:
-
- 3 modified
-
MachineView.cpp (modified) (2 diffs)
-
MainFrm.cpp (modified) (4 diffs)
-
MainFrm.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/buzelib/MachineView.cpp
r1343 r1344 896 896 897 897 menu.InsertMenu(-1, MF_BYPOSITION|MF_POPUP, (UINT_PTR)mixdownMenu.m_hMenu, "Render Output"); 898 899 pluginloader* loader=machine->loader;900 assert(loader);901 902 /* if (loader && loader->getHelpFile().length()>0) {903 // menu.InsertMenu(-1, MF_BYPOSITION|MF_SEPARATOR);904 menu.InsertMenu(-1, MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_MACHINE_HELP, "Help");905 }906 */907 CMenu patternMenu;908 patternMenu.CreatePopupMenu();909 910 898 // TODO: find a similar way to returning commands and subcommands 911 899 … … 948 936 menu.InsertMenu(-1, MF_BYPOSITION|MF_STRING, (UINT_PTR)(ID_MACHINECOMMANDS+i), cmdstr.c_str()); 949 937 } 938 } 939 940 if (singleSelect && mainFrame->getMachineHelpFile(machine->loader).length()>0) { 941 menu.InsertMenu(-1, MF_BYPOSITION|MF_SEPARATOR); 942 menu.InsertMenu(-1, MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_MACHINE_HELP, "Help"); 950 943 } 951 944 -
trunk/src/buzelib/MainFrm.cpp
r1343 r1344 968 968 969 969 document->updateAllViews(0, UpdateSelectedMachine, selectedMachine); 970 /* if (machineView.getViews() > 0)971 machineView.getView(0)->invalidateMachines();*/972 970 return 0; 973 971 } … … 978 976 } 979 977 978 std::string findHelpExtension(std::string basePath, std::string name) { 979 struct stat st; 980 std::string temp; 981 982 #define tryHelpFile(ext) temp = basePath + name + ext; if (stat(temp.c_str(), &st) == 0) return temp 983 tryHelpFile(".html"); 984 tryHelpFile(".htm"); 985 tryHelpFile(".txt"); 986 tryHelpFile(".mht"); 987 tryHelpFile(".rtf"); 988 return ""; 989 } 990 991 extern std::string hexencode(const std::string& input); 992 993 std::string CMainFrame::getMachineHelpFile(zzub::pluginloader* loader) { 994 std::string uri = loader->plugin_info->uri; 995 std::string pluginName = player->getBuzzName(uri); 996 std::string fileName; 997 if (pluginName == "") { 998 fileName = hexencode(uri); 999 pluginName = uri; 1000 } else 1001 fileName = pluginName; 1002 1003 std::string temp; 1004 1005 #define tryHelpDirectory(dir) temp = findHelpExtension(dir, fileName); if (temp != "") return temp 1006 1007 tryHelpDirectory("Gear\\Native\\"); 1008 tryHelpDirectory("Gear\\Effects\\"); 1009 tryHelpDirectory("Gear\\Generators\\"); 1010 return ""; 1011 } 1012 980 1013 LRESULT CMainFrame::OnMachineHelp(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { 981 return 0; 982 /* 983 metaplugin* machine=getSelectedMachine(0); 1014 metaplugin* machine = document->getSelectedMachine(0); 984 1015 if (!machine) return 0; 985 pluginloader* loader=player->getMachineLoader(machine->getLoaderName()); 986 if (!loader) return 0; 987 loader->selectPlugin(machine->pluginName); 988 const std::string& helpFile=loader->getHelpFile(); 989 990 MessageBox(helpFile.c_str(), "Help"); 991 return 0;*/ 1016 1017 std::string helpFile = getMachineHelpFile(machine->loader); 1018 if (helpFile.length() != 0) { 1019 int result = (int)ShellExecute(m_hWnd, "open", helpFile.c_str(), NULL, NULL, SW_SHOWNORMAL); 1020 if (result < 33) helpFile = ""; 1021 } 1022 if (helpFile.length() == 0) { 1023 MessageBox("Sorry, no help for this machine.", programName); 1024 } 1025 return 0; 992 1026 } 993 1027 … … 1042 1076 1043 1077 LRESULT CMainFrame::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { 1044 /* if (frame.m_hWnd) {1045 CFrameWindowImpl<CMainFrame>::OnSize(uMsg, wParam, lParam, bHandled);1046 frame.setDockSize(DockSplitTab::dockLEFT, 250);1047 frame.updateLayout();1048 }*/1049 1078 return 0; 1050 1079 } … … 1075 1104 document = 0; 1076 1105 1077 // DestroyWindow();1078 // defwindowproc calls destroywindow??1079 1106 return DefWindowProc(WM_CLOSE, wParam, lParam); 1080 1107 } -
trunk/src/buzelib/MainFrm.h
r1343 r1344 569 569 void mixdownSong(zzub::metaplugin* plugin, zzub::metaplugin* rec); 570 570 571 // audio driving572 573 //void configureAudioDriver();574 575 571 // parameter properties 576 572 void setMachineParameterHidden(zzub::metaplugin* loader, int group, int track, int column, bool state); … … 583 579 void setPatternToolbarVisibility(int nIndex, WORD wID, BOOL bVisible, BOOL bSave = TRUE, BOOL bUpdate = TRUE); 584 580 void setMainFrameToolbarVisibility(int nIndex, WORD wID, BOOL bVisible, BOOL bSave = TRUE, BOOL bUpdate = TRUE); 581 582 std::string getMachineHelpFile(zzub::pluginloader* loader); 583 585 584 }; 586 585
