当前位置: 首页>>代码示例>>C++>>正文


C++ WndButton::SetWidth方法代码示例

本文整理汇总了C++中WndButton::SetWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ WndButton::SetWidth方法的具体用法?C++ WndButton::SetWidth怎么用?C++ WndButton::SetWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WndButton的用法示例。


在下文中一共展示了WndButton::SetWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: dlgWayPointDetailsShowModal

void dlgWayPointDetailsShowModal(short mypage){

  TCHAR sTmp[128];
  double sunsettime;
  int sunsethours;
  int sunsetmins;
  WndProperty *wp;

  if (!ScreenLandscape) {
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgWayPointDetails_L.xml"));
    wf = dlgLoadFromXML(CallBackTable, 
                        
                        filename, 
                        hWndMainWindow,
                        TEXT("IDR_XML_WAYPOINTDETAILS_L"));

  } else {
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgWayPointDetails.xml"));
    wf = dlgLoadFromXML(CallBackTable, 
                        filename, 
                        hWndMainWindow,
                        TEXT("IDR_XML_WAYPOINTDETAILS"));
  }
  nTextLines = 0;

  if (!wf) return;

  wInfo    = ((WndFrame *)wf->FindByName(TEXT("frmInfos")));
  wCommand = ((WndFrame *)wf->FindByName(TEXT("frmCommands")));
  wSpecial = ((WndFrame *)wf->FindByName(TEXT("frmSpecial")));
  wDetails = (WndListFrame*)wf->FindByName(TEXT("frmDetails"));

  LKASSERT(wInfo!=NULL);
  LKASSERT(wCommand!=NULL);
  LKASSERT(wSpecial!=NULL);
  LKASSERT(wDetails!=NULL);

  // Resize Frames up to real screen size on the right.
  wInfo->SetBorderKind(BORDERLEFT);
  wInfo->SetWidth(wf->GetWidth() - wInfo->GetLeft()-2);
  wCommand->SetBorderKind(BORDERLEFT);
  wCommand->SetWidth(wf->GetWidth() - wCommand->GetLeft()-2);
  wSpecial->SetBorderKind(BORDERLEFT);
  wSpecial->SetWidth(wf->GetWidth() - wSpecial->GetLeft()-2);
  wDetails->SetBorderKind(BORDERLEFT);
  wDetails->SetWidth(wf->GetWidth() - wDetails->GetLeft()-2);

  wCommand->SetVisible(false);
  wSpecial->SetVisible(false);


  //
  // CAPTION: top line in black
  //

  // if SeeYou waypoint
  if (WPLSEL.Format == LKW_CUP) { 
	TCHAR ttmp[50];
	// and it is landable
	if ((WPLSEL.Style>1) && (WPLSEL.Style<6) ) {

		_stprintf(sTmp, TEXT("%s "), WPLSEL.Name);
		// ICAO name probably, let's print it
		if ( _tcslen(WPLSEL.Code)==4 ) {
			_stprintf(ttmp,_T("(%s) "),WPLSEL.Code);
			_tcscat(sTmp, ttmp);
		}

		if ( _tcslen(WPLSEL.Freq)>0 )  {
			_stprintf(ttmp,_T("%s "),WPLSEL.Freq);
			_tcscat(sTmp, ttmp);
		}

		if ( WPLSEL.RunwayDir>=0 )  {
			_stprintf(ttmp,_T("RW %d "),WPLSEL.RunwayDir);
			_tcscat(sTmp, ttmp);
		}
		if ( WPLSEL.RunwayLen>0 )  {
			// we use Altitude instead of distance, to keep meters and feet
			_stprintf(ttmp,_T("%.0f%s"),Units::ToUserAltitude((double)WPLSEL.RunwayLen), Units::GetAltitudeName());
			_tcscat(sTmp, ttmp);
		}

		wf->SetCaption(sTmp);
	} else {
		_stprintf(sTmp, TEXT("%s: "), wf->GetCaption());
		_tcscat(sTmp, WayPointList[SelectedWaypoint].Name);
		wf->SetCaption(sTmp);
	}
  } else {
	_stprintf(sTmp, TEXT("%s: "), wf->GetCaption());
	_tcscat(sTmp, WayPointList[SelectedWaypoint].Name);
	wf->SetCaption(sTmp);
  }

  //
  // Waypoint Comment
  //
//.........这里部分代码省略.........
开发者ID:Turbo87,项目名称:LK8000,代码行数:101,代码来源:dlgWayPointDetails.cpp

示例2: dlgWayPointDetailsShowModal


//.........这里部分代码省略.........
	wp->SetText(sTmp);
  }


  wf->SetKeyDownNotify(FormKeyDown);

  ((WndButton *)wf->FindByName(TEXT("cmdClose")))->SetOnClickNotify(OnCloseClicked);

  // We DONT use PREV  anymore
  ((WndButton *)wf->FindByName(TEXT("cmdPrev")))->SetVisible(false);


  //
  // Details (WAYNOTES) page
  //
  wDetailsEntry = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmDetailsEntry"));
  LKASSERT(wDetailsEntry!=NULL);
  wDetailsEntry->SetCanFocus(true);

  nTextLines = TextToLineOffsets(WayPointList[SelectedWaypoint].Details,
				 LineOffsets,
				 MAXLINES);

  // ScrollbarWidth is initialised from DrawScrollBar in WindowControls, so it might not be ready here
  if ( wDetails->ScrollbarWidth == -1) {
   #if defined (PNA)
   #define SHRINKSBFACTOR 1.0 // shrink width factor.  Range .1 to 1 where 1 is very "fat"
   #else
   #define SHRINKSBFACTOR 0.75  // shrink width factor.  Range .1 to 1 where 1 is very "fat"
   #endif
   wDetails->ScrollbarWidth = (int) (SCROLLBARWIDTH_INITIAL * ScreenDScale * SHRINKSBFACTOR);

  }
  wDetailsEntry->SetWidth(wDetails->GetWidth() - wDetails->ScrollbarWidth - 5);

  WndButton *wb;

  TCHAR captmp[200];

  // Resize also buttons
  wb = ((WndButton *)wf->FindByName(TEXT("cmdInserInTask")));
  if (wb) {
    wb->SetOnClickNotify(OnInserInTaskClicked);
    wb->SetWidth(wCommand->GetWidth()-wb->GetLeft()*2);

    if ((ActiveWayPoint<0) || !ValidTaskPoint(0)) {
	// this is going to be the first tp (ActiveWayPoint 0)
	_stprintf(captmp,_T("%s"),MsgToken(1824)); // insert as START
    } else {
	LKASSERT(ActiveWayPoint>=0 && ValidTaskPoint(0));
	int indexInsert = max(ActiveWayPoint,0); // safe check
	if (indexInsert==0) {
		_stprintf(captmp,_T("%s"),MsgToken(1824)); // insert as START
	} else {
		LKASSERT(ValidWayPoint(Task[indexInsert].Index));
		_stprintf(captmp,_T("%s <%s>"),MsgToken(1825),WayPointList[ Task[indexInsert].Index ].Name); // insert before xx
	}
    }
    wb->SetCaption(captmp);
  }

  wb = ((WndButton *)wf->FindByName(TEXT("cmdAppendInTask1")));
  if (wb) {
    wb->SetOnClickNotify(OnAppendInTask1Clicked);
    wb->SetWidth(wCommand->GetWidth()-wb->GetLeft()*2);
  }
