Ejemplo n.º 1
0
//
// Read Data from registry or file
//
void
TRecentFiles::Read()
{
  TAPointer<tchar> srcKeyBuffer(new tchar[80]);
  TAPointer<tchar> menuText(new tchar[MaxRegValueLen]);
  if(UseRegistry){
    TRegKey regKey(TRegKey::GetCurrentUser(), MruName.c_str());
    uint32 size = sizeof(uint32);
    if(regKey.QueryValue((tchar*)CountKey, 0, (uint8*)&MruCount, &size) != ERROR_SUCCESS)
      return;
    if (MruCount > MaxFilesToSave)
      MruCount = MaxFilesToSave;
    for (int i = 0; i < MruCount; i++){
      wsprintf(srcKeyBuffer, _T("%s%d"), MruPrefix, i);
      uint32 size = MaxRegValueLen;
      if(regKey.QueryValue((tchar*)srcKeyBuffer, 0, (uint8*)(tchar*)menuText, &size) != ERROR_SUCCESS)
        break;
      MruNames[i] = (tchar*)menuText;
    }
  }
  else{
    TProfile profile(Section, MruName.c_str());
    MruCount = profile.GetInt(CountKey, 0);
    if (MruCount > MaxFilesToSave)
      MruCount = MaxFilesToSave;
    for (int i = 0; i < MruCount; i++){
      wsprintf(srcKeyBuffer, _T("%s%d"), MruPrefix, i);
      profile.GetString(srcKeyBuffer, menuText, MaxMenuItemLen, MenuItemDefault);
      MruNames[i] = (tchar*)menuText;
    }
  }
}
void
CBNewProjectSaveFileDialog::BuildTemplateMenu
	(
	const JCharacter* templateFile
	)
{
	itsTemplateIndex = kNoTemplateCmd;

	itsTemplateMenu->SetMenuItems(kTemplateMenuStr);
	itsTemplateMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsTemplateMenu);

	JPtrArray<JString> menuText(JPtrArrayT::kDeleteAll);
	menuText.SetCompareFunction(JCompareStringsCaseInsensitive);
	menuText.SetSortOrder(JOrderedSetT::kSortAscending);

	JString sysDir, userDir;
	if (JXGetProgramDataDirectories(CBProjectDocument::GetTemplateDirectoryName(),
									&sysDir, &userDir))
		{
		JString* menuTextStr = NULL;
		BuildTemplateMenuItems(sysDir,  kJFalse, &menuText, templateFile, &menuTextStr);
		BuildTemplateMenuItems(userDir, kJTrue,  &menuText, templateFile, &menuTextStr);

		const JSize count = menuText.GetElementCount();
		JString itemText, nmShortcut;
		for (JIndex i=1; i<=count; i++)
			{
			// We have to extract user/sys here because otherwise we would
			// have to keep extra state while building the sorted list.

			itemText = *(menuText.NthElement(i));

			JIndex j;
			const JBoolean found = itemText.LocateLastSubstring(" (", &j);
			assert( found );

			const JIndexRange r(j, itemText.GetLength());
			nmShortcut = itemText.GetSubstring(r);
			itemText.RemoveSubstring(r);

			itsTemplateMenu->AppendItem(itemText, JXMenu::kRadioType);
			itsTemplateMenu->SetItemNMShortcut(itsTemplateMenu->GetItemCount(), nmShortcut);

			// mark item corresponding to initial template selection

			if (menuText.NthElement(i) == menuTextStr)
				{
				itsTemplateIndex = itsTemplateMenu->GetItemCount();
				}
			}
		}

	// after selecting initial template

	itsTemplateMenu->SetToPopupChoice(kJTrue, itsTemplateIndex);
	UpdateMakefileMethod();
}
Ejemplo n.º 3
0
    void StartingMenuScreen::menuItems(nk_context* ctx)
    {
        nk_layout_space_begin(ctx, NK_STATIC, 48, INT_MAX);
        {
            nk_layout_space_push(ctx, {125, 0, 390, 154});
            {
                auto frame = mSmLogo->getCurrentFrame();
                nk_image(ctx, frame.first->getNkImage(frame.second));
            }

            if (drawMenuItems(ctx) == ActionResult::stopDrawing)
                return;
            nk_layout_space_push(ctx, {17, 442, 605, 21});
            menuText(ctx, "Freeablo", MenuFontColor::silver, 16, NK_TEXT_ALIGN_LEFT);
        }
        nk_layout_space_end(ctx);
    }
