コード例 #1
0
ファイル: ktabctl.cpp プロジェクト: kthxbyte/KDE1-Linaro
void KTabCtl::paintEvent(QPaintEvent *)
{
    if (!tabs)
	return;

    if( !blBorder )
        return;
      
    QPainter p;
    p.begin(this);

    int y0 = getChildRect().top() - 1;
    int y1 = getChildRect().bottom() + 2;
    int x1 = getChildRect().right() + 2;
    int x0 = getChildRect().left() - 1;

    p.setPen( colorGroup().light() );
    p.drawLine(x0, y0, x1 - 1, y0);      /* top line */
    p.drawLine(x0, y0 + 1, x0, y1);      /* left line */
    p.setPen(black);
    p.drawLine(x1, y1, x0, y1);          /* bottom line */
    p.drawLine(x1, y1 - 1, x1, y0);
    p.setPen(colorGroup().dark());
    p.drawLine(x0 + 1, y1 - 1, x1 - 1, y1 - 1);  /* bottom */
    p.drawLine(x1 - 1, y1 - 2, x1 - 1, y0 + 1);
    p.end();
}
コード例 #2
0
ファイル: TpresetAutoload.cpp プロジェクト: TheRyuu/ffdshow
void TpresetAutoloadDlgBase::init(void)
{
    translate();
    const char_t *capt = tr->translate(m_hwnd, dialogId, 0, NULL);
    if (capt && capt[0]) {
        setWindowText(m_hwnd, capt);
    }
    char_t presetname[MAX_PATH];
    deciD->getActivePresetName(presetname, countof(presetname));
    setText(IDC_LBL_AUTOLOAD, _(IDC_LBL_AUTOLOAD, _l("Preset '%s' will be autoloaded ...")), presetname);

    itemsw = new TitemsWindow(deci, m_hwnd, items);
    CRect ir = getChildRect(IDC_PLC_AUTOLOAD_ITEMS);
    SetWindowPos(itemsw->m_hwnd, GetDlgItem(m_hwnd, IDC_PLC_AUTOLOAD_ITEMS), ir.left, ir.top, ir.Width(), ir.Height(), 0);
    unsigned int cnt = deciD->getPresetAutoloadItemsCount2();
    items.resize(cnt);
    for (unsigned int i = 0; i < cnt; i++) {
        deciD->getPresetAutoloadItemInfo(i, &items[i].name, &items[i].hint, &items[i].allowWildcard, &items[i].is, &items[i].isVal, items[i].val, sizeof(items[i].val), &items[i].isList, &items[i].isHelp);
    }
    itemsw->showItems();
    setCheck(IDC_RBT_PRESETAUTOLOAD_OR  , deci->getParam2(IDFF_presetAutoloadLogic) == 0);
    setCheck(IDC_RBT_PRESETAUTOLOAD_AND , deci->getParam2(IDFF_presetAutoloadLogic) != 0);

    static const int idScreenSize[] = {IDC_CHB_PRESETAUTOLOAD_SCREEN_SIZE, IDC_ED_PRESETAUTOLOAD_SIZE_SCREEN_XMIN, IDC_ED_PRESETAUTOLOAD_SIZE_SCREEN_XMAX, IDC_BT_PRESETAUTOLOAD_SIZE_SCREEN_COMP, IDC_ED_PRESETAUTOLOAD_SIZE_SCREEN_YMIN, IDC_ED_PRESETAUTOLOAD_SIZE_SCREEN_YMAX, IDC_LBL_PRESETAUTOLOAD_SCREEN_WIDTH, IDC_LBL_PRESETAUTOLOAD_SCREEN_HEIGHT, 0};
    enable(1, idScreenSize);
    setCheck(IDC_CHB_PRESETAUTOLOAD_SCREEN_SIZE    , deci->getParam2(IDFF_presetAutoloadScreenSize));
    SetDlgItemInt(m_hwnd, IDC_ED_PRESETAUTOLOAD_SIZE_SCREEN_XMIN, deci->getParam2(IDFF_presetAutoloadScreenSizeXmin), FALSE);
    SetDlgItemInt(m_hwnd, IDC_ED_PRESETAUTOLOAD_SIZE_SCREEN_XMAX, deci->getParam2(IDFF_presetAutoloadScreenSizeXmax), FALSE);
    cond2dlg();
    SetDlgItemInt(m_hwnd, IDC_ED_PRESETAUTOLOAD_SIZE_SCREEN_YMIN, deci->getParam2(IDFF_presetAutoloadScreenSizeYmin), FALSE);
    SetDlgItemInt(m_hwnd, IDC_ED_PRESETAUTOLOAD_SIZE_SCREEN_YMAX, deci->getParam2(IDFF_presetAutoloadScreenSizeYmax), FALSE);
}
コード例 #3
0
  void vtAddObject(Object* obj)
  {
    Rectangle bbox = obj->getBoundingBox();
    if(!m_Rect.isInside(bbox)){
      std::runtime_error e("QTNode: Invalid use of library. Object rect out of bounds.");
      throw e;    
    }
    
    bool belongsToChild = false;
    for(int i = 0; i < 4; ++i){
      Rectangle chRect = getChildRect(i);
      if(chRect.isInside(bbox)){
        if(!m_Children[i]){
          if(m_Depth > 1) m_Children[i] = new QTNode(chRect, m_Depth - 1);
          else m_Children[i] = new QTLeaf(chRect, 0);
        }
        m_Children[i]->addObject(obj);
        belongsToChild = true;
        break;
      }
    }

    /* Only add at this level if it doesn't belong to any of the children
      This means that if an object overlaps two nodes, it belongs to the parent node.
      It's not allowed for an object to overlap the root rectangle, so every legal object
      is guaranteed to be at least parented by the root. */

    if(!belongsToChild){
      obj->setNodeParent(this);
      m_Objects.insert(m_Objects.begin(), obj);
    }
  }
