Example #1
0
/**
 * 处理内容:窗体控件的创建
 * @param void
 * @return void
 */
void MainWnd::createWidget()
{
    // 创建标题栏
    m_pTitleBar = new TitleBar(this);
    connect(m_pTitleBar,SIGNAL(menuClicked()),SLOT(showMenu()));
    connect(m_pTitleBar,SIGNAL(minClicked()),SLOT(showMin()));
    connect(m_pTitleBar,SIGNAL(maxClicked()),SLOT(showMax()));
    connect(m_pTitleBar,SIGNAL(closeClicked()),SLOT(showClose()));

    // 创建对工具栏
    m_pToolBar = new ToolBar(this);

    // 创建内容区域
    m_pContentWidget = new Html5Viewer(this);
    m_pContentWidget->setOrientation(Html5Viewer::ScreenOrientationAuto);

    //m_pContentWidget->showExpanded();
    //m_pContentWidget->loadFile(QLatin1String("QtStyleSheetsReference.html"));

    QString strURL = SysSettings::Instance()->value(QString::fromLocal8Bit("url/turl"),QVariant()).toString();
    m_pContentWidget->loadUrl(QUrl(strURL));

    // 创建状态栏
    m_pStatuBar = new StatusBar(this);

//    // 右键菜单
//    connect(this,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(menuRight(const QPoint&)));
}
Example #2
0
void ControlStrip::mousePressEvent(QMouseEvent *event)
{
    int h = height();
    int spacing = qMin(h, (width() - h * 4) / 3);
    int x = event->pos().x();

    if (x < h) {
        emit menuClicked();
        event->accept();
        return;
    }

    if (x > width() - h) {
        emit closeClicked();
        event->accept();
        return;
    }

    if ((x < width() - (h + spacing)) && (x > width() - (h * 2 + spacing))) {
        emit forwardClicked();
        event->accept();
        return;
    }

    if ((x < width() - (h * 2 + spacing * 2)) && (x > width() - (h * 3 + spacing * 2))) {
        emit backClicked();
        event->accept();
        return;
    }
}
Example #3
0
void BrowserView::initialize()
{
    connect(m_zoomStrip, SIGNAL(zoomInClicked()), SLOT(zoomIn()));
    connect(m_zoomStrip, SIGNAL(zoomOutClicked()), SLOT(zoomOut()));

    connect(m_controlStrip, SIGNAL(menuClicked()), SIGNAL(menuButtonClicked()));
    connect(m_controlStrip, SIGNAL(backClicked()), m_webView, SLOT(back()));
    connect(m_controlStrip, SIGNAL(forwardClicked()), m_webView, SLOT(forward()));

    QPalette pal = m_webView->palette();
    pal.setBrush(QPalette::Base, Qt::white);
    m_webView->setPalette(pal);

    FlickCharm *flickCharm = new FlickCharm(this);
    flickCharm->activateOn(m_webView);

    m_webView->setZoomFactor(static_cast<qreal>(m_currentZoom)/100.0);
    connect(m_webView, SIGNAL(loadStarted()), SLOT(start()));
    connect(m_webView, SIGNAL(loadProgress(int)), SLOT(setProgress(int)));
    connect(m_webView, SIGNAL(loadFinished(bool)), SLOT(finish(bool)));
    connect(m_webView, SIGNAL(urlChanged(QUrl)), SLOT(updateTitleBar()));

    m_webView->setHtml("Will try to load page soon!");
    m_webView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    m_webView->setFocus();
#ifdef Q_OS_SYMBIAN
    QTimer::singleShot(0, this, SLOT(setDefaultIap()));
#endif
}
Example #4
0
void BrowserView::initialize()
{
    connect(m_zoomStrip, SIGNAL(zoomInClicked()), SLOT(zoomIn()));
    connect(m_zoomStrip, SIGNAL(zoomOutClicked()), SLOT(zoomOut()));

    connect(m_controlStrip, SIGNAL(menuClicked()), SIGNAL(menuButtonClicked()));
    connect(m_controlStrip, SIGNAL(backClicked()), m_webView, SLOT(back()));
    connect(m_controlStrip, SIGNAL(forwardClicked()), m_webView, SLOT(forward()));
    connect(m_controlStrip, SIGNAL(closeClicked()), qApp, SLOT(quit()));

    QPalette pal = m_webView->palette();
    pal.setBrush(QPalette::Base, Qt::white);
    m_webView->setPalette(pal);

    FlickCharm *flickCharm = new FlickCharm(this);
    flickCharm->activateOn(m_webView);

    m_webView->setZoomFactor(static_cast<qreal>(m_currentZoom)/100.0);
    connect(m_webView, SIGNAL(loadStarted()), SLOT(start()));
    connect(m_webView, SIGNAL(loadProgress(int)), SLOT(setProgress(int)));
    connect(m_webView, SIGNAL(loadFinished(bool)), SLOT(finish(bool)));
    connect(m_webView, SIGNAL(urlChanged(QUrl)), SLOT(updateTitleBar()));

    m_webView->setHtml("about:blank");
    m_webView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    m_webView->setFocus();
}
Example #5
0
OnyxDictFrame::OnyxDictFrame(QWidget *parent,
                             DictionaryManager & dict,
                             tts::TTS *tts,
                             bool exit_by_menu)
    : OnyxDialog(parent)
    , big_layout_(&content_widget_)
    , line_edit_layout_(0)
    , dict_menu_layout_(0)
    , line_edit_(0, this)
    , explanation_(0)
    , list_widget_(0, 0)
    , help_widget_(tr("No dictionary found. Please put dictionaries in SD Card or internal flash's \"dicts\" folder."), this)
    , dictionary_menu_(0, this)
    , tts_button_view_(0, this)
    , keyboard_(this)
    , status_bar_(this, MENU | MESSAGE | BATTERY | CLOCK | SCREEN_REFRESH | INPUT_TEXT)
    , dict_mgr_(dict)
    , tts_engine_(tts)
    , internal_state_(-1)
    , similar_words_checked_(false)
    , exit_by_menu_(exit_by_menu)
{
#ifndef Q_WS_QWS
    resize(600, 800);
#else
    resize(qApp->desktop()->screenGeometry().size());
#endif

    createLayout();
    initBrowser();
    initDictionaries();

    connectWithChildren();
    connect(&status_bar_, SIGNAL(menuClicked()), this, SLOT(popupMenu()));
    connect(&status_bar_, SIGNAL(requestInputText()), this, SLOT(onHideKeyboard()));
#ifdef Q_WS_QWS
    connect(qApp->desktop(), SIGNAL(resized(int)), this, SLOT(onScreenSizeChanged(int)), Qt::QueuedConnection);
#endif

    // connect the signals with sys_state_
    SysStatus & sys_status = SysStatus::instance();
    connect(&sys_status, SIGNAL(volumeChanged(int, bool)), this, SLOT(onSystemVolumeChanged(int, bool)));

    connect(&explanation_, SIGNAL(highlighted(QString)), this, SLOT(lookup(QString)));
    explanation_.installEventFilter(this);
    list_widget_.installEventFilter(this);
}
Example #6
0
bool MainWidget::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: upClicked(); break;
    case 1: downClicked(); break;
    case 2: leftClicked(); break;
    case 3: rightClicked(); break;
    case 4: menuClicked(); break;
    case 5: radioClicked(); break;
    case 6: mp3Clicked(); break;
    case 7: gpsClicked(); break;
    case 8: obdiiClicked(); break;
    case 9: photoClicked(); break;
    case 10: linuxClicked(); break;
    default:
	return QWidget::qt_invoke( _id, _o );
    }
    return TRUE;
}
Example #7
0
DictFrame::DictFrame(QWidget *parent, DictionaryManager & dict, tts::TTS *tts)
    : OnyxDialog(parent)
    , vlayout_(&content_widget_)
    , hlayout1_(0)
    , hlayout2_(0)
    , dict_edit_(QString(), 0)
    , details_(0)
    , list_widget_(0, 0)
    , keyboard_(0)
    , status_bar_(this, MENU | MESSAGE | BATTERY | CLOCK | SCREEN_REFRESH | INPUT_TEXT)
    , clear_button_(QApplication::tr("Clear"), 0)
    , dict_list_button_(tr("Dictionaries"), 0)
    , lookup_button_(tr("Lookup"), 0)
    , word_list_button_(tr("Similar Words"), 0)
    , details_button_(tr("Explanation"), 0)
    , speak_button_(tr(""), 0)
    , dict_mgr_(dict)
    , tts_engine_(tts)
    , internal_state_(-1)
{
#ifndef Q_WS_QWS
    resize(600, 800);
#else
    resize(qApp->desktop()->screenGeometry().size());
#endif

    createLayout();
    initBrowser();
    initDictionaries();

    connect(&status_bar_, SIGNAL(menuClicked()), this, SLOT(popupMenu()));
    connect(&status_bar_, SIGNAL(requestInputText()), this, SLOT(onInputText()));
#ifdef Q_WS_QWS
    connect(qApp->desktop(), SIGNAL(resized(int)), this, SLOT(onScreenSizeChanged(int)), Qt::QueuedConnection);
#endif

    // connect the signals with sys_state_
    SysStatus & sys_status = SysStatus::instance();
    connect(&sys_status, SIGNAL(volumeChanged(int, bool)), this, SLOT(onSystemVolumeChanged(int, bool)));
}
Example #8
0
void StatusBar::onMenuClicked()
{
    emit menuClicked();
}
Example #9
0
void MainWindow::initialize()
{
    MyPreferences::m_prefInstance = new MyPreferences(this);
    SEMPERMERK_PREFS->hide();
    SEMPERMERK_PREFS->resize(size());
    SEMPERMERK_PREFS->move(0, 0);

    m_controlStrip = new ControlStrip(this);
    m_controlStrip->resizeBar(size(), true);
    m_controlStrip->show();

    m_homeView = new HomeView(this);

    m_mapView = new MapView(this);
    m_mapView->show();
    m_mapView->resize(QSize(width(), height()));

    loadTemplateDocument(":/doc/initial.mdc");
    m_mapView->setDocument(m_document);

//    ImageMapLayer* ilayer = m_document->addImageLayer();
//    ilayer->setMapAdapter(TMS_ADAPTER_UUID, "OSM Mapnik");
//    ilayer->setVisible(true);

    M_PREFS->initialPosition(m_mapView);
    m_mapView->launch(new EditInteraction(m_mapView));
    m_mapView->invalidate(true, true);

    m_homeView->resize(QSize(width(), height()));
    m_homeView->move(width(), m_homeView->y());
    m_homeView->show();

    m_gpsview = new QGPS(this);
#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
    QGPSMobileDevice* aGps = new QGPSMobileDevice();
    if (aGps->openDevice()) {
        connect(aGps, SIGNAL(updatePosition(qreal, qreal, QDateTime, qreal, qreal, qreal)),
            this, SLOT(updateGpsPosition(qreal, qreal, QDateTime, qreal, qreal, qreal)));

//        ui->gpsConnectAction->setEnabled(false);
//        ui->gpsReplayAction->setEnabled(false);
//        ui->gpsDisconnectAction->setEnabled(true);
//        ui->gpsRecordAction->setEnabled(true);
//        ui->gpsPauseAction->setEnabled(true);
        m_gpsview->setGpsDevice(aGps);
        m_gpsview->resetGpsStatus();
        m_gpsview->startGps();
    }
#elif defined(Q_WS_SIMULATOR)
    QGPSFileDevice* aGps = new QGPSFileDevice(":/test/test.nma");
    if (aGps->openDevice()) {
        connect(aGps, SIGNAL(updatePosition(qreal, qreal, QDateTime, qreal, qreal, qreal)),
            this, SLOT(updateGpsPosition(qreal, qreal, QDateTime, qreal, qreal, qreal)));

//        ui->gpsConnectAction->setEnabled(false);
//        ui->gpsReplayAction->setEnabled(false);
//        ui->gpsDisconnectAction->setEnabled(true);
//        ui->gpsRecordAction->setEnabled(true);
//        ui->gpsPauseAction->setEnabled(true);
        m_gpsview->setGpsDevice(aGps);
        m_gpsview->resetGpsStatus();
        m_gpsview->startGps();
    }
#endif
    m_gpsview->resize(QSize(width(), height()));
    m_gpsview->move(width(), m_gpsview->y());
    m_gpsview->show();

    SEMPERMERK_PREFS->show();

    m_controlStrip->raise();

    connect(m_homeView, SIGNAL(addressEntered(QString)), SLOT(gotoAddress(QString)));

//    connect(m_mapView, SIGNAL(menuButtonClicked()), SLOT(showHomeView()));

//    connect(m_controlStrip, SIGNAL(backClicked()), m_mapView, SLOT(backView()));
//    connect(m_controlStrip, SIGNAL(forwardClicked()), m_mapView, SLOT(fwdView()));
//    connect(m_controlStrip, SIGNAL(stopClicked()), m_mapView, SLOT(stop()));
//    connect(m_controlStrip, SIGNAL(zoomBestClicked()), m_mapView, SLOT(zoomBest()));
//    connect(m_controlStrip, SIGNAL(refreshClicked()), m_mapView, SLOT(reload()));
//    connect(m_controlStrip, SIGNAL(bookmarkClicked()), m_mapView, SIGNAL(menuButtonClicked()));
    connect(m_controlStrip, SIGNAL(zoomInClicked()), m_mapView, SLOT(zoomIn()));
    connect(m_controlStrip, SIGNAL(zoomOutClicked()), m_mapView, SLOT(zoomOut()));
    connect(m_controlStrip, SIGNAL(prefClicked()), SLOT(showPreferencesView()));
    connect(m_controlStrip, SIGNAL(menuClicked()), SLOT(showMenu()));

//    m_controlStrip->bookmarkBt->show();
//    m_controlStrip->searchBt->show();
//    m_controlStrip->editBt->hide();

    downSlide(0);

//    QTimer::singleShot(2000, this, SLOT(showHomeView()));
}
Example #10
0
void ToolBar::onMenu() {
	emit menuClicked();
}
Example #11
0
void GameMenu::cancelClicked() {
    emit menuClicked(GameMenuType::Cancel);
}
Example #12
0
void GameMenu::skillButtonClicked() {
    emit menuClicked(GameMenuType::SkillTest);
}
Example #13
0
void GameMenu::attackClicked() {
    emit menuClicked(GameMenuType::Attack);
}
Example #14
0
void GameMenu::moveClicked() {
    emit menuClicked(GameMenuType::Move);
}