Ejemplo n.º 4
0
    StartingMenuScreen::StartingMenuScreen(MenuHandler& menu) : Parent(menu)
    {
        auto renderer = FARender::Renderer::get();
        mFocus42.reset(new FARender::AnimationPlayer());
        mFocus42->playAnimation(renderer->loadImage("ui_art/focus42.pcx&trans=0,255,0&vanim=42"),
                                FAWorld::World::getTicksInPeriod("0.06"),
                                FARender::AnimationPlayer::AnimationType::Looped);
        mSmLogo = menu.createSmLogo();

        auto drawItem = [&](const char* text, const struct nk_rect& rect) {
            return [=](nk_context* ctx, bool isActive) {
                nk_layout_space_push(ctx, rect);
                menuText(ctx, text, MenuFontColor::gold, 42, NK_TEXT_ALIGN_CENTERED);
                auto ret = DrawFunctionResult::noAction;
                if (nk_widget_is_mouse_click_down_inactive(ctx, NK_BUTTON_LEFT))
                {
                    ret = DrawFunctionResult::executeAction;
                }
                if (isActive)
                {
                    auto frame = mFocus42->getCurrentFrame();
                    auto frameRect = nk_rect(0, 0, frame.first->getWidth(), frame.first->getHeight());
                    nk_layout_space_push(ctx, alignRect(frameRect, rect, halign_t::left, valign_t::center));
                    nk_image(ctx, frame.first->getNkImage(frame.second));
                    nk_layout_space_push(ctx, alignRect(frameRect, rect, halign_t::right, valign_t::center));
                    nk_image(ctx, frame.first->getNkImage(frame.second));
                }
                return ret;
            };
        };
        mMenuItems.push_back({drawItem("Single Player", {65, 192, 510, 42}), [this]() {
                                  mMenuHandler.setActiveScreen<SelectHeroMenuScreen>();
                                  return ActionResult::stopDrawing;
                              }});
        mMenuItems.push_back({drawItem("Multi Player", {65, 235, 510, 42}), []() { return ActionResult::continueDrawing; }});
        mMenuItems.push_back({drawItem("Replay Intro", {65, 277, 510, 42}), []() { return ActionResult::continueDrawing; }});
        mMenuItems.push_back({drawItem("Show Credits", {65, 320, 510, 42}), []() { return ActionResult::continueDrawing; }});
        mRejectAction = [this]() {
            mMenuHandler.engine().stop();
            return ActionResult::stopDrawing;
        };
        mMenuItems.push_back({drawItem("Exit Diablo", {65, 363, 510, 42}), mRejectAction});
    }
Ejemplo n.º 5
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Enable &Logging...", "debug action")), gMS->shortcut(UIMachineShortcuts::LoggingShortcut)));
 }
Ejemplo n.º 6
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Command Line...", "debug action")), gMS->shortcut(UIMachineShortcuts::CommandLineWindowShortcut)));
 }
Ejemplo n.º 7
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Ins&ert Ctrl-Alt-Backspace")), gMS->shortcut(UIMachineShortcuts::TypeCABSShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Send the Ctrl-Alt-Backspace sequence to the virtual machine"));
 }
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "C&heck for Updates...")), gMS->shortcut(UIMachineShortcuts::UpdateShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Check for a new VirtualBox version"));
 }
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Reset All Warnings")), gMS->shortcut(UIMachineShortcuts::ResetWarningsShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Go back to showing all suppressed warnings and messages"));
 }
Ejemplo n.º 10
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "ACPI Sh&utdown")), gMS->shortcut(UIMachineShortcuts::ShutdownShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Send the ACPI Power Button press event to the virtual machine"));
 }
Ejemplo n.º 11
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Network Adapters...")), gMS->shortcut(UIMachineShortcuts::NetworkAdaptersDialogShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Change the settings of network adapters"));
 }
Ejemplo n.º 12
0
 void retranslateUi()
 {
     menu()->setTitle(menuText(QApplication::translate("UIActionPool", "&USB Devices")));
 }
Ejemplo n.º 13
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Adjust Window Size")), gMS->shortcut(UIMachineShortcuts::WindowAdjustShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Adjust window size and position to best fit the guest display"));
 }
Ejemplo n.º 14
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Auto-resize &Guest Display")), gMS->shortcut(UIMachineShortcuts::GuestAutoresizeShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Automatically resize the guest display when the window is resized (requires Guest Additions)"));
 }
Ejemplo n.º 15
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Switch to &Scale Mode")), gMS->shortcut(UIMachineShortcuts::ScaleModeShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Switch between normal and scale mode"));
 }
Ejemplo n.º 16
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Switch to Seam&less Mode")), gMS->shortcut(UIMachineShortcuts::SeamlessModeShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Switch between normal and seamless desktop integration mode"));
 }