コード例 #4
0
void TffdshowPageBase::selectPage(TconfPageBase *Ipage)
{
    if (!Ipage->m_hwnd) {
        Ipage->createWindow();
    }
    bool pageChanged = page != Ipage;
    if (page && pageChanged) {
        ShowWindow(page->m_hwnd, SW_HIDE);
    }
    page = Ipage;
    CRect rp = getChildRect(IDC_PLACE_PAGE);
    SetWindowPos(page->m_hwnd, htv, rp.left, rp.top, 0, 0, SWP_NOSIZE);
    page->resize(rp);
    pageIs = page->enabled();
    if (page->wndEnabled != pageIs) {
        page->enable();
    }
    if (pageIs) {
        page->cfg2dlg();
    }
    if (pageChanged) {
        ShowWindow(page->m_hwnd, SW_SHOW);
    }
    enable(page->helpURL != NULL && pageIs, IDC_BT_HELP);
    InvalidateRect(m_hwnd, NULL, FALSE);
    int lastpage = page->uniqueID();
    cfgSet(IDFF_lastPage, lastpage);
}
コード例 #5
0
STDMETHODIMP TffdshowPageBase::resize(const CRect &newrect)
{
    setSize(newrect.Width(), newrect.Height());
    anchors.resize(*this, newrect);
    if (page) {
        page->resize(getChildRect(IDC_PLACE_PAGE));
    }
    return S_OK;
}
コード例 #6
0
ファイル: ktabctl.cpp プロジェクト: kthxbyte/KDE1-Linaro
void KTabCtl::resizeEvent(QResizeEvent *)
{
    int i;
    QRect r = getChildRect();
    
    if (tabs) {
        for (i=0; i<(int)pages.size(); i++) {
            pages[i]->setGeometry(r);
        }
        if( ( tabs->shape() == QTabBar::RoundedBelow ) ||
            ( tabs->shape() == QTabBar::TriangularBelow ) ) {
            tabs->move( 0, height()-tabs->height()-4 );
        }
    }
}
コード例 #7
0
ファイル: ktabctl.cpp プロジェクト: kthxbyte/KDE1-Linaro
void KTabCtl::showTab(int i)
{
    unsigned int j;
    for (j = 0; j < pages.size(); j++) {
      if (j != (unsigned)i) {
        pages[j]->hide();
      }
    }

    if((unsigned)i < pages.size()) {
        emit(tabSelected(i));
	if( pages.size() >= 2 ) { 
	  pages[i]->raise();
	}
        pages[i]->setGeometry(getChildRect());
        pages[i]->show();
    }
}
コード例 #8
0
ファイル: Cinfosimd.cpp プロジェクト: JERUKA9/ffdshow-tryouts
//=================================== TinfoPageDec =======================================
void TinfoPageDec::init(void)
{
    setCheck(IDC_CHB_MMX     ,Tconfig::cpu_flags&FF_CPU_MMX     );
    setCheck(IDC_CHB_MMXEXT  ,Tconfig::cpu_flags&FF_CPU_MMXEXT  );
    setCheck(IDC_CHB_SSE     ,Tconfig::cpu_flags&FF_CPU_SSE     );
    setCheck(IDC_CHB_SSE2    ,Tconfig::cpu_flags&FF_CPU_SSE2    );
    setCheck(IDC_CHB_SSE3    ,Tconfig::cpu_flags&FF_CPU_SSE3    );
    setCheck(IDC_CHB_SSSE3   ,Tconfig::cpu_flags&FF_CPU_SSSE3   );
    setCheck(IDC_CHB_3DNOW   ,Tconfig::cpu_flags&FF_CPU_3DNOW   );
    setCheck(IDC_CHB_3DNOWEXT,Tconfig::cpu_flags&FF_CPU_3DNOWEXT);
    setCheck(IDC_CHB_SSE41   ,Tconfig::cpu_flags&FF_CPU_SSE41   );
    setCheck(IDC_CHB_SSE42   ,Tconfig::cpu_flags&FF_CPU_SSE42   );
    setCheck(IDC_CHB_SSE4A   ,Tconfig::cpu_flags&FF_CPU_SSE4A   );
    setCheck(IDC_CHB_SSE5    ,Tconfig::cpu_flags&FF_CPU_SSE5    );

    hlv=GetDlgItem(m_hwnd,IDC_LV_INFO);
    CRect r=getChildRect(IDC_LV_INFO);
    int ncol=0;
    ListView_AddCol(hlv,ncol,r.Width(),_l("Property"),false);
    ListView_SetExtendedListViewStyleEx(hlv,LVS_EX_FULLROWSELECT|LVS_EX_INFOTIP,LVS_EX_FULLROWSELECT|LVS_EX_INFOTIP);
    infoitems.clear();
    const int *infos=getInfos();
    for (int i=0;; i++) {
        Titem it;
        if (!info->getInfo(i,&it.id,&it.name)) {
            break;
        }
        for (int j=0; infos[j]; j++)
            if (infos[j]==it.id) {
                it.index=j;
                infoitems.push_back(it);
            }
    }
    std::sort(infoitems.begin(),infoitems.end(),TsortItem(infos));
    ListView_SetItemCount(hlv,infoitems.size());
    SendMessage(hlv,LVM_SETBKCOLOR,0,GetSysColor(COLOR_BTNFACE));
    SendMessage(hlv,LVM_SETTEXTBKCOLOR,0,GetSysColor(COLOR_BTNFACE));
    setCheck(IDC_CHB_WRITEINFO2DBG, cfgGet(IDFF_allowDPRINTF));
}