本文整理汇总了C++中SetTitle函数的典型用法代码示例。如果您正苦于以下问题:C++ SetTitle函数的具体用法?C++ SetTitle怎么用?C++ SetTitle使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetTitle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxGetApp
// show task properties
//
void CDlgItemProperties::renderInfos(RESULT* result) {
CMainDocument* pDoc = wxGetApp().GetDocument();
wxDateTime dt;
wxString wxTitle = _("Properties of task ");
wxTitle.append(wxString(result->name, wxConvUTF8));
SetTitle(wxTitle);
APP_VERSION* avp = NULL;
WORKUNIT* wup = NULL;
RESULT* r = pDoc->state.lookup_result(result->project_url, result->name);
if (r) {
avp = r->avp;
wup = r->wup;
}
addProperty(_("Application"), FormatApplicationName(result));
addProperty(_("Name"), wxString(result->wu_name, wxConvUTF8));
addProperty(_("State"), result_description(result, false));
if (result->received_time) {
dt.Set((time_t)result->received_time);
addProperty(_("Received"), dt.Format());
}
dt.Set((time_t)result->report_deadline);
addProperty(_("Report deadline"), dt.Format());
if (strlen(result->resources)) {
addProperty(_("Resources"), wxString(result->resources, wxConvUTF8));
}
if (wup) {
addProperty(_("Estimated computation size"), wxString::Format(wxT("%.0f GFLOPs"), wup->rsc_fpops_est/1e9));
}
if (result->active_task) {
addProperty(_("CPU time at last checkpoint"), FormatTime(result->checkpoint_cpu_time));
addProperty(_("CPU time"), FormatTime(result->current_cpu_time));
if (result->elapsed_time >= 0) {
addProperty(_("Elapsed time"), FormatTime(result->elapsed_time));
}
addProperty(_("Estimated time remaining"), FormatTime(result->estimated_cpu_time_remaining));
addProperty(_("Fraction done"), wxString::Format(wxT("%.3f %%"), result->fraction_done*100));
addProperty(_("Virtual memory size"), FormatDiskSpace(result->swap_size));
addProperty(_("Working set size"), FormatDiskSpace(result->working_set_size_smoothed));
if (result->slot >= 0) {
addProperty(_("Directory"), wxString::Format(wxT("slots/%d"), result->slot));
}
if (result->pid) {
addProperty(_("Process ID"), wxString::Format(wxT("%d"), result->pid));
}
if (result->progress_rate) {
// express rate in the largest time unit (hr/min/sec) for which rate < 100%
//
if (result->progress_rate*3600 < 1) {
addProperty(_("Progress rate"), wxString::Format(wxT("%f %% %s"), 100*3600*result->progress_rate, _("per hour")));
} else if (result->progress_rate*60 < 1) {
addProperty(_("Progress rate"), wxString::Format(wxT("%f %% %s"), 100*60*result->progress_rate, _("per minute")));
} else {
addProperty(_("Progress rate"), wxString::Format(wxT("%f %% %s"), 100*result->progress_rate, _("per second")));
}
}
} else if (result->state >= RESULT_COMPUTE_ERROR) {
addProperty(_("CPU time"), FormatTime(result->final_cpu_time));
addProperty(_("Elapsed time"), FormatTime(result->final_elapsed_time));
}
if (avp) {
addProperty(_("Executable"), wxString(avp->exec_filename, wxConvUTF8));
}
m_gbSizer->Layout();
m_scrolledWindow->FitInside();
}
示例2: switch
void
PersonWindow::MessageReceived(BMessage* msg)
{
char str[256];
BDirectory directory;
BEntry entry;
BFile file;
BNodeInfo *node;
switch (msg->what) {
case M_SAVE:
if (!fRef) {
SaveAs();
break;
}
// supposed to fall through
case M_REVERT:
case M_SELECT:
fView->MessageReceived(msg);
break;
case M_SAVE_AS:
SaveAs();
break;
case B_UNDO: // fall through
case B_CUT:
case B_COPY:
case B_PASTE:
{
BView* view = CurrentFocus();
if (view != NULL)
view->MessageReceived(msg);
break;
}
case B_SAVE_REQUESTED:
{
entry_ref dir;
if (msg->FindRef("directory", &dir) == B_OK) {
const char* name = NULL;
msg->FindString("name", &name);
directory.SetTo(&dir);
if (directory.InitCheck() == B_NO_ERROR) {
directory.CreateFile(name, &file);
if (file.InitCheck() == B_NO_ERROR) {
node = new BNodeInfo(&file);
node->SetType("application/x-person");
delete node;
directory.FindEntry(name, &entry);
entry.GetRef(&dir);
_SetToRef(new entry_ref(dir));
SetTitle(fRef->name);
fView->CreateFile(fRef);
}
else {
sprintf(str, B_TRANSLATE("Could not create %s."), name);
BAlert* alert = new BAlert("", str, B_TRANSLATE("Sorry"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
}
}
}
break;
}
case B_NODE_MONITOR:
{
int32 opcode;
if (msg->FindInt32("opcode", &opcode) == B_OK) {
switch (opcode) {
case B_ENTRY_REMOVED:
// We lost our file. Close the window.
PostMessage(B_QUIT_REQUESTED);
break;
case B_ENTRY_MOVED:
{
// We may have renamed our entry. Obtain relevant data
// from message.
BString name;
msg->FindString("name", &name);
int64 directory;
msg->FindInt64("to directory", &directory);
int32 device;
msg->FindInt32("device", &device);
// Update our ref.
delete fRef;
fRef = new entry_ref(device, directory, name.String());
// And our window title.
SetTitle(name);
// If moved to Trash, close window.
BVolume volume(device);
BPath trash;
//.........这里部分代码省略.........
示例3: GetAbbreviatedUnitsLabel
bool DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::TransferDataToWindow()
{
// Set unit symbol
wxStaticText* texts_unit[] =
{
m_StartPointXUnit,
m_StartPointYUnit,
m_EndPointXUnit,
m_EndPointYUnit,
m_ThicknessTextUnit,
m_DefaulThicknessTextUnit,
};
for( size_t ii = 0; ii < DIM( texts_unit ); ii++ )
{
texts_unit[ii]->SetLabel( GetAbbreviatedUnitsLabel() );
}
wxString msg;
// Change texts according to the segment shape:
switch( m_item->GetShape() )
{
case S_CIRCLE:
SetTitle( _( "Circle Properties" ) );
m_StartPointXLabel->SetLabel( _( "Center X" ) );
m_StartPointYLabel->SetLabel( _( "Center Y" ) );
m_EndPointXLabel->SetLabel( _( "Point X" ) );
m_EndPointYLabel->SetLabel( _( "Point Y" ) );
m_AngleText->Show( false );
m_AngleCtrl->Show( false );
m_AngleUnit->Show( false );
break;
case S_ARC:
SetTitle( _( "Arc Properties" ) );
m_StartPointXLabel->SetLabel( _( "Center X" ) );
m_StartPointYLabel->SetLabel( _( "Center Y" ) );
m_EndPointXLabel->SetLabel( _( "Start Point X" ) );
m_EndPointYLabel->SetLabel( _( "Start Point Y" ) );
m_AngleValue = m_item->GetAngle() / 10.0;
break;
case S_SEGMENT:
SetTitle( _( "Line Segment Properties" ) );
// Fall through.
default:
m_AngleText->Show( false );
m_AngleCtrl->Show( false );
m_AngleUnit->Show( false );
break;
}
PutValueInLocalUnits( *m_Center_StartXCtrl, m_item->GetStart().x );
PutValueInLocalUnits( *m_Center_StartYCtrl, m_item->GetStart().y );
PutValueInLocalUnits( *m_EndX_Radius_Ctrl, m_item->GetEnd().x );
PutValueInLocalUnits( *m_EndY_Ctrl, m_item->GetEnd().y );
PutValueInLocalUnits( *m_ThicknessCtrl, m_item->GetWidth() );
PutValueInLocalUnits( *m_DefaultThicknessCtrl, m_brdSettings.m_ModuleSegmentWidth );
// Configure the layers list selector
m_LayerSelectionCtrl->SetLayersHotkeys( false );
m_LayerSelectionCtrl->SetLayerSet( LSET::InternalCuMask().set( Edge_Cuts ) );
m_LayerSelectionCtrl->SetBoardFrame( m_parent );
m_LayerSelectionCtrl->Resync();
if( m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() ) < 0 )
{
wxMessageBox( _( "This item was on an unknown layer.\n"
"It has been moved to the front silk screen layer. Please fix it." ) );
m_LayerSelectionCtrl->SetLayerSelection( F_SilkS );
}
return DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::TransferDataToWindow();
}
示例4: wxGetApp
bool CDlgEventLog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin CDlgEventLog member initialisation
CMainDocument* pDoc = wxGetApp().GetDocument();
wxASSERT(pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
m_iPreviousRowCount = 0;
m_iTotalDocCount = 0;
m_iPreviousFirstMsgSeqNum = pDoc->GetFirstMsgSeqNum();
m_iPreviousLastMsgSeqNum = m_iPreviousFirstMsgSeqNum - 1;
m_iNumDeletedFilteredRows = 0;
m_iTotalDeletedFilterRows = 0;
if (!s_bIsFiltered) {
s_strFilteredProjectName.clear();
}
m_iFilteredIndexes.Clear();
m_bProcessingRefreshEvent = false;
m_bWasConnected = false;
m_bEventLogIsOpen = true;
////@end CDlgEventLog member initialisation
CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
wxPoint oTempPoint;
wxSize oTempSize;
wxASSERT(pSkinAdvanced);
wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));
if ((pos == wxDefaultPosition) && (size == wxDefaultSize)) {
// Get size and position from the previous configuration
GetWindowDimensions( oTempPoint, oTempSize );
#ifdef __WXMSW__
// Get the current display space for the current window
int iDisplay = wxNOT_FOUND;
if ( wxGetApp().GetFrame() != NULL )
iDisplay = wxDisplay::GetFromWindow(wxGetApp().GetFrame());
if ( iDisplay == wxNOT_FOUND )
iDisplay = 0;
wxDisplay *display = new wxDisplay(iDisplay);
wxRect rDisplay = display->GetClientArea();
// Check that the saved height and width is not larger than the displayable space.
// If it is, then reduce the size.
if ( oTempSize.GetWidth() > rDisplay.width ) oTempSize.SetWidth(rDisplay.width);
if ( oTempSize.GetHeight() > rDisplay.height ) oTempSize.SetHeight(rDisplay.height);
// Check if part of the display was going to be off the screen, if so, center the
// display on that axis
if ( oTempPoint.x < rDisplay.x ) {
oTempPoint.x = rDisplay.x;
} else if ( oTempPoint.x + oTempSize.GetWidth() > rDisplay.x + rDisplay.width ) {
oTempPoint.x = rDisplay.x + rDisplay.width - oTempSize.GetWidth();
}
if ( oTempPoint.y < rDisplay.y ) {
oTempPoint.y = rDisplay.y;
} else if ( oTempPoint.y + oTempSize.GetHeight() > rDisplay.y + rDisplay.height ) {
oTempPoint.y = rDisplay.y + rDisplay.height - oTempSize.GetHeight();
}
delete display;
#endif
#ifdef __WXMAC__
// If the user has changed the arrangement of multiple
// displays, make sure the window title bar is still on-screen.
if (!IsWindowOnScreen(oTempPoint.x, oTempPoint.y, oTempSize.GetWidth(), oTempSize.GetHeight())) {
oTempPoint.y = oTempPoint.x = 30;
}
#endif // ! __WXMAC__
} else {
oTempPoint = pos;
oTempSize = size;
}
DlgEventLogBase::Create( parent, id, caption, oTempPoint, oTempSize, style );
SetSizeHints(DLGEVENTLOG_MIN_WIDTH, DLGEVENTLOG_MIN_HEIGHT);
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
// Initialize Application Title
wxString strCaption = caption;
if (strCaption.IsEmpty()) {
strCaption.Printf(_("%s - Event Log"), pSkinAdvanced->GetApplicationName().c_str());
}
SetTitle(strCaption);
// Initialize Application Icon
SetIcons(*pSkinAdvanced->GetApplicationIcon());
CreateControls();
// Create List Pane Items
m_pList->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 109);
m_pList->InsertColumn(COLUMN_TIME, _("Time"), wxLIST_FORMAT_LEFT, 130);
m_pList->InsertColumn(COLUMN_MESSAGE, _("Message"), wxLIST_FORMAT_LEFT, 378);
//.........这里部分代码省略.........
示例5: SetTitle
CStaticText::CStaticText(const int vx,const int vy,const int vw,const int vh,CWnd* vowner,const PCHAR text)
:CWnd(NULL,vx,vy,vw,vh,vowner)
{
SetTitle(text);
canfocus=FALSE;
}
示例6: SetTitle
void PowerManDlg::initLabels() {
TraceOp.trc( "boosterdlg", TRCLEVEL_INFO, __LINE__, 9999, "initLabels" );
SetTitle(wxGetApp().getMsg( "boostertable" ));
m_BoosterBook->SetPageText( 0, wxGetApp().getMsg( "index" ) );
m_BoosterBook->SetPageText( 1, wxGetApp().getMsg( "general" ) );
m_BoosterBook->SetPageText( 2, wxGetApp().getMsg( "modules" ) );
m_BoosterBook->SetPageText( 3, wxGetApp().getMsg( "blocks" ) );
m_BoosterBook->SetPageText( 4, wxGetApp().getMsg( "details" ) );
// Index
m_AddBooster->SetLabel( wxGetApp().getMsg( "new" ) );
m_DelBooster->SetLabel( wxGetApp().getMsg( "delete" ) );
m_AddModule->SetLabel( wxGetApp().getMsg( "add" ) );
m_DelModule->SetLabel( wxGetApp().getMsg( "delete" ) );
m_AddBlock->SetLabel( wxGetApp().getMsg( "add" ) );
m_DelBlock->SetLabel( wxGetApp().getMsg( "delete" ) );
m_BoosterList->InsertColumn(0, wxGetApp().getMsg( "id" ), wxLIST_FORMAT_LEFT );
m_BoosterList->InsertColumn(1, wxGetApp().getMsg( "powerdistrict" ), wxLIST_FORMAT_LEFT );
m_BoosterList->InsertColumn(2, wxGetApp().getMsg( "uid" ), wxLIST_FORMAT_LEFT );
// General
m_labID->SetLabel( wxGetApp().getMsg( "id" ) );
m_labIID->SetLabel( wxGetApp().getMsg( "iid" ) );
m_labDistrict->SetLabel( wxGetApp().getMsg( "powerdistrict" ) );
iONode model = wxGetApp().getModel();
iOList list = ListOp.inst();
if( model != NULL ) {
int cnt = 0;
iONode bklist = wPlan.getbklist( model );
iONode sblist = wPlan.getsblist( model );
iONode ttlist = wPlan.getttlist( model );
iONode fylist = wPlan.getseltablist( model );
if( bklist != NULL ) {
cnt = NodeOp.getChildCnt( bklist );
for( int i = 0; i < cnt; i++ ) {
iONode bk = NodeOp.getChild( bklist, i );
ListOp.add(list, (obj)wItem.getid( bk ));
}
}
if( sblist != NULL ) {
cnt = NodeOp.getChildCnt( sblist );
for( int i = 0; i < cnt; i++ ) {
iONode sb = NodeOp.getChild( sblist, i );
ListOp.add(list, (obj)wItem.getid( sb ));
}
}
if( ttlist != NULL ) {
cnt = NodeOp.getChildCnt( ttlist );
for( int i = 0; i < cnt; i++ ) {
iONode tt = NodeOp.getChild( ttlist, i );
ListOp.add(list, (obj)wItem.getid( tt ));
}
}
if( fylist != NULL ) {
cnt = NodeOp.getChildCnt( fylist );
for( int i = 0; i < cnt; i++ ) {
iONode fy = NodeOp.getChild( fylist, i );
ListOp.add(list, (obj)wItem.getid( fy ));
}
}
ListOp.sort(list, &__sortStr);
cnt = ListOp.size( list );
for( int i = 0; i < cnt; i++ ) {
const char* id = (const char*)ListOp.get( list, i );
m_BlocksCombo->Append( wxString(id,wxConvUTF8) );
}
}
/* clean up the temp. list */
ListOp.base.del(list);
list = ListOp.inst();
if( model != NULL ) {
iONode fblist = wPlan.getfblist( model );
if( fblist != NULL ) {
int cnt = NodeOp.getChildCnt( fblist );
for( int i = 0; i < cnt; i++ ) {
iONode fb = NodeOp.getChild( fblist, i );
const char* id = wFeedback.getid( fb );
if( id != NULL ) {
ListOp.add(list, (obj)id);
}
}
m_ShortcutSensor->Append( _T("-") );
m_PowerSensor->Append( _T("-") );
ListOp.sort(list, &__sortStr);
cnt = ListOp.size( list );
for( int i = 0; i < cnt; i++ ) {
const char* id = (const char*)ListOp.get( list, i );
m_ShortcutSensor->Append( wxString(id,wxConvUTF8) );
m_PowerSensor->Append( wxString(id,wxConvUTF8) );
}
}
}
/* clean up the temp. list */
ListOp.base.del(list);
//.........这里部分代码省略.........
示例7: resetHistory
void CMyPaintDoc::init() {
resetHistory();
SetTitle(s_defaultName);
CHECKINVARIANT;
}
示例8: RecalculateSize
TCWin::TCWin( ChartCanvas *parent, int x, int y, void *pvIDX )
{
// As a display optimization....
// if current color scheme is other than DAY,
// Then create the dialog ..WITHOUT.. borders and title bar.
// This way, any window decorations set by external themes, etc
// will not detract from night-vision
m_created = false;
xSpot = 0;
ySpot = 0;
m_pTCRolloverWin = NULL;
long wstyle = wxCLIP_CHILDREN | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ;
if( ( global_color_scheme != GLOBAL_COLOR_SCHEME_DAY )
&& ( global_color_scheme != GLOBAL_COLOR_SCHEME_RGB ) ) wstyle |= ( wxNO_BORDER );
#ifdef __WXOSX__
wstyle |= wxSTAY_ON_TOP;
#endif
pParent = parent;
m_x = x;
m_y = y;
RecalculateSize();
wxDialog::Create( parent, wxID_ANY, wxString( _T ( "" ) ), m_position ,
m_tc_size, wstyle );
m_created = true;
wxFont *qFont = GetOCPNScaledFont(_("Dialog"));
SetFont( *qFont );
pIDX = (IDX_entry *) pvIDX;
gpIDXn++;
// Set up plot type
if( strchr( "Tt", pIDX->IDX_type ) ) {
m_plot_type = TIDE_PLOT;
SetTitle( wxString( _( "Tide" ) ) );
gpIDX = pIDX; // remember pointer for routeplan
} else {
m_plot_type = CURRENT_PLOT;
SetTitle( wxString( _( "Current" ) ) );
}
int sx, sy;
GetClientSize( &sx, &sy );
// Figure out this computer timezone minute offset
wxDateTime this_now = gTimeSource;
bool cur_time = !gTimeSource.IsValid();
if (cur_time) {
this_now = wxDateTime::Now();
}
wxDateTime this_gmt = this_now.ToGMT();
#if wxCHECK_VERSION(2, 6, 2)
wxTimeSpan diff = this_now.Subtract( this_gmt );
#else
wxTimeSpan diff = this_gmt.Subtract ( this_now );
#endif
int diff_mins = diff.GetMinutes();
// Correct a bug in wx3.0.2
// If the system TZ happens to be GMT, with DST active (e.g.summer in London),
// then wxDateTime returns incorrect results for toGMT() method
#if wxCHECK_VERSION(3, 0, 2)
if( diff_mins == 0 && this_now.IsDST() )
diff_mins +=60;
#endif
int station_offset = ptcmgr->GetStationTimeOffset( pIDX );
m_corr_mins = station_offset - diff_mins;
if( this_now.IsDST() ) m_corr_mins += 60;
// Establish the inital drawing day as today
m_graphday = this_now;
wxDateTime graphday_00 = this_now;
graphday_00.ResetTime();
time_t t_graphday_00 = graphday_00.GetTicks();
// Correct a Bug in wxWidgets time support
if( !graphday_00.IsDST() && m_graphday.IsDST() ) t_graphday_00 -= 3600;
if( graphday_00.IsDST() && !m_graphday.IsDST() ) t_graphday_00 += 3600;
m_t_graphday_00_at_station = t_graphday_00 - ( m_corr_mins * 60 );
btc_valid = false;
wxString* TClist = NULL;
//.........这里部分代码省略.........
示例9: SET_ARGB
LTBOOL CMenuPlayer::Init()
{
m_MenuID = MENU_ID_PLAYER;
s_pSklMenu = this;
if (!CBaseMenu::Init()) return LTFALSE;
int nNameWidth = g_pLayoutMgr->GetMenuCustomInt(m_MenuID,"NameWidth");
int nLevelWidth = g_pLayoutMgr->GetMenuCustomInt(m_MenuID,"LevelWidth");
int nUpgradeWidth = s_Size.x - ( (m_Indent.x * 2) + nNameWidth + nLevelWidth);
LTVector vColor = g_pLayoutMgr->GetMenuCustomVector(m_MenuID,"HighlightColor");
uint8 nA = 255;
uint8 nR = (uint8)vColor.x;
uint8 nG = (uint8)vColor.y;
uint8 nB = (uint8)vColor.z;
skillHighlightColor= SET_ARGB(nA,nR,nG,nB);
uint8 nSmallerFont = (uint8)g_pLayoutMgr->GetMenuCustomInt(m_MenuID,"SmallerFontSize");
SetTitle(IDS_TITLE_SUMMARY);
LTIntPt popupSize = g_pLayoutMgr->GetMenuCustomPoint(m_MenuID,"PopupSize");
m_Popup.Init(s_Frame,s_FrameTip,popupSize);
m_Popup.m_bWaitForUpdate = LTFALSE;
LTIntPt offset = m_Indent;
offset.y = 8;
CUIFont* pFont = g_pInterfaceResMgr->GetFont(m_TitleFontFace);
m_Name.Create("name",LTNULL,LTNULL,pFont,m_TitleFontSize,LTNULL);
m_Name.SetColors(m_NonSelectedColor,m_NonSelectedColor,m_NonSelectedColor);
m_Name.Enable(LTFALSE);
m_Popup.AddControl(&m_Name,offset);
offset.y += (m_Name.GetHeight() + 4);
pFont = g_pInterfaceResMgr->GetFont(m_FontFace);
m_Level.Create("level",LTNULL,LTNULL,pFont,m_FontSize,LTNULL);
m_Level.SetColors(m_NonSelectedColor,m_NonSelectedColor,m_NonSelectedColor);
m_Level.Enable(LTFALSE);
m_Popup.AddControl(&m_Level,offset);
offset.y += (m_Level.GetHeight() + 12);
m_Header.Create(LTNULL,LTNULL,pFont,m_FontSize, LTNULL);
m_Header.AddColumn(" ",nNameWidth);
m_Header.AddColumn(LoadTempString(IDS_CURRENT),60);
m_Header.AddColumn(LoadTempString(IDS_UPGRADE),60);
m_Header.SetColors(m_NonSelectedColor,m_NonSelectedColor,m_NonSelectedColor);
m_Header.Enable(LTFALSE);
m_Popup.AddControl(&m_Header,offset);
offset.y += (m_Header.GetHeight() + 2);
for (uint8 m = 0; m < kMaxModifiers; ++m)
{
m_Mods[m].Create(LTNULL,LTNULL,pFont,m_FontSize,LTNULL);
m_Mods[m].AddColumn(" ",nNameWidth);
m_Mods[m].AddColumn("100",60);
m_Mods[m].AddColumn("100",60);
m_Mods[m].SetColors(skillHighlightColor,m_NonSelectedColor,m_DisabledColor);
m_Mods[m].Enable(LTTRUE);
m_Popup.AddControl(&m_Mods[m],offset);
offset.y += (m_Mods[m].GetHeight() + 2);
}
offset.y += 8;
m_Upgrade.Create("Upgrade",MC_UPGRADE,IDS_HELP_UPGRADE,pFont,m_FontSize,this);
m_Upgrade.SetColors(m_SelectedColor,m_NonSelectedColor,m_DisabledColor);
m_Popup.AddControl(&m_Upgrade,offset);
offset.y += (m_Upgrade.GetHeight() + 4);
m_Points.Create("avail",LTNULL,LTNULL,pFont,m_FontSize,LTNULL);
m_Points.SetColors(m_NonSelectedColor,m_NonSelectedColor,m_NonSelectedColor);
m_Points.SetFont(LTNULL,nSmallerFont);
m_Points.Enable(LTFALSE);
m_Popup.AddControl(&m_Points,offset);
uint8 nHelpFont = (uint8)g_pLayoutMgr->GetMenuCustomInt(m_MenuID,"HelpFontSize");
offset = g_pLayoutMgr->GetMenuCustomPoint(m_MenuID,"HelpOffset");
uint16 nWidth = 600 - 2* offset.x;
if (!nHelpFont)
nHelpFont = m_FontSize;
m_ModDesc.Create("description",LTNULL,LTNULL,pFont,nHelpFont,LTNULL);
m_ModDesc.SetColors(m_SelectedColor,m_SelectedColor,m_SelectedColor);
m_ModDesc.SetFixedWidth(nWidth);
m_ModDesc.Enable(LTFALSE);
m_Popup.AddControl(&m_ModDesc,offset);
int nPopupPos = g_pLayoutMgr->GetMenuCustomInt(m_MenuID,"PopupPos");
m_Popup.SetBasePos(LTIntPt(0,nPopupPos));
g_pInterfaceMgr->GetMenuMgr()->RegisterCommand(COMMAND_ID_STATUS,MENU_ID_PLAYER);
//Rank control
//.........这里部分代码省略.........
示例10: wxDisplaySize
bool wxFrame::Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
{
if( !wxTopLevelWindow::Create( parent, id, title, pos, size, style,
name ) )
return false;
m_backgroundColour =
wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE);
m_foregroundColour = *wxBLACK;
m_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
int x = pos.x, y = pos.y;
int width = size.x, height = size.y;
// Set reasonable values for position and size if defaults have been
// requested
//
// MB TODO: something better than these arbitrary values ?
// VZ should use X resources for this...
if ( width == -1 )
width = 400;
if ( height == -1 )
height = 400;
int displayW, displayH;
wxDisplaySize( &displayW, &displayH );
if ( x == -1 )
{
x = (displayW - width) / 2;
if (x < 10) x = 10;
}
if ( y == -1 )
{
y = (displayH - height) / 2;
if (y < 10) y = 10;
}
SetTitle( title );
wxLogTrace(wxTRACE_Messages,
"Created frame (0x%p) with work area 0x%p and client "
"area 0x%p", m_mainWidget, m_workArea, m_clientArea);
XtAddEventHandler((Widget) m_clientArea, ExposureMask,False,
wxUniversalRepaintProc, (XtPointer) this);
if (x > -1)
XtVaSetValues((Widget) m_frameShell, XmNx, x, NULL);
if (y > -1)
XtVaSetValues((Widget) m_frameShell, XmNy, y, NULL);
if (width > -1)
XtVaSetValues((Widget) m_frameShell, XmNwidth, width, NULL);
if (height > -1)
XtVaSetValues((Widget) m_frameShell, XmNheight, height, NULL);
ChangeFont(false);
ChangeBackgroundColour();
PreResize();
wxSize newSize(width, height);
wxSizeEvent sizeEvent(newSize, GetId());
sizeEvent.SetEventObject(this);
GetEventHandler()->ProcessEvent(sizeEvent);
return true;
}
示例11: Init
//.........这里部分代码省略.........
xattributes.bit_gravity = NorthWestGravity;
}
xattributes_mask |= CWEventMask;
xattributes.event_mask =
ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
ButtonMotionMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask |
KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask |
PropertyChangeMask;
Window xwindow = XCreateWindow( xdisplay, xparent, m_x, m_y, m_width, m_height,
0, DefaultDepth(xdisplay,xscreen), InputOutput, xvisual, xattributes_mask, &xattributes );
#else
long backColor, foreColor;
backColor = GR_RGB(m_backgroundColour.Red(), m_backgroundColour.Green(), m_backgroundColour.Blue());
foreColor = GR_RGB(m_foregroundColour.Red(), m_foregroundColour.Green(), m_foregroundColour.Blue());
Window xwindow = XCreateWindowWithColor( xdisplay, xparent, m_x, m_y, m_width, m_height,
0, 0, InputOutput, xvisual, backColor, foreColor);
#endif
m_mainWindow = (WXWindow) xwindow;
m_clientWindow = (WXWindow) xwindow;
wxAddWindowToTable( xwindow, (wxWindow*) this );
#if wxUSE_NANOX
XSelectInput( xdisplay, xwindow,
GR_EVENT_MASK_CLOSE_REQ |
ExposureMask |
KeyPressMask |
KeyReleaseMask |
ButtonPressMask |
ButtonReleaseMask |
ButtonMotionMask |
EnterWindowMask |
LeaveWindowMask |
PointerMotionMask |
KeymapStateMask |
FocusChangeMask |
ColormapChangeMask |
StructureNotifyMask |
PropertyChangeMask
);
#endif
// Set background to None which will prevent X11 from clearing the
// background completely.
XSetWindowBackgroundPixmap( xdisplay, xwindow, None );
#if !wxUSE_NANOX
if (HasFlag( wxSTAY_ON_TOP ))
{
Window xroot = RootWindow( xdisplay, xscreen );
XSetTransientForHint( xdisplay, xwindow, xroot );
}
else
{
if (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)
{
if (GetParent() && GetParent()->X11GetMainWindow())
{
Window xparentwindow = (Window) GetParent()->X11GetMainWindow();
XSetTransientForHint( xdisplay, xwindow, xparentwindow );
}
}
}
XSizeHints size_hints;
size_hints.flags = PSize | PPosition | PWinGravity;
size_hints.x = m_x;
size_hints.y = m_y;
size_hints.width = m_width;
size_hints.height = m_height;
size_hints.win_gravity = NorthWestGravity;
XSetWMNormalHints( xdisplay, xwindow, &size_hints);
XWMHints wm_hints;
wm_hints.flags = InputHint | StateHint;
if (GetParent())
{
wm_hints.flags |= WindowGroupHint;
wm_hints.window_group = (Window) GetParent()->X11GetMainWindow();
}
wm_hints.input = True;
wm_hints.initial_state = NormalState;
XSetWMHints( xdisplay, xwindow, &wm_hints);
Atom wm_protocols[2];
wm_protocols[0] = XInternAtom( xdisplay, "WM_DELETE_WINDOW", False );
wm_protocols[1] = XInternAtom( xdisplay, "WM_TAKE_FOCUS", False );
XSetWMProtocols( xdisplay, xwindow, wm_protocols, 2);
#endif
wxSetWMDecorations( xwindow, style);
SetTitle(title);
return true;
}
示例12: SetTitle
void QuickView::SetFocus()
{
Panel::SetFocus();
SetTitle();
}
示例13: BWindow
//.........这里部分代码省略.........
if(marked)
marked->SetMarked(true);
}
r.OffsetBy(0,r.Height() + 10);
fNameBox = new AutoTextControl(r,"namebox","Name: ",NULL,NULL,
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP,
B_WILL_DRAW | B_PULSE_NEEDED | B_NAVIGABLE |
B_NAVIGABLE_JUMP);
fNameBox->SetEscapeCancel(true);
fNameBox->SetDivider(be_plain_font->StringWidth("Name ") + 5);
back->AddChild(fNameBox);
fNameBox->ResizeToPreferred();
r = fNameBox->Frame();
r.right = Bounds().right - 10;
fNameBox->ResizeTo(r.Width(), r.Height());
r.OffsetBy(0,r.Height() + 10);
BStringView *label = new BStringView(r,"inglabel","Ingredients:");
back->AddChild(label);
r.OffsetBy(0,r.Height() + 10);
r.bottom = r.top + 100;
r.right -= B_V_SCROLL_BAR_WIDTH;
BRect textrect = r.OffsetToCopy(0,0);
textrect.InsetBy(10,10);
fIngredientBox = new BTextView(r, "ingredients", textrect, B_FOLLOW_ALL,
B_WILL_DRAW | B_PULSE_NEEDED | B_NAVIGABLE |
B_NAVIGABLE_JUMP);
fIngredientBox->SetDoesUndo(true);
BScrollView *ingredscroll = new BScrollView("ingredients_scroller",fIngredientBox,
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP,0,false, true);
back->AddChild(ingredscroll);
r = ingredscroll->Frame();
label = new BStringView(BRect(10,10,11,11),"dirlabel","Directions:");
label->ResizeToPreferred();
label->MoveTo(10, r.bottom + 10);
back->AddChild(label);
r.OffsetBy(0,r.Height() + 20 + label->Frame().Height());
r.right -= B_V_SCROLL_BAR_WIDTH;
textrect = r.OffsetToCopy(0,0);
textrect.InsetBy(10,10);
fDirectionsBox = new BTextView(r, "directions", textrect, B_FOLLOW_ALL,
B_WILL_DRAW | B_PULSE_NEEDED | B_NAVIGABLE |
B_NAVIGABLE_JUMP);
fDirectionsBox->SetDoesUndo(true);
BScrollView *dirscroll = new BScrollView("directions_scroller",fDirectionsBox,
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP,0,false, true);
back->AddChild(dirscroll);
fOK = new BButton(BRect(10,10,11,11),"ok","Cancel", new BMessage(M_ADD_RECIPE),
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM, B_WILL_DRAW);
fOK->ResizeToPreferred();
fOK->SetLabel("OK");
fOK->MoveTo(Bounds().right - fOK->Bounds().Width() - 10,
Bounds().bottom - fOK->Bounds().Height() - 10);
r = fOK->Frame();
back->AddChild(fOK);
r.OffsetBy(-r.Width() - 10, 0);
fCancel = new BButton(r,"cancel","Cancel",new BMessage(B_QUIT_REQUESTED),
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM, B_WILL_DRAW);
back->AddChild(fCancel);
field->MakeFocus(true);
ResizeTo(Bounds().Width(),
fDirectionsBox->Parent()->Frame().bottom + 20 + fOK->Bounds().Height());
dirscroll->SetResizingMode(B_FOLLOW_ALL);
// This is the part that's different for editing a recipe as opposed to
// just adding one to the database
if(number >= 0 && category)
{
SetTitle("Edit Recipe");
BString name, ingredients, directions;
if(GetRecipe(number,category,name,ingredients,directions))
{
BMenuItem *item = fCategories->FindItem(category);
if(item)
item->SetMarked(true);
fNameBox->SetText(name.String());
fIngredientBox->SetText(ingredients.String());
fDirectionsBox->SetText(directions.String());
fOK->SetMessage(new BMessage(M_EDIT_RECIPE));
}
}
AddShortcut(B_ENTER, B_COMMAND_KEY, new BMessage(fOK->Command()));
}
示例14: do_QueryInterface
void
nsMediaDocument::UpdateTitleAndCharset(const nsACString& aTypeStr,
const char* const* aFormatNames,
PRInt32 aWidth, PRInt32 aHeight,
const nsAString& aStatus)
{
nsXPIDLString fileStr;
if (mDocumentURI) {
nsCAutoString fileName;
nsCOMPtr<nsIURL> url = do_QueryInterface(mDocumentURI);
if (url)
url->GetFileName(fileName);
nsCAutoString docCharset;
// Now that the charset is set in |StartDocumentLoad| to the charset of
// the document viewer instead of a bogus value ("ISO-8859-1" set in
// |nsDocument|'s ctor), the priority is given to the current charset.
// This is necessary to deal with a media document being opened in a new
// window or a new tab, in which case |originCharset| of |nsIURI| is not
// reliable.
if (mCharacterSetSource != kCharsetUninitialized) {
docCharset = mCharacterSet;
}
else {
// resort to |originCharset|
mDocumentURI->GetOriginCharset(docCharset);
SetDocumentCharacterSet(docCharset);
}
if (!fileName.IsEmpty()) {
nsresult rv;
nsCOMPtr<nsITextToSubURI> textToSubURI =
do_GetService(NS_ITEXTTOSUBURI_CONTRACTID, &rv);
if (NS_SUCCEEDED(rv))
// UnEscapeURIForUI always succeeds
textToSubURI->UnEscapeURIForUI(docCharset, fileName, fileStr);
else
CopyUTF8toUTF16(fileName, fileStr);
}
}
NS_ConvertASCIItoUTF16 typeStr(aTypeStr);
nsXPIDLString title;
if (mStringBundle) {
// if we got a valid size (not all media have a size)
if (aWidth != 0 && aHeight != 0) {
nsAutoString widthStr;
nsAutoString heightStr;
widthStr.AppendInt(aWidth);
heightStr.AppendInt(aHeight);
// If we got a filename, display it
if (!fileStr.IsEmpty()) {
const PRUnichar *formatStrings[4] = {fileStr.get(), typeStr.get(),
widthStr.get(), heightStr.get()};
NS_ConvertASCIItoUTF16 fmtName(aFormatNames[eWithDimAndFile]);
mStringBundle->FormatStringFromName(fmtName.get(), formatStrings, 4,
getter_Copies(title));
}
else {
const PRUnichar *formatStrings[3] = {typeStr.get(), widthStr.get(),
heightStr.get()};
NS_ConvertASCIItoUTF16 fmtName(aFormatNames[eWithDim]);
mStringBundle->FormatStringFromName(fmtName.get(), formatStrings, 3,
getter_Copies(title));
}
}
else {
// If we got a filename, display it
if (!fileStr.IsEmpty()) {
const PRUnichar *formatStrings[2] = {fileStr.get(), typeStr.get()};
NS_ConvertASCIItoUTF16 fmtName(aFormatNames[eWithFile]);
mStringBundle->FormatStringFromName(fmtName.get(), formatStrings, 2,
getter_Copies(title));
}
else {
const PRUnichar *formatStrings[1] = {typeStr.get()};
NS_ConvertASCIItoUTF16 fmtName(aFormatNames[eWithNoInfo]);
mStringBundle->FormatStringFromName(fmtName.get(), formatStrings, 1,
getter_Copies(title));
}
}
}
// set it on the document
if (aStatus.IsEmpty()) {
SetTitle(title);
}
else {
nsXPIDLString titleWithStatus;
const nsPromiseFlatString& status = PromiseFlatString(aStatus);
const PRUnichar *formatStrings[2] = {title.get(), status.get()};
NS_NAMED_LITERAL_STRING(fmtName, "TitleWithStatus");
mStringBundle->FormatStringFromName(fmtName.get(), formatStrings, 2,
getter_Copies(titleWithStatus));
SetTitle(titleWithStatus);
}
}
示例15: ExternProcessDialog
frmBackupServer::frmBackupServer(frmMain *form, pgObject *obj) : ExternProcessDialog(form)
{
object = obj;
wxWindowBase::SetFont(settings->GetSystemFont());
LoadResource(form, wxT("frmBackupServer"));
RestorePosition();
SetTitle(object->GetTranslatedMessage(BACKUPSERVERTITLE));
pgServer *server = (pgServer *)object;
if (server->GetConnection()->EdbMinimumVersion(8, 0))
backupExecutable = edbBackupAllExecutable;
else if (server->GetConnection()->GetIsGreenplum())
backupExecutable = gpBackupAllExecutable;
else
backupExecutable = pgBackupAllExecutable;
wxString val;
settings->Read(wxT("frmBackupServer/LastFile"), &val, wxEmptyString);
txtFilename->SetValue(val);
bool roles_supported = pgAppMinimumVersion(backupExecutable, 8, 4) && server->GetConnection()->BackendMinimumVersion(8, 1);
cbRolename->Enable(roles_supported);
if (roles_supported)
{
// Collect the available rolenames
pgSetIterator set(server->GetConnection(),
wxT("SELECT DISTINCT rolname\n")
wxT("FROM pg_roles db\n")
wxT("ORDER BY rolname"));
cbRolename->Append(wxEmptyString);
while(set.RowsLeft())
cbRolename->Append(set.GetVal(wxT("rolname")));
cbRolename->SetValue(server->GetRolename());
}
if (!server->GetPasswordIsStored())
environment.Add(wxT("PGPASSWORD=") + server->GetPassword());
// Pass the SSL mode via the environment
environment.Add(wxT("PGSSLMODE=") + server->GetConnection()->GetSslModeName());
// Icon
SetIcon(*backup_png_ico);
txtMessages = CTRL_TEXT("txtMessages");
txtMessages->SetMaxLength(0L);
btnOK->Disable();
if (!pgAppMinimumVersion(backupExecutable, 9, 1))
{
chkForceQuoteForIdent->Disable();
}
wxCommandEvent ev;
OnChange(ev);
}