开发者ID:rafagdn,项目名称:LK8000,代码行数:67,代码来源:dlgWayPointDetails.cpp

示例3: InitFlySim

static WndForm* InitFlySim() {

    WndForm* pWndForm = dlgLoadFromXML(CallBackTable, ScreenLandscape ? IDR_XML_FLYSIM_L : IDR_XML_FLYSIM_P);
    if(pWndForm) {

        WindowControl * pWnd = nullptr;

        if (ScreenLandscape) {

#ifdef KOBO
            const unsigned int SPACEBORDER = 1;
            const unsigned int w = (ScreenSizeX - (SPACEBORDER * 6)) / 5;
#else
            const unsigned int SPACEBORDER = NIBLSCALE(2);
            const unsigned int w = (ScreenSizeX - (SPACEBORDER * 5)) / 4;
#endif
            unsigned int lx = SPACEBORDER - 1; // count from 0

            pWnd = pWndForm->FindByName(TEXT("cmdFLY"));
            if(pWnd) {
                pWnd->SetWidth(w);
                pWnd->SetLeft(lx);
            }

#ifdef KOBO
            lx += w + SPACEBORDER;
            WndButton* pWndNickel = new WndButton(pWndForm, _T("cmdNICKEL"), _T("KOBO"), lx , IBLSCALE(205), w, IBLSCALE(30), &OnNickelClick );
            if(pWndNickel) {

            }
#endif
            lx += w + SPACEBORDER;
            pWnd = pWndForm->FindByName(TEXT("cmdDUALPROFILE"));
            if(pWnd) {
                pWnd->SetWidth(w);
                pWnd->SetLeft(lx);
            }

            lx += w + SPACEBORDER;
            pWnd = pWndForm->FindByName(TEXT("cmdEXIT"));
            if(pWnd) {
                pWnd->SetWidth(w);
                pWnd->SetLeft(lx);
#ifdef KOBO
                pWnd->SetCaption(MsgToken(1901)); // POWER OFF
#endif
            }

            lx += w + SPACEBORDER;
            pWnd = pWndForm->FindByName(TEXT("cmdSIM"));
            if(pWnd) {
                pWnd->SetWidth(w);
                pWnd->SetLeft(lx);
            }
        } else {
            const unsigned SPACEBORDER = NIBLSCALE(2);
            unsigned w = (ScreenSizeX - (SPACEBORDER * 3)) / 2;
            int h = ScreenSizeY - IBLSCALE(90); // 40+5+40+5

            int lx = SPACEBORDER - 1; // count from 0
            pWnd = pWndForm->FindByName(TEXT("cmdFLY"));
            if(pWnd) {
                pWnd->SetTop(h + IBLSCALE(45));
                pWnd->SetLeft(lx);
                pWnd->SetHeight(IBLSCALE(40));
                pWnd->SetWidth(w);
            }

            lx += w + SPACEBORDER;
            pWnd = pWndForm->FindByName(TEXT("cmdSIM"));
            if(pWnd) {
                pWnd->SetTop(h + IBLSCALE(45));
                pWnd->SetLeft(lx);
                pWnd->SetHeight(IBLSCALE(40));
                pWnd->SetWidth(w);
            }


#ifdef KOBO
            lx = SPACEBORDER - 1; // count from 0

            WndButton* pWndNickel = new WndButton(pWndForm, _T("cmdNICKEL"), _T("KOBO"), lx , h, w, IBLSCALE(40), &OnNickelClick );
            if(pWndNickel) {
                w = (ScreenSizeX - (SPACEBORDER * 4)) / 3;
                pWndNickel->SetTop(h);
                pWndNickel->SetLeft(lx);
                pWndNickel->SetHeight(IBLSCALE(40));
                pWndNickel->SetWidth(w);
            }

            lx += w + SPACEBORDER;
#else
            lx = SPACEBORDER - 1; // count from 0
#endif
            pWnd = pWndForm->FindByName(TEXT("cmdDUALPROFILE"));
            if(pWnd) {
                pWnd->SetTop(h);
                pWnd->SetLeft(lx);
                pWnd->SetHeight(IBLSCALE(40));
                pWnd->SetWidth(w);
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


注:本文中的WndButton::SetWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。