コード例 #1
0
ファイル: volumeSlider.cpp プロジェクト: nulloy/nulloy
void NVolumeSlider::showToolTip(int x, int y)
{
    if (x == -1 || y == -1)
        return;

    QToolTip::showText(mapToGlobal(QPoint(x, y)), toolTipText(value()));
}
コード例 #2
0
ファイル: volumeSlider.cpp プロジェクト: nulloy/nulloy
void NVolumeSlider::on_valueChanged(int value)
{
    setToolTip(toolTipText(value));
}
コード例 #3
0
//__________________________________________________________
_HYObjectInspector::_HYObjectInspector(void):_HYTWindow (objectInspectorTitle, false)
{
    _HYRect         canvasSettings = {30,50,30,50,HY_COMPONENT_NO_SCROLL};
    _HYLabel*       l1 = new _HYLabel (canvasSettings,GetOSWindowData());
    canvasSettings.left  = 110;
    canvasSettings.right = 10000;
    _HYPullDown*    p1 = new _HYPullDown (canvasSettings,GetOSWindowData());
    p1->EnableMenu(true);
    canvasSettings.left = canvasSettings.right = 90;
    _HYButtonBar*   b1 = new _HYButtonBar(canvasSettings,GetOSWindowData());

    canvasSettings.top = 20;
    canvasSettings.left = 250;
    canvasSettings.bottom = 10000;
    canvasSettings.width = HY_COMPONENT_V_SCROLL;
    _HYTable*   ot  = new _HYTable (canvasSettings,GetOSWindowData(),1,2,125,100,HY_TABLE_STATIC_TEXT);
    canvasSettings.width = HY_COMPONENT_NO_SCROLL|HY_COMPONENT_BORDER_B|HY_COMPONENT_BORDER_T;
    _HYTable*   ot2 = new _HYTable (canvasSettings,GetOSWindowData(),1,2,125,20,HY_TABLE_STATIC_TEXT);


    ot->SetMessageRecipient (this);
    ot2->SetMessageRecipient (this);
    b1->SetMessageRecipient (this);
    p1->SetMessageRecipient (this);

    _String toolTipText ("Open window with the object");
    b1->AddButton (ProcureIconResource(HY_DATAPANEL_ICON_ID+7),&toolTipText);
    toolTipText = "Delete selected object";
    b1->AddButton (ProcureIconResource(HY_DATAPANEL_ICON_ID+3),&toolTipText);
    toolTipText = "Read object from file";
    b1->AddButton (ProcureIconResource(HY_DATAPANEL_ICON_ID+8),&toolTipText);
    toolTipText = "Create new object";
    b1->AddButton (ProcureIconResource(HY_DATAPANEL_ICON_ID+9),&toolTipText);

    b1->EnableButton(0,false);
    b1->EnableButton(1,false);
    b1->EnableButton(2,false);
    b1->EnableButton(3,false);
    b1->SetButtonDim(16);

    AddObject (l1);
    AddObject (ot);
    AddObject (ot2);
    AddObject (p1);
    AddObject (b1);
    SetTableDimensions (3,3);
    SetCell (0,0,b1);
    SetCell (0,1,p1);
    SetCell (0,2,p1);
    SetCell (1,0,ot2);
    SetCell (1,1,ot2);
    SetCell (1,2,ot2);
    SetCell (2,0,ot);
    SetCell (2,1,ot);
    SetCell (2,2,ot);

    _HYFont  labelFont;
#ifdef __WINDOZE__
    labelFont.face = "MS Sans Serif";
    labelFont.size = 10;
#else
#ifdef __HYPHY_GTK__
    labelFont.face = _HY_SANS_FONT;
    labelFont.size = 12;
#else
    labelFont.face = "Geneva";
    labelFont.size = 14;
#endif
#endif
    labelFont.style = HY_FONT_PLAIN;
    l1->SetFont (labelFont);
#ifdef __MAC__
    labelFont.face = "Times";
    labelFont.size = 12;
#endif
    ot->SetFont (labelFont);
    ot2->SetFont (labelFont);
    l1->SetBackColor (boxBColor);
    p1->SetBackColor (boxBColor);
    b1->SetBackColor (boxBColor);
    l1->SetForeColor (boxFColor);
    l1->SetAlignFlags (HY_ALIGN_LEFT);
    l1->SetShadow(true);
    p1->SetAlignFlags (HY_ALIGN_LEFT);
    b1->SetAlignFlags (HY_ALIGN_LEFT);
    ot->selectionType = HY_TABLE_SEL_ROWS|HY_TABLE_DONT_SIZE|HY_TABLE_FOCUSABLE ;
    ot2->selectionType = HY_TABLE_SEL_ROWS|HY_TABLE_DONT_SIZE;

    _String cellValue ("Object ID");
    ot2->SetCellData (&cellValue,0,0,HY_TABLE_BOLD|HY_TABLE_STATIC_TEXT|HY_TABLE_BEVELED|HY_TABLE_CANTSELECT|HY_TABLE_PULLDOWN,true);
    cellValue = "Object Info";
    ot2->SetCellData (&cellValue,0,1,HY_TABLE_STATIC_TEXT|HY_TABLE_BEVELED|HY_TABLE_CANTSELECT|HY_TABLE_BOLD,true);

    l1->SetText (_String(" Class"));
    p1->AddMenuItem ("Trees",-1);
    p1->AddMenuItem ("Data Sets",-1);
    p1->AddMenuItem ("Models",-1);
    p1->AddMenuItem ("Likelihood Functions",-1);
    p1->ChangeSelection (objectInspectorObjClass,false);

    if (objectInspectorRect.width<0) {
        _HYRect  screenRect = GetScreenDimensions();
        SetWindowRectangle (0,0,screenRect.bottom-50,screenRect.right-20);
        SetPosition (screenRect.right-260,60);
        objectInspectorRect = GetWindowRect ();
    }

    firstTime = true;

    //p1->EnableItem  (2,false);

    DeleteObject (l1);
    DeleteObject (p1);
    DeleteObject (ot);
    DeleteObject (b1);

    lastKillID = 0;
}