void FarPlugin::Config() { FarDialog & dlg = Dialogs()[L"SetupDialog"]; dlg.ResetControls(); dlg.LoadState(options); bool Repeat = true; while (Repeat) { Repeat = false; intptr_t res = dlg.Execute(); switch (res) { case 0: dlg.SaveState(options); SaveOptions(); Repeat = false; break; case 1: KeyConfig(); break; case 2: About(); break; case 3: SoundConfig(); break; } } }
void FarPlugin::About() { FarDialog & dlg = Dialogs()[L"AboutDialog"]; dlg.ResetControls(); dlg[L"Label2"](L"Text") = String(VersionStr(PLUGIN_MAJOR, PLUGIN_MINOR, PLUGIN_SUBMINOR, PLUGIN_BUILD)); dlg.Execute(); }
void FarPlugin::Config() { FarDialog& dlg = Dialogs()["SetupDialog"]; dlg.ResetControls(); dlg.LoadState(options); rep: int res = dlg.Execute(); switch(res) { case 0: dlg.SaveState(options); SaveOptions(); break; case 1: KeyConfig(); goto rep; case 2: About(); goto rep; case 3: static int bn = 0; beep(bn); if (++bn > 2) { bn = 0; } goto rep; } }
void FarPlugin::About() { FarDialog& dlg = Dialogs()["AboutDialog"]; dlg.ResetControls(); dlg["Label2"]("Text") = String(VersionStr(FARMANAGERVERSION_MAJOR, FARMANAGERVERSION_MINOR, PLUGIN_MAJOR, PLUGIN_BUILD)); dlg.Execute(); }
void FarPlugin::KeyConfig() { //int res = Info.MacroControl(&MainGuid, MCTL_SAVEALL, 0, NULL); // BindAll(); ShowMessage("", "Hotkeys binded", FMSG_MB_OK); return; #if 0 FarDialog& dlg = Dialogs()["KeysDialog"]; dlg.ResetControls(); bool bind = Binded("F5") && Binded("F6") && Binded("ShiftF5") && Binded("ShiftF6"); bool altShift = bind && Binded("AltShiftF5") && Binded("AltShiftF6"); bool ctrlShift = bind && Binded("CtrlShiftF5") && Binded("CtrlShiftF6"); bool ctrlAlt = bind && Binded("CtrlAltF5") && Binded("CtrlAltF6"); if(!altShift && !ctrlShift && !ctrlAlt) altShift = true; dlg["BindToF5"]("Selected") = bind; dlg["AltShiftF5"]("Selected") = altShift; dlg["CtrlShiftF5"]("Selected") = ctrlShift; dlg["CtrlAltF5"]("Selected") = ctrlAlt; if(dlg.Execute() == -1) return; if(dlg["BindToF5"]("Selected") == bind && dlg["AltShiftF5"]("Selected") == altShift && dlg["CtrlShiftF5"]("Selected") == ctrlShift && dlg["CtrlAltF5"]("Selected") == ctrlAlt) return; // MacroCommand(MCMD_SAVEALL); // XXX Unbind("KEY_F5"); Unbind("ShiftF5"); Unbind("KEY_F5"); Unbind("ShiftF6"); Unbind("AltShiftF5"); Unbind("AltShiftF6"); Unbind("CtrlShiftF5"); Unbind("CtrlShiftF6"); Unbind("CtrlAltF5"); Unbind("CtrlAltF6"); if(dlg["BindToF5"]("Selected")) { Bind("F5", "Plugin.Call(\"16990c75-cb7a-43df-8d7e-d6bf3683c3f1\", 0)", "", 0); Bind("F6", "Plugin.Call(\"16990c75-cb7a-43df-8d7e-d6bf3683c3f1\", 1)", "", 0); Bind("ShiftF5", "Plugin.Call(\"16990c75-cb7a-43df-8d7e-d6bf3683c3f1\", 0)", "", 0); Bind("ShiftF6", "Plugin.Call(\"16990c75-cb7a-43df-8d7e-d6bf3683c3f1\", 1)", "", 0); /* String key; if(dlg["AltShiftF5"]("Selected")) key = "AltShift"; else if(dlg["CtrlShiftF5"]("Selected")) key = "CtrlShift"; else if(dlg["CtrlAltF5"]("Selected")) key = "CtrlAlt"; Bind(key + "F5", "F5"); Bind(key + "F6", "F6"); */ } // MacroCommand(MCMD_LOADALL); // XXX #endif }
char* AreaEntry::TooltipName() const { TLKEntry* entry = Dialogs()->EntryAt(fEntry.tooltip_ref); if (entry == NULL) return NULL; std::cout << "tooltip: " << entry->string << std::endl; std::auto_ptr<TLKEntry> _(entry); return strdup(entry->string); }