Ejemplo n.º 17
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Close...")), gMS->shortcut(UIMachineShortcuts::CloseShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Close the virtual machine"));
 }
Ejemplo n.º 18
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Take Sn&apshot...")), gMS->shortcut(UIMachineShortcuts::TakeSnapshotShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Take a snapshot of the virtual machine"));
 }
int Q3Action::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: activated(); break;
        case 1: toggled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 2: activate(); break;
        case 3: toggle(); break;
        case 4: setOn((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 5: setEnabled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 6: setDisabled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 7: setVisible((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 8: internalActivation(); break;
        case 9: toolButtonToggled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 10: objectDestroyed(); break;
        case 11: menuStatusText((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 12: showStatusText((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 13: clearStatusText(); break;
        }
        _id -= 14;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = isToggleAction(); break;
        case 1: *reinterpret_cast< bool*>(_v) = isOn(); break;
        case 2: *reinterpret_cast< bool*>(_v) = isEnabled(); break;
        case 3: *reinterpret_cast< QIcon*>(_v) = iconSet(); break;
        case 4: *reinterpret_cast< QString*>(_v) = text(); break;
        case 5: *reinterpret_cast< QString*>(_v) = menuText(); break;
        case 6: *reinterpret_cast< QString*>(_v) = toolTip(); break;
        case 7: *reinterpret_cast< QString*>(_v) = statusTip(); break;
        case 8: *reinterpret_cast< QString*>(_v) = whatsThis(); break;
        case 9: *reinterpret_cast< QKeySequence*>(_v) = accel(); break;
        case 10: *reinterpret_cast< bool*>(_v) = isVisible(); break;
        }
        _id -= 11;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setToggleAction(*reinterpret_cast< bool*>(_v)); break;
        case 1: setOn(*reinterpret_cast< bool*>(_v)); break;
        case 2: setEnabled(*reinterpret_cast< bool*>(_v)); break;
        case 3: setIconSet(*reinterpret_cast< QIcon*>(_v)); break;
        case 4: setText(*reinterpret_cast< QString*>(_v)); break;
        case 5: setMenuText(*reinterpret_cast< QString*>(_v)); break;
        case 6: setToolTip(*reinterpret_cast< QString*>(_v)); break;
        case 7: setStatusTip(*reinterpret_cast< QString*>(_v)); break;
        case 8: setWhatsThis(*reinterpret_cast< QString*>(_v)); break;
        case 9: setAccel(*reinterpret_cast< QKeySequence*>(_v)); break;
        case 10: setVisible(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 11;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 11;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Ejemplo n.º 20
0
 void retranslateUi()
 {
     setText(menuText(QApplication::translate("UIActionPool", "&Contents...")));
     setStatusTip(QApplication::translate("UIActionPool", "Show help contents"));
 }
Ejemplo n.º 21
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Settings...")), gMS->shortcut(UIMachineShortcuts::SettingsDialogShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Manage the virtual machine settings"));
 }
Ejemplo n.º 22
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Pause")), gMS->shortcut(UIMachineShortcuts::PauseShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Suspend the execution of the virtual machine"));
 }
Ejemplo n.º 23
0
 void retranslateUi()
 {
     setText(menuText(QApplication::translate("UIActionPool", "&Help")));
 }
Ejemplo n.º 24
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Shared Folders...")), gMS->shortcut(UIMachineShortcuts::SharedFoldersDialogShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Create or modify shared folders"));
 }
Ejemplo n.º 25
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&VirtualBox Web Site...")), gMS->shortcut(UIMachineShortcuts::WebShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the VirtualBox product web site"));
 }
Ejemplo n.º 26
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "Enable R&emote Display")), gMS->shortcut(UIMachineShortcuts::VRDPServerShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Enable remote desktop (RDP) connections to this machine"));
 }
Ejemplo n.º 27
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Network Operations Manager...")), gMS->shortcut(UIMachineShortcuts::NetworkAccessManager)));
     setStatusTip(QApplication::translate("UIActionPool", "Show Network Operations Manager"));
 }
Ejemplo n.º 28
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Install Guest Additions...")), gMS->shortcut(UIMachineShortcuts::InstallGuestAdditionsShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Mount the Guest Additions installation image"));
 }
Ejemplo n.º 29
0
 void retranslateUi()
 {
     setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&About VirtualBox...")), gMS->shortcut(UIMachineShortcuts::AboutShortcut)));
     setStatusTip(QApplication::translate("UIActionPool", "Show a dialog with product information"));
 }
Ejemplo n.º 30
0
 void retranslateUi()
 {
     menu()->setTitle(menuText(QApplication::translate("UIActionPool", "De&bug")));
 }