Example #1
0
MainWindow::MainWindow()
{
    setWindowTitle("File System Statistics");
    createGUI();
}
void PlayState::enter ()
{
    
    createPlayers();

/*
  _root = Ogre::Root::getSingletonPtr();

  // Se recupera el gestor de escena y la cámara.
  _sceneMgr = _root->getSceneManager("SceneManager");
  _camera = _sceneMgr->getCamera("IntroCamera");
  _viewport = _root->getAutoCreatedWindow()->addViewport(_camera);
  // Nuevo background colour.
  _viewport->setBackgroundColour(Ogre::ColourValue(0.0, 0.0, 1.0));

  _exitGame = false;
*/

  _root = Ogre::Root::getSingletonPtr();
  _sceneMgr = _root->getSceneManager("SceneManager");
  _sceneMgr->setAmbientLight (Ogre::ColourValue (1, 1, 1));

  _camera = _sceneMgr->getCamera ("IntroCamera");
  //_viewport = _root->getAutoCreatedWindow()->getViewport(0);
  _viewport = _root->getAutoCreatedWindow()->addViewport(_camera);
  double width = _viewport->getActualWidth ();
  double height = _viewport->getActualHeight ();
  _camera->setAspectRatio (width / height);
  _viewport->setBackgroundColour (ColourValue (0.0, 0.0, 0.0));

  //Tiempo entre frame y frame
  _deltaT = 0;

   
  //Creamos la escena
  createScene ();
  //Gui
  createGUI ();
  createGUIDefensaHumano();
  
  _camera->setPosition (Vector3 (0,12,18));
  _camera->lookAt (_sceneMgr->getRootSceneNode()->getPosition());
  _camera->setNearClipDistance (0.1);
  _camera->setFarClipDistance (100);
  
  _raySceneQuery = _sceneMgr->createRayQuery(Ogre::Ray());
  _selectedNode = NULL;
  _animState = NULL;
  _nodoCursor = _sceneMgr->createSceneNode("nodoCursor");
  _sceneMgr->getRootSceneNode()->addChild(_nodoCursor);
  _flip = false;
  _colocandoBarco = false;
  _exitGame = false;
  _tSpeed = 10.0;                              //Distancia en unidades del mundo virtual que queremos recorrer en un segundo cuando movamos cositas
  _estado = inicio;
  _turnoEnCurso = true;
  _idJugador = 0;
  _wait = false;
  _enRacha = 1;
  _ganador = NULL;
  _volverMenu = false;
  
  //activaGUIGameOver();
}
Example #3
0
void KstApp::initActions() {

  fileNewWindow = new KAction(i18n("New &Window"), 0, 0,
                              this, SLOT(slotFileNewWindow()),
                              actionCollection(),"file_new_window");

  fileOpenNew = KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection());
  fileOpenNew->setWhatsThis(i18n("Open Kst plot file."));

  fileSave = KStdAction::save(   this, SLOT(slotFileSave()), actionCollection());
  fileSave->setWhatsThis(i18n("Save to current Kst plot file."));

  fileSaveAs = KStdAction::saveAs( this, SLOT(slotFileSaveAs()), actionCollection());
  fileSaveAs->setWhatsThis(i18n("Save to new Kst plot file."));

  fileClose = KStdAction::close(  this, SLOT(slotFileClose()), actionCollection());
  fileClose->setWhatsThis(i18n("Close Kst."));

  fileQuit = KStdAction::quit(   this, SLOT(slotFileClose()), actionCollection());
  fileQuit->setWhatsThis(i18n("Quit Kst."));

  fileKeyBindings = KStdAction::keyBindings(this, SLOT(slotConfigureKeys()), actionCollection());
  fileKeyBindings->setWhatsThis(i18n("Bring up a dialog box\n"
                                     "to configure shortcuts."));

  filePreferences = KStdAction::preferences(this, SLOT(slotPreferences()), actionCollection());
  filePreferences->setWhatsThis(i18n("Bring up a dialog box\n"
                                     "to configure Kst settings."));

  fileCopy = KStdAction::copy(this, SLOT(slotCopy()), actionCollection());
  fileCopy->setWhatsThis(i18n("Copy cursor position to the clipboard."));

  /************/
  filePrint = KStdAction::print(this, SLOT(slotFilePrint()),
                                actionCollection());
  filePrint->setToolTip(i18n("Print"));
  filePrint->setWhatsThis(i18n("Print current display"));

  /************/
  ToolBarAction = KStdAction::showToolbar(this, SLOT(slotViewToolBar()),
                                          actionCollection());
  ToolBarAction->setWhatsThis(i18n("Toggle Toolbar"));
  connect(ToolBarAction, SIGNAL(activated()), this, SLOT(setSettingsDirty()));

  /************/
  StatusBarAction = KStdAction::showStatusbar(this, SLOT(slotViewStatusBar()),
                                              actionCollection());
  StatusBarAction->setWhatsThis(i18n("Toggle Statusbar"));
  connect(StatusBarAction, SIGNAL(activated()), this, SLOT(setSettingsDirty()));

  /************/
  KStdAction::open(this, SLOT(slotFileOpen()), actionCollection());

  /************/
  recent = KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const KURL &)),
                           actionCollection());
  recent->setWhatsThis(i18n("Open a recently used Kst plot."));

  /************/
  PauseAction = new KToggleAction(i18n("P&ause"),"player_pause",0,
                                  actionCollection(), "pause_action");
  PauseAction->setToolTip(i18n("Pause"));
  PauseAction->setWhatsThis(i18n("When paused, new data will not be read."));

  /************/
  TiedZoomAction = new KAction(i18n("&Tied Zoom"),"kst_zoomtie",0,
                               view, SLOT(toggleTiedZoom()),
                               actionCollection(), "zoomtie_action");
  TiedZoomAction->setToolTip(i18n("Toggle tied zoom"));
  TiedZoomAction->setWhatsThis(i18n("Apply zoom actions to all plots\n"
                                     "(not just the active one)."));

  /************/
  XYZoomAction = new KRadioAction(i18n("XY Mouse &Zoom"), "kst_zoomxy",0,
                                  actionCollection(), "zoomxy_action");
  XYZoomAction->setExclusiveGroup("zoom");
  XYZoomAction->setToolTip(i18n("XY mouse zoom"));
  XYZoomAction->setWhatsThis(i18n("XY zoom: mouse zooming effects\n"
                                  "both X and Y axis"));
  XYZoomAction->setChecked(true);

  /************/
  XZoomAction = new KRadioAction(i18n("&X Mouse Zoom"), "kst_zoomx",0,
                                 actionCollection(), "zoomx_action");
  XZoomAction->setExclusiveGroup("zoom");
  XZoomAction->setToolTip(i18n("X mouse zoom"));
  XZoomAction->setWhatsThis(i18n("X zoom: Mouse zooming effects only the\n"
                                 "X axis (CTRL-mouse also does this)"));

  /************/
  YZoomAction = new KRadioAction(i18n("&Y Mouse Zoom"), "kst_zoomy",0,
                                  actionCollection(), "zoomy_action");
  YZoomAction->setExclusiveGroup("zoom");
  YZoomAction->setToolTip(i18n("Y mouse zoom"));
  YZoomAction->setWhatsThis(i18n("Y zoom: Mouse zooming effects only the\n"
                                 "Y axis (SHIFT-mouse also does this)"));

  /************/
  TextAction = new KRadioAction(i18n("&Label Editor"), "text",0,
                                  actionCollection(), "label_action");

  TextAction->setExclusiveGroup("zoom");
  TextAction->setToolTip(i18n("Label Editor"));
  TextAction->setWhatsThis(i18n("Use the mouse to create and edit labels."));

  /************/
  FilterDialogAction = new KAction(i18n("Edit &Filters"), 0, 0,
                                 this, SLOT(showFilterListEditor()),
                                 actionCollection(), "filterdialog_action");
  FilterDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                        "to edit filters."));

  /************/
  PlotDialogAction = new KAction(i18n("Edit &Plots"), "kst_editplots", 0,
                                 this, SLOT(showPlotDialog()),
                                 actionCollection(), "plotdialog_action");
  PlotDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                      "to edit plot settings."));

  /************/
  DataManagerAction = new KAction(i18n("&Data Manager"), "kst_datamanager", 0,
                                  dataManager, SLOT(show_I()),
                                  actionCollection(), "datamanager_action");
  DataManagerAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                       "to manage data."));

  /************/
  VectorDialogAction = new KAction(i18n("Edit &Vectors"), 0, 0,
                                 KstVectorDialogI::globalInstance(),
                                 SLOT(show_I()), actionCollection(),
                                 "vectordialog_action");
  VectorDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                        "to edit or create vectors."));

  /************/
  CurveDialogAction = new KAction(i18n("Edit &Curves"), 0, 0,
                                  KstCurveDialogI::globalInstance(),
                                  SLOT(show_I()), actionCollection(),
                                  "curvedialog_action");
  CurveDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                       "to edit or create curves."));

  /************/
  EqDialogAction = new KAction(i18n("Edit &Equations"), 0, 0,
                               KstEqDialogI::globalInstance(), SLOT(show_I()),
                               actionCollection(), "eqdialog_action");
  EqDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                    "to edit or create equations."));

  /************/
  HsDialogAction = new KAction(i18n("Edit &Histograms"), 0, 0,
                               KstHsDialogI::globalInstance(),
                               SLOT(show_I()), actionCollection(),
                               "hsdialog_action");
  HsDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                    "to edit or create histograms."));

  /************/
  PsdDialogAction = new KAction(i18n("Edit Power &Spectra"), 0, 0,
                                KstPsdDialogI::globalInstance(),
                                SLOT(show_I()), actionCollection(),
                                "psddialog_action");
  PsdDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                     "to edit or create power spectra."));

  /************/
  PluginDialogAction = new KAction(i18n("Edit &Plugins"), 0, 0,
                                   KstPluginDialogI::globalInstance(),
                                   SLOT(show_I()), actionCollection(),
                                   "plugindialog_action");
  PluginDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                        "to use plugins."));

  /************/
  ChangeFileDialogAction = new KAction(i18n("Change Data &File"),
                                       "kst_changefile", 0, this,
                                       SLOT(showChangeFileDialog()),
                                       actionCollection(),
                                       "changefiledialog_action");
  ChangeFileDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                            "to change input files."));

  /************/
  ViewScalarsDialogAction = new KAction(i18n("View &Scalars"),
                                       0, 0, this,
                                       SLOT(showViewScalarsDialog()),
                                       actionCollection(),
                                       "viewscalarsdialog_action");
  ViewScalarsDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                            "to view scalar values."));
  
  /************/
  ViewVectorsDialogAction = new KAction(i18n("View Vec&tors"),
                                       0, 0, this,
                                       SLOT(showViewVectorsDialog()),
                                       actionCollection(),
                                       "viewvectorsdialog_action");
  ViewVectorsDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                            "to view vector values."));
  
  /************/
  ChangeNptsDialogAction = new KAction(i18n("Change Data Sample &Ranges"),
                                       "kst_changenpts", 0, this,
                                       SLOT(showChangeNptsDialog()),
                                       actionCollection(),
                                       "changenptsdialog_action");
  ChangeNptsDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                            "to change data sample ranges."));

  /************/
  QuickCurvesDialogAction = new KAction(i18n("Quickly Create New Curve"),
                                       "kst_quickcurves", 0, this,
                                       SLOT(showQuickCurvesDialog()),
                                       actionCollection(),
                                       "quickcurvesdialog_action");
  QuickCurvesDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                           "to create a data curve\n"
                                           "and put it in a plot."));
  /************/
  QuickPSDDialogAction = new KAction(i18n("Quickly Create New PSD"),
                                     "kst_quickpsd", 0,
                                     this, SLOT(showQuickPSDDialog()),
                                     actionCollection(),
                                     "quickpsddialog_action");
  QuickPSDDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                          "to create a PSD\n"
                                          "and put it in a plot."));

  /************/
  EventMonitorAction = new KAction(i18n("Edit Event &Monitoring"),
                                     0, 0,
                                     KstEventMonitorI::globalInstance(), 
                                     SLOT(show_I()),
                                     actionCollection(),
                                     "eventmonitor_action");
  EventMonitorAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                          "to edit event monitoring."));
  
  /************/
  GraphFileDialogAction = new KAction(i18n("Export to Graphics File..."),
                                  "kst_graphfile", 0,
                                  this, SLOT(showGraphFileDialog()),
                                  actionCollection(),
                                  "graphfiledialog_action");
  GraphFileDialogAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                           "to export the plot as a\n"
                                           "graphics file."));

  /************/
  _vectorSaveAction = new KAction(i18n("Save Vectors to Disk..."),
                                  0, 0,
                                  vectorSaveDialog, SLOT(show()),
                                  actionCollection(),
                                  "vectorsavedialog_action");
  _vectorSaveAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                       "to save vectors to text files."));

  /************/
  SamplesDownAction = new KAction(i18n("&Back 1 Screen"),
                                  "kst_back",
                                  KAccel::stringToKey("Ctrl+Left"),
                                  this, SLOT(samplesDown()),
                                  actionCollection(),
                                  "samplesdown_action");
  //SamplesDownAction->setToolTip(i18n("Back"));
  SamplesDownAction->setWhatsThis(i18n("Reduce the starting frame by\n"
                                       "the current number of frames."));

  /************/
  SamplesUpAction = new KAction(i18n("&Advance 1 Screen"),
                                "kst_advance",
                                KAccel::stringToKey("Ctrl+Right"),
                                this, SLOT(samplesUp()),
                                actionCollection(),
                                "samplesup_action");

  //SamplesUpAction->setToolTip(i18n("Advance"));
  SamplesUpAction->setWhatsThis(i18n("Increase the starting frame by\n"
                                     "the current number of frames."));

  /************/
  SamplesFromEndAction = new KAction(i18n("Read From &End"),
                                     "1rightarrow",
                                     KAccel::stringToKey("Shift+Ctrl+Right"),
                                     this, SLOT(samplesEnd()),
                                     actionCollection(),
                                     "samplesend_action");
  SamplesFromEndAction->setToolTip(i18n("Read from end"));
  SamplesFromEndAction->setWhatsThis(i18n("Read current data from end of file."));

  /************/
  PluginManagerAction = new KAction(i18n("&Plugins..."), 0, 0,
                                 this, SLOT(showPluginManager()),
                                 actionCollection(), "pluginmanager_action");
  PluginManagerAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                           "to manage plugins."));


  /************/
  ExtensionManagerAction = new KAction(i18n("&Extensions..."), 0, 0,
                                 this, SLOT(showExtensionManager()),
                                 actionCollection(), "extensionmanager_action");
  ExtensionManagerAction->setWhatsThis(i18n("Bring up a dialog box\n"
                                           "to manage extensions."));


  /************/
  DataWizardAction = new KAction(i18n("Data &Wizard..."), "kst_datawizard", 0,
                                 this, SLOT(showDataWizard()),
                                 actionCollection(), "datawizard_action");
  DataWizardAction->setWhatsThis(i18n("Bring up a wizard\n"
                                           "to easily load data."));


  /************/
  DebugDialogAction = new KAction(i18n("Debug Kst..."), 0, 0,
                                 this, SLOT(showDebugDialog()),
                                 actionCollection(), "debug_action");
  DebugDialogAction->setWhatsThis(i18n("Bring up a dialog\n"
                                           "to display debugging information."));


  /************/
  DataMode = new KToggleAction(i18n("Data Mode"), "kst_datamode", 0,
                                 this, SLOT(toggleDataMode()),
                                 actionCollection(), "datamode_action");
  DataMode->setWhatsThis(i18n("Toggle between cursor mode and data mode."));

  /************/
  _reloadAction = new KAction(i18n("Reload"), "reload", Key_F5, this, SLOT(reload()),
                              actionCollection(), "reload");
  _reloadAction->setWhatsThis(i18n("Reload the data from file."));

  createGUI();
}
Example #4
0
 void GUI::activePartChanged(KParts::Part* p)
 {
     unplugActionList("activities_list");
     createGUI(p);
     plugActionList("activities_list", central->activitySwitchingActions());
 }
