Ejemplo n.º 1
0
int QwtKnob::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QwtAbstractSlider::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    
#ifndef QT_NO_PROPERTIES
     if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< KnobStyle*>(_v) = knobStyle(); break;
        case 1: *reinterpret_cast< int*>(_v) = knobWidth(); break;
        case 2: *reinterpret_cast< Qt::Alignment*>(_v) = alignment(); break;
        case 3: *reinterpret_cast< double*>(_v) = totalAngle(); break;
        case 4: *reinterpret_cast< int*>(_v) = numTurns(); break;
        case 5: *reinterpret_cast< MarkerStyle*>(_v) = markerStyle(); break;
        case 6: *reinterpret_cast< int*>(_v) = markerSize(); break;
        case 7: *reinterpret_cast< int*>(_v) = borderWidth(); break;
        }
        _id -= 8;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setKnobStyle(*reinterpret_cast< KnobStyle*>(_v)); break;
        case 1: setKnobWidth(*reinterpret_cast< int*>(_v)); break;
        case 2: setAlignment(*reinterpret_cast< Qt::Alignment*>(_v)); break;
        case 3: setTotalAngle(*reinterpret_cast< double*>(_v)); break;
        case 4: setNumTurns(*reinterpret_cast< int*>(_v)); break;
        case 5: setMarkerStyle(*reinterpret_cast< MarkerStyle*>(_v)); break;
        case 6: setMarkerSize(*reinterpret_cast< int*>(_v)); break;
        case 7: setBorderWidth(*reinterpret_cast< int*>(_v)); break;
        }
        _id -= 8;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 8;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Ejemplo n.º 2
0
void TextFrame::CommonInit()
{
    wxSizer *sz;

    _splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_NOBORDER|wxSP_PERMIT_UNSPLIT|wxSP_LIVE_UPDATE);

    _firstPanel = new wxPanel(_splitter, wxID_ANY);
    _secondPanel = new wxPanel(_splitter, wxID_ANY);

    _mainText    = new wxStyledTextCtrl(_firstPanel, wxID_ANY);
    _secondText  = new wxStyledTextCtrl(_secondPanel, wxID_ANY);

    InitTextCtrl(_mainText);
    InitTextCtrl(_secondText);

    sz = new wxBoxSizer(wxVERTICAL);
    sz->Add(_mainText, 1, wxEXPAND|wxALL, 1);
    _firstPanel->SetSizer(sz);
    _firstPanel->SetBackgroundColour(wxColour(128, 192, 128));

    sz = new wxBoxSizer(wxVERTICAL);
    sz->Add(_secondText, 1, wxEXPAND|wxALL, 1);
    _secondPanel->SetSizer(sz);
    _secondPanel->SetBackgroundColour(wxColour(128, 128, 192));

    _secondText->SetDocPointer(_mainText->GetDocPointer());
    _splitter->Initialize(_firstPanel);
    _secondPanel->Hide();
    _currentText = NULL;

    _markbar = new wxMarkBar(this, wxID_ANY, 0, 1, wxDefaultPosition, wxSize(14, -1), MB_VERTICAL|wxBORDER_NONE);
    _markbar->AddPage(0, 0, wxColour(0, 192, 0));

    wxSizer* gsz = new wxBoxSizer(wxHORIZONTAL);
    wxSizer* vsz = new wxBoxSizer(wxVERTICAL);
    vsz->Add(_splitter, 1, wxEXPAND);

    // Fast find
    _fastFindLine  = new wxSpinCtrl(this, XRCID("FAST_FIND_LINE"), "", wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxTE_PROCESS_ENTER);
    _fastFindText  = new wxSearchCtrl(this, XRCID("FAST_FIND_TEXT"), "", wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
    _fastFindClose = new wxBitmapButton(this, XRCID("FAST_FIND_CLOSE"), wxArtProvider::GetBitmap(wxART_CLOSE, wxART_BUTTON, wxSize(16,16)));
    _fastFindSizer = new wxBoxSizer(wxHORIZONTAL);
    _fastFindSizer->Add(_fastFindLine, 0, wxEXPAND|wxALL, 2);
    _fastFindSizer->Add(new wxBitmapButton(this, XRCID("FAST_FIND_LINE_BTN"), wxArtProvider::GetBitmap(wxART_GOTO_LAST, wxART_BUTTON, wxSize(16, 16))), 0, wxEXPAND|wxALL, 2);
    _fastFindSizer->AddSpacer(8);
    _fastFindSizer->Add(_fastFindText, 1, wxEXPAND|wxALL, 2);
    _fastFindSizer->Add(new wxBitmapButton(this, wxID_BACKWARD, wxArtProvider::GetBitmap(wxART_GO_BACK, wxART_BUTTON, wxSize(16, 16))), 0, wxEXPAND|wxALL, 2);
    _fastFindSizer->Add(new wxBitmapButton(this, wxID_FORWARD, wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_BUTTON, wxSize(16, 16))), 0, wxEXPAND|wxALL, 2);
    _fastFindSizer->AddSpacer(8);
    _fastFindSizer->Add(_fastFindClose, 0, wxEXPAND|wxALL, 2);
    vsz->Add(_fastFindSizer, 0, wxEXPAND);

    gsz->Add(vsz, 1, wxEXPAND);
    gsz->Add(_markbar, 0, wxEXPAND);

    SetSizer(gsz);

    gsz->Hide(_fastFindSizer, true);

    // Initialize markers (Scintilla and MarkBar)
    setMarkerStyle(TEXT_MARKER_BOOKMARK, wxSTC_MARK_ARROW, wxColour(0, 0, 156), wxColour(0, 0, 192));
    setMarkerStyle(TEXT_MARKER_SEARCH,   wxSTC_MARK_ARROW,  wxColour(0, 156, 0), wxColour(0, 192, 0));

    // Apply global config
    ApplyGlobalConfig();
}