本文整理汇总了C++中Refresh函数的典型用法代码示例。如果您正苦于以下问题:C++ Refresh函数的具体用法?C++ Refresh怎么用?C++ Refresh使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Refresh函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Open
//.........这里部分代码省略.........
coord = GetLargestConsoleWindowSize(hstdout);
msg_Dbg(vd, "SetConsoleWindowInfo: %ix%i", coord.X, coord.Y);
/* Force size for now */
coord.X = 100;
coord.Y = 40;
if (!SetConsoleScreenBufferSize(hstdout, coord))
msg_Warn(vd, "SetConsoleScreenBufferSize %i %i",
coord.X, coord.Y);
/* Get the current screen buffer size and window position. */
if (GetConsoleScreenBufferInfo(hstdout, &csbiInfo)) {
rect.Top = 0; rect.Left = 0;
rect.Right = csbiInfo.dwMaximumWindowSize.X - 1;
rect.Bottom = csbiInfo.dwMaximumWindowSize.Y - 1;
if (!SetConsoleWindowInfo(hstdout, TRUE, &rect))
msg_Dbg(vd, "SetConsoleWindowInfo failed: %ix%i",
rect.Right, rect.Bottom);
}
#endif
/* Allocate structure */
vd->sys = sys = calloc(1, sizeof(*sys));
if (!sys)
goto error;
sys->cv = cucul_create_canvas(0, 0);
if (!sys->cv) {
msg_Err(vd, "cannot initialize libcucul");
goto error;
}
const char *driver = NULL;
#ifdef __APPLE__
// Make sure we don't try to open a window.
driver = "ncurses";
#endif
sys->dp = caca_create_display_with_driver(sys->cv, driver);
if (!sys->dp) {
msg_Err(vd, "cannot initialize libcaca");
goto error;
}
vout_display_DeleteWindow(vd, NULL);
if (vd->cfg->display.title)
caca_set_display_title(sys->dp,
vd->cfg->display.title);
else
caca_set_display_title(sys->dp,
VOUT_TITLE "(Colour AsCii Art)");
/* Fix format */
video_format_t fmt = vd->fmt;
if (fmt.i_chroma != VLC_CODEC_RGB32) {
fmt.i_chroma = VLC_CODEC_RGB32;
fmt.i_rmask = 0x00ff0000;
fmt.i_gmask = 0x0000ff00;
fmt.i_bmask = 0x000000ff;
}
/* TODO */
vout_display_info_t info = vd->info;
/* Setup vout_display now that everything is fine */
vd->fmt = fmt;
vd->info = info;
vd->pool = Pool;
vd->prepare = Prepare;
vd->display = PictureDisplay;
vd->control = Control;
vd->manage = Manage;
/* Fix initial state */
vout_display_SendEventFullscreen(vd, false);
Refresh(vd);
return VLC_SUCCESS;
error:
if (sys) {
if (sys->pool)
picture_pool_Delete(sys->pool);
if (sys->dither)
cucul_free_dither(sys->dither);
if (sys->dp)
caca_free_display(sys->dp);
if (sys->cv)
cucul_free_canvas(sys->cv);
free(sys);
}
#if defined(WIN32)
FreeConsole();
#endif
return VLC_EGENERIC;
}
示例2: Erase
void CmdLineView::Render (const char * str)
{
Erase();
Print(str);
Refresh();
}
示例3: WXUNUSED
void wxPendulumDlg::OnTimer(wxTimerEvent& WXUNUSED(event))
{
// force refresh
Refresh();
}
示例4: Refresh
bool mmMultiButton::Enable(bool enable)
{
bool ret = wxWindowBase::Enable(enable);
Refresh();
return ret;
} // Enable
示例5: GetXAtValue
////////////////
// Mouse events
void VideoSlider::OnMouse(wxMouseEvent &event) {
// Coordinates
int x = event.GetX();
int y = event.GetY();
bool shift = event.m_shiftDown;
// Left click
if (event.ButtonIsDown(wxMOUSE_BTN_LEFT)) {
// Check if it's OK to drag
bool canDrag = wxWindow::FindFocus() == this;
if (!canDrag) {
int tolerance = 4;
int curX = GetXAtValue(GetValue());
if (x-curX < -tolerance || x-curX > tolerance) canDrag = true;
}
// Drag
if (canDrag) {
// Shift click to snap to keyframe
if (shift && Display) {
wxArrayInt KeyFrames = Display->GetKeyFrames();
int keys = KeyFrames.Count();
int clickedFrame = GetValueAtX(x);
int closest = 0;
int cur;
// Find closest
for (int i=0;i<keys;i++) {
cur = KeyFrames[i];
if (abs(cur-clickedFrame) < abs(closest-clickedFrame)) {
closest = cur;
}
}
// Jump to frame
if (closest == GetValue()) return;
SetValue(closest);
}
// Normal click
else {
int go = GetValueAtX(x);
if (go == GetValue()) return;
SetValue(go);
}
Refresh(false);
// Playing?
if (Display->IsPlaying) {
Display->Stop();
UpdateVideo();
Display->Play();
}
else UpdateVideo();
}
// Get focus
SetFocus();
}
// Right/middle click
if (event.ButtonDown(wxMOUSE_BTN_RIGHT) || event.ButtonDown(wxMOUSE_BTN_MIDDLE)) {
SetFocus();
}
// Something else
else if (!Display->IsPlaying) event.Skip();
}
示例6: RepaintPanel
virtual void RepaintPanel()
{
Refresh(false);
Update();
}
示例7: UpdateScaleValue
void wxImageBox::UpdatePaintBox()
{
m_repaint = true;
UpdateScaleValue();
Refresh();
}
示例8: wxDialog
ProcessesDialog::ProcessesDialog( wxWindow* parent )
: wxDialog( parent, wxID_ANY, _("Processes"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER )
{
wxFlexGridSizer* fgSizer2;
fgSizer2 = new wxFlexGridSizer( 1, 1, 0, 0 );
fgSizer2->AddGrowableCol( 0 );
fgSizer2->AddGrowableRow( 0 );
fgSizer2->SetFlexibleDirection( wxBOTH );
wxStaticBoxSizer* sbSizer1;
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, -1, wxT("Available Processes") ), wxHORIZONTAL );
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 2, 1, 0, 0 );
fgSizer1->AddGrowableCol( 0 );
fgSizer1->AddGrowableRow( 0 );
fgSizer1->SetFlexibleDirection( wxBOTH );
m_processList = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxSize(400, 300), wxLC_REPORT | wxLC_SINGLE_SEL);
m_processList->InsertColumn(0, "Process");
m_processList->InsertColumn(1, "ID");
m_processList->InsertColumn(2, "Title");
m_processList->SetColumnWidth(0, 100);
m_processList->SetColumnWidth(1, 50);
m_processList->SetColumnWidth(2, 350);
fgSizer1->Add( m_processList, 0, wxALL|wxEXPAND, 5 );
sbSizer1->Add( fgSizer1, 1, wxEXPAND, 5 );
fgSizer2->Add( sbSizer1, 1, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxHORIZONTAL );
m_refresh = new wxButton( this, ID_Refresh, wxT("&Refresh"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer1->Add( m_refresh, 0, wxALL, 5 );
m_attach = new wxButton( this, wxID_OK, wxT("&Attach"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer1->Add( m_attach, 0, wxALL, 5 );
m_close = new wxButton( this, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer1->Add( m_close, 0, wxALL, 5 );
fgSizer2->Add( bSizer1, 1, wxALL | wxALIGN_RIGHT, 5 );
SetSizer( fgSizer2 );
wxSize minSize = fgSizer2->GetMinSize();
SetClientSize(minSize);
SetMinSize(GetSize());
Layout();
m_sortColumn = 0;
m_sortForward = true;
Refresh();
}
示例9: GetSizer
void BookmarkView::refreshLayout() {
GetSizer()->Layout();
Update();
Refresh();
}
示例10: Refresh
void ProcessesDialog::OnRefresh(wxCommandEvent& event)
{
Refresh();
}
示例11: GetWindow
void
ClipboardWidget::Paste()
{
// Get the window and selection manager for use below.
JXWindow* window = GetWindow();
JXSelectionManager* selMgr = GetSelectionManager();
// If the clipboard is not empty, retrieve the available types.
JArray<Atom> typeList;
if (selMgr->GetAvailableTypes(kJXClipboardName, CurrentTime, &typeList))
{
// Loop through the available types to see if the clipboard has
// one that we want.
const JSize typeCount = typeList.GetElementCount();
for (JIndex i=1; i<=typeCount; i++)
{
const Atom atom = typeList.GetElement(i);
// Check if the i-th type is one we can use.
if (atom == XA_STRING || atom == selMgr->GetTextXAtom())
{
// Get the data of the appropriate type.
unsigned char* data = NULL;
JSize dataLength;
Atom returnType;
JXSelectionManager::DeleteMethod dMethod;
if (selMgr->GetData(kJXClipboardName, CurrentTime,
atom, &returnType, &data, &dataLength,
&dMethod))
{
// We can only handle the simplest format.
if (returnType == XA_STRING)
{
// Copy the data into our text.
itsText.Set(reinterpret_cast<JCharacter*>(data), dataLength);
// Our text changed, so we need to refresh.
Refresh();
}
// This is required to delete the allocated data.
// Forgetting to do this will cause a memory leak!
selMgr->DeleteData(&data, dMethod);
if (returnType == XA_STRING)
{
// We succeeded, so we return.
return;
}
}
else
{
(JGetUserNotification())->ReportError(
"Unable to retrieve text from the clipboard.");
}
}
}
// If we got this far, the data type that we want wasn't on the
// clipboard.
(JGetUserNotification())->ReportError("Unable to paste from clipboard.");
}
else
{
// There isn't anything on the clipboard.
(JGetUserNotification())->ReportError("Clipboard is empty.");
}
}
示例12: switch
bool CGUIWindowEventLog::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
m_rootDir.AllowNonLocalSources(false);
// is this the first time the window is opened?
if (m_vecItems->GetPath() == "?" && message.GetStringParam().empty())
m_vecItems->SetPath("");
break;
}
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
// check if we should clear all items
if (iControl == CONTROL_BUTTON_CLEAR)
{
CEventLog::GetInstance().Clear(CViewStateSettings::GetInstance().GetEventLevel(), CViewStateSettings::GetInstance().ShowHigherEventLevels());
// refresh the list
Refresh(true);
return true;
}
// check if we should change the level
if (iControl == CONTROL_BUTTON_LEVEL)
{
// update the event level
CViewStateSettings::GetInstance().CycleEventLevel();
CSettings::GetInstance().Save();
// update the listing
Refresh();
return true;
}
// check if we should change the level
if (iControl == CONTROL_BUTTON_LEVEL_ONLY)
{
// update whether to show higher event levels
CViewStateSettings::GetInstance().ToggleShowHigherEventLevels();
CSettings::GetInstance().Save();
// update the listing
Refresh();
return true;
}
// check if the user interacted with one of the events
if (m_viewControl.HasControl(iControl))
{
// get selected item
int itemIndex = m_viewControl.GetSelectedItem();
if (itemIndex < 0 || itemIndex >= m_vecItems->Size())
break;
CFileItemPtr item = m_vecItems->Get(itemIndex);
int actionId = message.GetParam1();
if (actionId == ACTION_DELETE_ITEM)
return OnDelete(item);
}
break;
}
case GUI_MSG_NOTIFY_ALL:
{
CFileItemPtr item = std::dynamic_pointer_cast<CFileItem>(message.GetItem());
if (item == nullptr)
break;
switch (message.GetParam1())
{
case GUI_MSG_EVENT_ADDED:
OnEventAdded(item);
return true;
case GUI_MSG_EVENT_REMOVED:
OnEventRemoved(item);
return true;
default:
break;
}
}
default:
break;
}
return CGUIMediaWindow::OnMessage(message);
}
示例13: UpdateScrollbar
void wxVScrolledWindow::RefreshAll()
{
UpdateScrollbar();
Refresh();
}
示例14: Refresh
void wxGauge::SetRange(int range)
{
wxGaugeBase::SetRange(range);
Refresh();
}
示例15: CalcUnscrolledPosition
void TileMapPanel::OnMouseEvent(wxMouseEvent &event)
{
if(!m_tilemap || !m_tileset)
return;
//Get the current tile position (column and row)
unsigned int currentColumn, currentRow;
wxPoint mousePos = CalcUnscrolledPosition(event.GetPosition());
GetTileAt(mousePos, currentColumn, currentRow);
if(currentColumn >= m_tilemap->GetColumnsCount() || currentRow >= m_tilemap->GetRowsCount())
return; //Stop if the position is out of range
if(m_insertionMode == PencilMode)
{
if(event.GetEventType() == wxEVT_LEFT_DOWN || event.GetEventType() == wxEVT_RIGHT_DOWN || event.GetEventType() == wxEVT_MOTION)
{
if(event.LeftIsDown()) //Left mouse button pressed
{
//Add a tile to the current position (only if the tile has not been set before)
if(m_tilemap->GetTile(m_mapCurrentLayer, currentColumn, currentRow) != m_tileToBeInserted)
m_commandProcessor.Submit(new ChangeTileCommand(*m_tilemap, m_mapCurrentLayer, currentColumn, currentRow, m_tileToBeInserted));
Refresh();
}
else if(event.RightIsDown())
{
//Remove the tile
m_commandProcessor.Submit(new ChangeTileCommand(*m_tilemap, m_mapCurrentLayer, currentColumn, currentRow, -1));
Refresh();
}
}
}
else if(m_insertionMode == RectangleMode)
{
if(event.GetEventType() == wxEVT_LEFT_DOWN || event.GetEventType() == wxEVT_RIGHT_DOWN)
{
m_isDrawingRectangle = true;
m_beginCol = m_endCol = currentColumn;
m_beginRow = m_endRow = currentRow;
Update();
}
else if(event.GetEventType() == wxEVT_MOTION)
{
m_endCol = currentColumn;
m_endRow = currentRow;
Update();
}
else if(event.GetEventType() == wxEVT_LEFT_UP)
{
m_endCol = currentColumn;
m_endRow = currentRow;
m_isDrawingRectangle = false;
m_commandProcessor.Submit(new ChangeTileCommand(*m_tilemap, m_mapCurrentLayer, std::min(m_beginCol, m_endCol),
std::min(m_beginRow, m_endRow),
std::max(m_beginCol, m_endCol),
std::max(m_beginRow, m_endRow),
m_tileToBeInserted));
Update();
}
else if(event.GetEventType() == wxEVT_RIGHT_UP)
{
m_endCol = currentColumn;
m_endRow = currentRow;
m_isDrawingRectangle = false;
m_commandProcessor.Submit(new ChangeTileCommand(*m_tilemap, m_mapCurrentLayer, std::min(m_beginCol, m_endCol),
std::min(m_beginRow, m_endRow),
std::max(m_beginCol, m_endCol),
std::max(m_beginRow, m_endRow),
-1));
Update();
}
}
else if(m_insertionMode == FillMode)
{
if(event.GetEventType() == wxEVT_LEFT_DOWN)
{
m_commandProcessor.Submit(new FloodFillCommand(*m_tilemap, m_mapCurrentLayer, currentColumn, currentRow, m_tileToBeInserted));
Update();
}
}
}