本文整理汇总了C++中WPoint类的典型用法代码示例。如果您正苦于以下问题:C++ WPoint类的具体用法?C++ WPoint怎么用?C++ WPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WPoint类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: getRows
bool Outline::paint()
//-------------------
{
OutlineElement * elm;
int maxRows = getRows();
int index = -1 * _topIndex;
WPoint hotSize;
WPoint avg;
WPoint max;
textMetrics( avg, max );
if( count() ) {
GlobalHotSpots->hotSpotSize( OutlineLeafUp, hotSize ); // rely on all being same size
for( elm = element( 0 ); elm != NULL; elm = elm->visibleSib() ) {
elm->drawLine( this, index, hotSize.x(), max.y() );
if( index >= maxRows ) {
break;
}
}
return HotWindowList::paint();
} else {
ScreenDev dev;
dev.open( this );
dev.drawText( WPoint( 0, 0 ), emptyText() );
dev.close();
return true;
}
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:34,代码来源:outline.cpp
示例2: hotSpotSize
void WEXPORT WHotSpots::hotSpotSize( int hot_spot, WPoint &size ) {
/*****************************************************************/
gui_coord s;
GUIGetHotSpotSize( hot_spot, &s );
size.x( s.x );
size.y( s.y );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:9,代码来源:whotspot.cpp
示例3: paint
void TreeNode::paint( OutputDevice *dev, TreeRect *r )
//----------------------------------------------------
{
/* first make sure that this node needs to be drawn:
* it must be visible, and it must be inside the
* invalid rectangle
*/
if( _flags.enabled == Hidden ) return;
if( ( r->x() + r->w() < _bounding.x() ) ||
(r->x() > _bounding.x() + _bounding.w() ) ) return;
if( ( r->y() + r->h() < _bounding.y() ) ||
( r->y() > _bounding.y() + _bounding.h() ) ) return;
WPoint start;
WRect virtBnd;
TreeCoord xOff = _parent->getXOff();
TreeCoord yOff = _parent->getYOff();
Color back;
Color fore;
PaintInfo * pinf;
PaintInfo * oldPinf;
//---------- border ---------//
virtBnd.x( (int) _bounding.x() - xOff );
virtBnd.y( (int) _bounding.y() - yOff );
virtBnd.w( (int) _bounding.w() );
virtBnd.h( (int) _bounding.h() );
pinf = getPaintInfo();
oldPinf = dev->getPaintInfo();
dev->setPaintInfo( pinf );
dev->rectangle( virtBnd );
delete pinf;
dev->setPaintInfo( oldPinf );
//---------- text -----------//
if( _flags.selected ) {
back = CUSTOM_RGB(0,0,128);
fore = ColorWhite;
} else {
back = ColorLiteGray;
fore = ColorBlack;
}
start.x( virtBnd.x() + NodeBuffer );
start.y( virtBnd.y() + NodeBuffer );
dev->drawText( start, name(), fore, back );
}
开发者ID:ArmstrongJ,项目名称:open-watcom-v2,代码行数:57,代码来源:gtbase.cpp
示例4: getTextExtentY
int ScreenDev::getTextExtentY( const char * name )
//------------------------------------------------
{
WPoint avg;
WPoint max;
REQUIRE( _window != NULL, "accessing unopened output device" );
name=name;//get rid of unref'd error
// changed so that this reflects how much space GUI uses to draw the text
_window->textMetrics( avg, max );
return( avg.y() );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:12,代码来源:screendv.cpp
示例5: getHotOffset
int Outline::getHotOffset( int index )
//------------------------------------
{
OutlineElement * elm;
WPoint hotSize;
GlobalHotSpots->hotSpotSize( OutlineLeafUp, hotSize ); // rely on all being same size
elm = element( index );
REQUIRE( elm != NULL, "Outline::getHotSpot elm" );
return( elm->level() * hotSize.x() );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:13,代码来源:outline.cpp
示例6: getTextExtentX
bool WFlashPage::paint()
//-----------------------
{
for( int i=0; i<_text.count(); i++ ) {
const char* text = _text.cStringAt( i );
int off = (_width - getTextExtentX( text )) / 2;
drawTextExtent( i, off, text, WPaintAttrBackground, _width );
}
WPoint hotSize;
_hotSpot->hotSpotSize( _idx, hotSize );
drawHotSpot( _idx, _text.count(), (_width - hotSize.x())/2 );
return( true );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:13,代码来源:wflashp.cpp
示例7: init
void WFlashPage::init( int interval, const char *title )
{
WPoint hotSize;
_hotSpot->hotSpotSize( _idx, hotSize );
if( _width < hotSize.x() ) _width = hotSize.x();
_height += hotSize.y();
if( interval == INTERVAL_OK_BUTTON ) {
static const char ok[] = { "OK" };
int w = getTextExtentX( ok ) * 3;
int h = getTextExtentY( ok ) * 3/2;
int xoff = (_width - w) / 2;
int yoff = _height + h / 2;
WDefPushButton* bOk = new WDefPushButton( this, WRect( xoff, yoff, w, h), ok );
bOk->onClick( this, (cbw)&WFlashPage::okButton );
bOk->setFocus();
bOk->show();
_height += 2*h;
} else {
if( _width - hotSize.x() ) {
_height += WSystemMetrics::captionSize();
}
}
WOrdinal wheight = _height;
if( title ) {
wheight += WSystemMetrics::captionSize();
}
WOrdinal wwidth = _width;
move( 0, 0 );
size( wwidth, wheight );
centre();
show();
update(); // force the paint method.
if( interval > 0 ) {
_flashTimer = new WTimer( this, (cbt)&WFlashPage::flashTimer );
_flashTimer->start( (WORD)interval, 1 );
}
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:40,代码来源:wflashp.cpp
示例8: addPoint
void WPolygonArea::addPoint(const WPoint& point)
{
points_.push_back(WPointF(point.x(), point.y()));
repaint();
}
开发者ID:Sulando,项目名称:wt,代码行数:6,代码来源:WPolygonArea.C
示例9: setCenter
void WCircleArea::setCenter(const WPoint& point)
{
setCenter(point.x(), point.y());
}
开发者ID:LifeGo,项目名称:wt,代码行数:4,代码来源:WCircleArea.C
示例10: initialize
void VEditDlg::initialize()
{
int sx;
int sy;
WPoint average;
WPoint max;
WGroupBox *gbox;
WText *t1;
WText *t3;
WText *t4;
WText *t5;
WText *t6;
WText *t7;
const int rb_hite = 10; //height of a radio button
// const int space = 10;
const int button_width = 50;
const int button_hite = 14;
setSystemFont( false );
this->textMetrics( average, max );
sx = average.x() / 4;
sy = average.y() / 8;
t1 = new WText( this, WRect( 5*sx, 5*sy, 132*sx, 9*sy ),
"Enter editor file name:" );
t1->show();
_editorName = new WEditBox( this, WRect( 5*sx, 17*sy, 139*sx, 13*sy ) );
_editorName->select();
_editorName->show();
_parmBoxText = new WText( this, WRect( 5*sx, 33*sy, 132*sx, 9*sy ),
"Enter editor parameters:" );
_parmBoxText->show();
_editorParms = new WEditBox( this, WRect( 5*sx, 45*sy, 139*sx, 13*sy ) );
_editorParms->select();
_editorParms->show();
WPushButton* bBrowse = new WPushButton( this,
WRect( 155*sx, 16*sy, button_width * sx, button_hite * sy ),
"&Browse..." );
bBrowse->onClick( this, (cbw)&VEditDlg::browseButton );
bBrowse->show();
WDefPushButton* bOk;
bOk = new WDefPushButton( this,
WRect( 26*sx, 117*sy, button_width * sx, button_hite * sy ),
"&OK" );
bOk->onClick( this, (cbw)&VEditDlg::okButton );
bOk->show();
WPushButton* bCancel = new WPushButton( this,
WRect( 82*sx, 117*sy, button_width * sx, button_hite * sy ),
"&Cancel" );
bCancel->onClick( this, (cbw)&VEditDlg::cancelButton );
bCancel->show();
WPushButton* bDefault = new WPushButton( this,
WRect( 138*sx, 117*sy, button_width * sx, button_hite * sy ),
"&Default" );
bDefault->onClick( this, (cbw)&VEditDlg::defaultButton );
bDefault->show();
_exeButton = new WRadioButton( this,
WRect( 13*sx, 74*sy, 60*sx, rb_hite * sy ),
"Executable", RStyleGroupFirst );
_exeButton->show();
_exeButton->onClick( this, (cbw)&VEditDlg::exeButton );
_dllButton = new WRadioButton( this,
WRect( 13*sx, 87*sy, 60*sx, rb_hite * sy ),
"DLL", RStyleGroupFirst );
_dllButton->show();
_dllButton->onClick( this, (cbw)&VEditDlg::dllButton );
gbox = new WGroupBox( this,
WRect( 5*sx, 61*sy, 139*sx, 42 * sy ),
"Editor type: " );
gbox->show();
t3 = new WText( this, WRect( 155*sx, 45*sy, 65*sx, 9*sy ),
"Parameter" );
t3->show();
t4 = new WText( this, WRect( 155*sx, 54*sy, 65*sx, 9*sy ),
"Macros:" );
t4->show();
t5 = new WText( this, WRect( 155*sx, 67*sy, 65*sx, 9*sy ),
"%f - filename" );
t5->show();
t6 = new WText( this, WRect( 155*sx, 76*sy, 65*sx, 9*sy ),
"%r - row" );
t6->show();
t7 = new WText( this, WRect( 155*sx, 85*sy, 65*sx, 9*sy ),
"%c - column" );
t7->show();
_editorName->setText( _fn );
//.........这里部分代码省略.........
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:101,代码来源:veditdlg.cpp
示例11: initialize
void VCompDialog::initialize()
{
int sx;
int sy;
WPoint average;
WPoint max;
const int rb_hite = 10; //height of a radio button
const int space = 10;
const int button_width = 50;
const int button_hite = 14;
setSystemFont( FALSE );
this->textMetrics( average, max );
sx = average.x() / 4;
sy = average.y() / 8;
WText* t1 = new WText( this, WRect( 7*sx, 2*sy, 164*sx, 9*sy ),
"Target name:" );
t1->show();
_eName = new WEditBox( this, WRect( 7*sx, 12*sy, 250*sx, 13*sy ), *_fn );
_eName->select();
_eName->show();
WPushButton* bBrowse = new WPushButton( this,
WRect( 265*sx, 11*sy, button_width * sx, button_hite * sy ),
"&Browse..." );
bBrowse->onClick( this, (cbw)&VCompDialog::browseButton );
bBrowse->show();
WText* t2 = new WText( this, WRect( 167*sx, 31*sy, 86*sx, 9*sy ),
"Image Type:" );
t2->show();
WRadioButton *button;
WRadioButton *checkedbutton;
int icount;
WStyle style;
MTarget *curtarg;
int i;
bool singletarg;
curtarg = NULL;
if( _comp != NULL ) {
WPickList& targets = _config->targets();
icount = targets.count();
for( i=0; i < icount; i++ ) {
curtarg = (MTarget *)targets[i];
if( curtarg->mask() == _comp->mask() ) break;
}
if( i == icount ) curtarg = NULL;
}
WVList &list = _config->targetOSs();
icount = list.count();
if( icount == 1 ) {
// use a static field instead of a radio button when there is
// only one target installed
singletarg = TRUE;
i = 0;
_cur_os = *(WString *)list[0];
WText* t3 = new WText( this, WRect( 11*sx, 41*sy, 135*sx, rb_hite * sy ),
_cur_os.gets() );
t3->show();
} else {
singletarg = FALSE;
for( i=0; i < icount; i ++ ) {
if( i == 0 ) {
if( icount == 1 ) {
style = RStyleRadioButton;
} else {
style = RStyleGroupFirst;
}
} else if( i == icount - 1 ) {
style = RStyleGroupLast;
} else {
style = RStyleRadioButton;
}
button = new WRadioButton( this,
WRect( 11*sx, ( 41 + rb_hite * i ) * sy, 135*sx, rb_hite * sy ),
( (WString *)list[i] )->gets(), style );
button->show();
button->onClick( this, (cbw)&VCompDialog::osButton );
if( curtarg == NULL ) {
if( i == 0 ) {
checkedbutton = button;
}
} else {
if( curtarg->targetOS() == *(WString *)list[i] ) {
checkedbutton = button;
}
}
}
}
WGroupBox *gbox;
//.........这里部分代码省略.........
开发者ID:jossk,项目名称:open-watcom-v2,代码行数:101,代码来源:vcompdlg.cpp
示例12: initialize
void WInputDialog::initialize() {
/*******************************/
WPoint avg;
WPoint max;
textMetrics( avg, max );
int sp = max.x();
int x = WSystemMetrics::dialogFrameWidth();
int y = WSystemMetrics::dialogFrameHeight();
int p_w = 0;
int p_h = 0;
updateExtents( _promptText, &p_w, &p_h );
p_w += avg.x() / 2;
p_h += avg.y() / 2;
int r_w = 32 * avg.x();
int r_h = max.y() + 2*max.y() / 3;
updateExtents( *_reply, &r_w, &r_h );
_prompt = new WText( this, WRect( x, y + (r_h - p_h)/2, p_w, p_h ), _promptText );
_prompt->show();
_input = new WEditBox( this, WRect( x + p_w + sp, y, r_w, r_h ), *_reply );
_input->show();
y += p_h + max.y();
int b_w = 0;
int b_h = 0;
updateExtents( BrowseText, &b_w, &b_h );
updateExtents( CancelText, &b_w, &b_h );
updateExtents( OKText, &b_w, &b_h );
b_w += avg.x() * 2;
b_h += avg.y() / 2;
WDefPushButton *bOk = new WDefPushButton( this, WRect( x, y, b_w, b_h ),
OKText );
bOk->onClick( this, (cbw)&WInputDialog::okButton );
bOk->show();
x += b_w + max.x();
WPushButton *bCancel = new WPushButton( this, WRect( x, y, b_w, b_h ),
CancelText );
bCancel->onClick( this, (cbw)&WInputDialog::cancelButton );
bCancel->show();
x += b_w + max.x();
if( _browseDialog ) {
WPushButton *bBrowse = new WPushButton( this,
WRect( x, y, b_w, b_h ),
BrowseText );
bBrowse->onClick( this, (cbw)&WInputDialog::browseButton );
bBrowse->show();
}
shrink();
centre();
_input->select();
_input->setFocus();
show();
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:60,代码来源:winpdlg.cpp
注:本文中的WPoint类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论