Example #5
0
void
KMixWindow::initActions()
{
  // file menu
  KStandardAction::quit(this, SLOT(quit()), actionCollection());

  // settings menu
  _actionShowMenubar = KStandardAction::showMenubar(this, SLOT(toggleMenuBar()),
      actionCollection());
  //actionCollection()->addAction( a->objectName(), a );
  KStandardAction::preferences(this, SLOT(showSettings()), actionCollection());
  KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()),
      actionCollection());
  KAction* action = actionCollection()->addAction("launch_kdesoundsetup");
  action->setText(i18n("Audio Setup"));
  connect(action, SIGNAL(triggered(bool)), SLOT(slotKdeAudioSetupExec()));

  action = actionCollection()->addAction("hwinfo");
  action->setText(i18n("Hardware &Information"));
  connect(action, SIGNAL(triggered(bool)), SLOT(slotHWInfo()));
  action = actionCollection()->addAction("hide_kmixwindow");
  action->setText(i18n("Hide Mixer Window"));
  connect(action, SIGNAL(triggered(bool)), SLOT(hideOrClose()));
  action->setShortcut(QKeySequence(Qt::Key_Escape));
  action = actionCollection()->addAction("toggle_channels_currentview");
  action->setText(i18n("Configure &Channels..."));
  connect(action, SIGNAL(triggered(bool)), SLOT(slotConfigureCurrentView()));
  action = actionCollection()->addAction("select_master");
  action->setText(i18n("Select Master Channel..."));
  connect(action, SIGNAL(triggered(bool)), SLOT(slotSelectMaster()));

  action = actionCollection()->addAction("save_1");
  action->setShortcut(KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_1));
  action->setText(i18n("Save volume profile 1"));
  connect(action, SIGNAL(triggered(bool)), SLOT(saveVolumes1()));

  action = actionCollection()->addAction("save_2");
  action->setShortcut(KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_2));
  action->setText(i18n("Save volume profile 2"));
  connect(action, SIGNAL(triggered(bool)), SLOT(saveVolumes2()));

  action = actionCollection()->addAction("save_3");
  action->setShortcut(KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_3));
  action->setText(i18n("Save volume profile 3"));
  connect(action, SIGNAL(triggered(bool)), SLOT(saveVolumes3()));

  action = actionCollection()->addAction("save_4");
  action->setShortcut(KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_4));
  action->setText(i18n("Save volume profile 4"));
  connect(action, SIGNAL(triggered(bool)), SLOT(saveVolumes4()));

  action = actionCollection()->addAction("load_1");
  action->setShortcut(KShortcut(Qt::CTRL + Qt::Key_1));
  action->setText(i18n("Load volume profile 1"));
  connect(action, SIGNAL(triggered(bool)), SLOT(loadVolumes1()));

  action = actionCollection()->addAction("load_2");
  action->setShortcut(KShortcut(Qt::CTRL + Qt::Key_2));
  action->setText(i18n("Load volume profile 2"));
  connect(action, SIGNAL(triggered(bool)), SLOT(loadVolumes2()));

  action = actionCollection()->addAction("load_3");
  action->setShortcut(KShortcut(Qt::CTRL + Qt::Key_3));
  action->setText(i18n("Load volume profile 3"));
  connect(action, SIGNAL(triggered(bool)), SLOT(loadVolumes3()));

  action = actionCollection()->addAction("load_4");
  action->setShortcut(KShortcut(Qt::CTRL + Qt::Key_4));
  action->setText(i18n("Load volume profile 4"));
  connect(action, SIGNAL(triggered(bool)), SLOT(loadVolumes4()));

  osdWidget = new OSDWidget();

  createGUI(QLatin1String("kmixui.rc"));
}
Example #6
0
//
//  FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
//  PURPOSE:  Processes messages for the main window.
//
//  WM_COMMAND	- process the application menu
//  WM_PAINT	- Paint the main window
//  WM_DESTROY	- post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    int wmId, wmEvent;
    POINT point;
    char buf[1024];

    if(message == g_iTaskbarCreated)	// for PCRaw (tray icon)
        loadIcons(hInst, hWnd);

    switch (message)
    {
    case WM_SHOWGUI:
        createGUI(hWnd);
        break;


    case WM_TRAYICON:
        switch((UINT)lParam)
        {
        case WM_LBUTTONDOWN:
            if (allowTrayMenu)
                SendMessage(hWnd,WM_SHOWMENU,2,0);
            SetForegroundWindow(hWnd);
            break;
        case WM_RBUTTONDOWN:
            if (allowTrayMenu)
                SendMessage(hWnd,WM_SHOWMENU,1,0);
            SetForegroundWindow(hWnd);
            break;
        case WM_LBUTTONDBLCLK:
            createGUI(hWnd);
            break;
        }
        break;

    case WM_COPYDATA:
    {
        COPYDATASTRUCT *pc = (COPYDATASTRUCT *)lParam;
        LOG_DEBUG("URL request: %s",pc->lpData);
        if (pc->dwData == WM_PLAYCHANNEL)
        {
            ChanInfo info;
            servMgr->procConnectArgs((char *)pc->lpData,info);
            chanMgr->findAndPlayChannel(info,false);
        }
        //sys->callLocalURL((const char *)pc->lpData,servMgr->serverHost.port);
    }
    break;
    case WM_GETPORTNUMBER:
    {
        int port;
        port=servMgr->serverHost.port;
        ReplyMessage(port);
    }
    break;

    case WM_SHOWMENU:
    {
        if (servMgr->saveGuiPos) {
            CheckMenuItem(trayMenu, ID_POPUP_SAVE_GUI_POS, MF_CHECKED|MF_BYCOMMAND);
        } else {
            CheckMenuItem(trayMenu, ID_POPUP_SAVE_GUI_POS, MF_UNCHECKED|MF_BYCOMMAND);
        }

        SetForegroundWindow(hWnd);
        bool skipMenu=false;

        allowTrayMenu = false;

        // check for notifications
        if (currNotify & ServMgr::NT_UPGRADE)
        {
            if (servMgr->downloadURL[0])
            {
                if ((sys->getTime()-seenNewVersionTime) > (60*60))	// notify every hour
                {
                    if (MessageBox(hWnd,"A newer version of PeerCast is available, press OK to upgrade.","PeerCast",MB_OKCANCEL|MB_APPLMODAL|MB_ICONEXCLAMATION) == IDOK)
                        sys->getURL(servMgr->downloadURL);

                    seenNewVersionTime=sys->getTime();
                    skipMenu=true;
                }
            }
        }


        if (!skipMenu)
        {
            RECT rcWnd;
            HMENU menu;
            UINT flg = 0;

            SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWnd, 0);
            GetCursorPos(&point);

            if (point.x < rcWnd.left) {
                point.x = rcWnd.left;
                flg |= TPM_LEFTALIGN;
            }
            if (point.x > rcWnd.right) {
                point.x = rcWnd.right;
                flg |= TPM_RIGHTALIGN;
            }
            if (point.y < rcWnd.top) {
                point.y = rcWnd.top;
                flg |= TPM_TOPALIGN;
            }
            if (point.y > rcWnd.bottom) {
                point.y = rcWnd.bottom;
                flg |= TPM_BOTTOMALIGN;
            }
            if (flg == 0) {
                flg = TPM_RIGHTALIGN;
            }

            switch (wParam)
            {
            case 1:
                menu = GetSubMenu(trayMenu,0);
                addAllChannelsMenu(GetSubMenu(menu,0));
                addRelayedChannelsMenu(GetSubMenu(menu,1));
                break;
            case 2:
                menu = GetSubMenu(ltrayMenu,0);
                addAllChannelsMenu(menu);
                break;
            }
            if (!TrackPopupMenu(menu,flg,point.x,point.y,0,hWnd,NULL))
            {
                LOG_ERROR("Can`t track popup menu: %d",GetLastError());
            }
            PostMessage(hWnd,WM_NULL,0,0);

        }
        allowTrayMenu = true;
    }
    break;

    case WM_CREATE:
        if (showGUI)
            createGUI(hWnd);
        break;

    case WM_COMMAND:
        wmId    = LOWORD(wParam);
        wmEvent = HIWORD(wParam);

        if ((wmId >= INFO_CMD) && (wmId < INFO_CMD+MAX_CHANNELS))
        {
            int c = wmId - INFO_CMD;
            chanInfo = getChannelInfo(c);
            chanInfoIsRelayed = false;
            if (winDistinctionNT)
                DialogBox(hInst, (LPCTSTR)IDD_CHANINFO, hWnd, (DLGPROC)ChanInfoProc);
            else
            {
                HWND WKDLG; //JP-Patch
                WKDLG = CreateDialog(hInst, (LPCTSTR)IDD_CHANINFO, hWnd, (DLGPROC)ChanInfoProc); //JP-Patch
                ShowWindow(WKDLG,SW_SHOWNORMAL); //JP-Patch
            }
            return 0;
        }
        if ((wmId >= URL_CMD) && (wmId < URL_CMD+MAX_CHANNELS))
        {
            int c = wmId - URL_CMD;
            chanInfo = getChannelInfo(c);
            if (chanInfo.url.isValidURL())
                sys->getURL(chanInfo.url);
            return 0;
        }
        if ((wmId >= PLAY_CMD) && (wmId < PLAY_CMD+MAX_CHANNELS))
        {
            int c = wmId - PLAY_CMD;
            chanInfo = getChannelInfo(c);
            chanMgr->findAndPlayChannel(chanInfo,false);
            return 0;
        }
        if ((wmId >= RELAY_CMD) && (wmId < RELAY_CMD+MAX_CHANNELS))
        {
            int c = wmId - RELAY_CMD;
            chanInfo = getChannelInfo(c);
            chanMgr->findAndPlayChannel(chanInfo,true);
            return 0;
        }

        // Parse the menu selections:
        switch (wmId)
        {
        case ID_POPUP_SHOWMESSAGES_PEERCAST:
            flipNotifyPopup(ID_POPUP_SHOWMESSAGES_PEERCAST,ServMgr::NT_PEERCAST);
            break;
        case ID_POPUP_SHOWMESSAGES_BROADCASTERS:
            flipNotifyPopup(ID_POPUP_SHOWMESSAGES_BROADCASTERS,ServMgr::NT_BROADCASTERS);
            break;
        case ID_POPUP_SHOWMESSAGES_TRACKINFO:
            flipNotifyPopup(ID_POPUP_SHOWMESSAGES_TRACKINFO,ServMgr::NT_TRACKINFO);
            break;

        case ID_POPUP_ABOUT:
        case IDM_ABOUT:
            DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
            break;
        case ID_POPUP_SHOWGUI:
        case IDM_SETTINGS_GUI:
        case ID_POPUP_ADVANCED_SHOWGUI:
        {
            createGUI(hWnd);
            break;
        }
        case ID_POPUP_YELLOWPAGES:
            sys->getURL("http://yp.peercast.org/");
            break;
        case ID_POPUP_YELLOWPAGES1:
            sprintf(buf, "http://%s",servMgr->rootHost.cstr());
            sys->getURL(buf);
            break;
        case ID_POPUP_YELLOWPAGES2:
            sprintf(buf, "http://%s",servMgr->rootHost2.cstr());
            sys->getURL(buf);
            break;

        case ID_POPUP_ADVANCED_VIEWLOG:
            showHTML("viewlog.html");
            break;
        case ID_POPUP_ADVANCED_SAVESETTINGS:
            servMgr->saveSettings(iniFileName.cstr());
            break;
        case ID_POPUP_ADVANCED_INFORMATION:
            showHTML("index.html");
            break;
        case ID_FIND_CHANNELS:
        case ID_POPUP_ADVANCED_ALLCHANNELS:
        case ID_POPUP_UPGRADE:
            sys->callLocalURL("admin?cmd=upgrade",servMgr->serverHost.port);
            break;
        case ID_POPUP_ADVANCED_RELAYEDCHANNELS:
        case ID_POPUP_FAVORITES_EDIT:
            showHTML("relays.html");
            break;
        case ID_POPUP_ADVANCED_BROADCAST:
            showHTML("broadcast.html");
            break;
        case ID_POPUP_SETTINGS:
            showHTML("settings.html");
            break;
        case ID_POPUP_CONNECTIONS:
            showHTML("connections.html");
            break;
        case ID_POPUP_HELP:
            sys->getURL("http://www.peercast.org/help.php");
            break;

        case ID_POPUP_SAVE_GUI_POS:
            if (servMgr->saveGuiPos) {
                servMgr->saveGuiPos = false;
                CheckMenuItem(trayMenu, ID_POPUP_SAVE_GUI_POS, MF_UNCHECKED|MF_BYCOMMAND);
            } else {
                servMgr->saveGuiPos = true;
                CheckMenuItem(trayMenu, ID_POPUP_SAVE_GUI_POS, MF_CHECKED|MF_BYCOMMAND);
            }
            peercastInst->saveSettings();
            break;

        case ID_POPUP_KEEP_DOWNSTREAMS:
            if (servMgr->keepDownstreams) {
                servMgr->keepDownstreams = false;
                CheckMenuItem(trayMenu, ID_POPUP_KEEP_DOWNSTREAMS, MF_UNCHECKED|MF_BYCOMMAND);
            } else {
                servMgr->keepDownstreams = true;
                CheckMenuItem(trayMenu, ID_POPUP_KEEP_DOWNSTREAMS, MF_CHECKED|MF_BYCOMMAND);
            }
            //peercastInst->saveSettings();
            break;

        case ID_POPUP_EXIT_CONFIRM:
        case IDM_EXIT:
            DestroyWindow(hWnd);
            break;
        default:
            return DefWindowProc(hWnd, message, wParam, lParam);
        }
        break;
    case WM_DESTROY:
        PostQuitMessage(0);
        break;
    default:
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    return 0;
}
Conductance::Conductance(void)
    : DefaultGUIModel("IHCs model ICs",::vars,::num_vars) {
    createGUI(vars, num_vars);
    /*
     * Initialize Parameters
     */
    c0 = 0.335;
    pER = 0.0003;
    cER = 500.0;
    gKCa = 3.0;
    gCaL = 2.4;
    nuER = 1.2;
    nuMP = 3.6;
    kmKCa = 1.25;
    ksl = 0.6;
    gKDR = 2.85;
    tauSDR = 0.55;
    gLeak = 0.12;
    eLeak = -20.0;
    f = 0.01;
    eCa = 60.0;
    eK = -60.0;
    rLeakMC = 0.5181;
    //
    iAppOffset = 0.0;
    rate = 1e4;    

    /*
     * Initialize Variables
     */
    c = c0;
    nDR = nDRInf(v);
    sDR = sDRInf(v);
    period = RT::System::getInstance()->getPeriod()*1e-9;
    steps = static_cast<int>(ceil(period*rate));

    /*         
     * Initialize States
     */
    setState("c",c);
    setState("nDR",nDR);
    setState("sDR",sDR);

    /*
     * Initialize GUI
     */
    setParameter("c0", c0);
    setParameter("pER", pER);
    setParameter("cER", cER);
    setParameter("gKCa", gKCa);
    setParameter("gCaL", gCaL);
    setParameter("nuER", nuER);
    setParameter("nuMP", nuMP);
    setParameter("kmKCa", kmKCa);
    setParameter("ksl", ksl);
    setParameter("gKDR", gKDR);
    setParameter("tauSDR", tauSDR);
    setParameter("gLeak", gLeak);
    setParameter("eLeak", eLeak);
    setParameter("f", f);
    setParameter("eCa", eCa);
    setParameter("eK", eK);
    setParameter("rLeakMC", rLeakMC);
    //
    setParameter("iAppOffset", iAppOffset);
    setParameter("rate", rate);

    refresh();
}
Example #8
0
TagColorEditor::TagColorEditor()
{
  createGUI();
}