本文整理汇总了C++中OnInit函数的典型用法代码示例。如果您正苦于以下问题:C++ OnInit函数的具体用法?C++ OnInit怎么用?C++ OnInit使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OnInit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool CWebBrowserDownloadHandler::OnContextButton(int itemNumber, unsigned int button)
{
if (button == 30092)
m_items[itemNumber]->Cancel();
else if (button == 30093)
m_items[itemNumber]->Pause();
else if (button == 30094)
m_items[itemNumber]->Resume();
else if (button == 30097)
{
ResetHistory();
OnInit();
}
else if (button == 30091)
{
bool canceled = false;
std::string text = StringUtils::Format(kodi::GetLocalizedString(30098).c_str(), m_items[itemNumber]->GetName().c_str());
bool ret = kodi::gui::dialogs::YesNo::ShowAndGetInput(kodi::GetLocalizedString(30016), text, canceled,
kodi::GetLocalizedString(30018), kodi::GetLocalizedString(30017));
if (canceled)
return false;
if (ret)
kodi::vfs::DeleteFile(m_items[itemNumber]->GetPath());
RemovedFinishedDownload(m_items[itemNumber]);
OnInit();
}
return true;
}
示例2: prctl
void Thread::Create()
{
prctl(PR_SET_NAME, name_.c_str());
OnInit();
OnLoop();
OnStop();
}
示例3: OnClick
void YAddingSong::Notify(TNotifyUI& msg)
{
if (msg.sType.Compare(kClick)==0)
OnClick(msg);
else if(msg.sType.Compare(kWindowInit)==0)
OnInit(msg);
}
示例4: OnClose
/**
* 重新加载
* @param void
* @return void
*/
void CPointCodeList::OnReload()
{
// 关闭
OnClose();
// 初始化
OnInit();
}
示例5: Run
void CMessageTask::Run() {
// call task specific initialization code.
if ( !OnInit() ) {
#if INCLUDE_vTaskDelete == 1
Delete();
return;
#else
// The task must not start due to initialization problem, but the FreeRTOS
// vTaskDelete function is not defined by configuration file. Suspend the task.
Suspend();
#endif
}
CMessage msg;
for (;;) {
if ( m_queue.Receive(&msg, m_nTimeOut) == pdTRUE ) {
// Message Handling routine
// Call the delegate, if one, before try to dispatch the event
if (m_pDelegate) m_pDelegate->OnHandleEvent(msg);
DispatchMessage(msg);
// Call the delegate, if one, after tried to dispatch the event
if (m_pDelegate) m_pDelegate->DidHandleEvent(msg);
}
else {
// TODO: STF - timeout expired.
OnTimeOut();
}
}
}
示例6: OnExecute
int CApp::OnExecute(){
if (OnInit() == false){
return -1;
}
SDL_Event Event;
while(Running){
while(SDL_PollEvent(&Event)){
OnEvent(&Event);
}
OnLoop();
OnRender();
}
OnCleanup();
return 0;
}
示例7: OnClose
/**
* 重新加载
* @param void
* @return void
*/
void CMarkerList::OnReload()
{
// 关闭
OnClose();
// 初始化
OnInit();
}
示例8: OnExecute
int OnExecute()
{
if (OnInit() == false)
{
return -1;
}
SDL_Event Event;
while(Running)
{
if (g_engine)
{
for (int x = 0; x < 5 && SDL_WaitEventTimeout(&Event, 10); ++x)
{
if(!g_engine->IsPaused())
OnEvent(&Event);
}
if(!g_engine->IsPaused())
OnUpdate();
}
}
OnCleanup();
return 0;
};
示例9: OnStart
//Holds game logic together
int Game::OnStart() {
//Initialize the game
if (OnInit() == false) {
return -1;
}
SDL_Event Event;
//While game is running
while (running) {
while (gameType == 0 && running) {
while (SDL_PollEvent(&Event)) {
OnEvent(&Event);
}
//meanwhile show menu
showMenu();
}
while (SDL_PollEvent(&Event)) {
//Handle user input
OnEvent(&Event);
}
OnLoop();
OnRender();
}
OnCleanUp();
return 0;
};
示例10: main
int main(int argc,char** argv)
{
// initialize glut
glutInit(&argc,argv);
// request a depth buffer, RGBA display mode, and we want double buffering
glutInitDisplayMode(GLUT_DEPTH|GLUT_RGBA|GLUT_DOUBLE);
// set the initial window size
glutInitWindowSize(800,600);
// create the window
glutCreateWindow("Curves");
// set the function to use to draw our scene
glutDisplayFunc(OnDraw);
// set the function to handle changes in screen size
glutReshapeFunc(OnReshape);
// set the function for the key presses
glutMotionFunc(GerenciaMovim);
glutMouseFunc(GerenciaMouse);
glutKeyboardFunc(GerenciaTeclado);
glutSpecialFunc(GerenciaTecladoEspecial);
// run our custom initialization
OnInit();
// this function runs a while loop to keep the program running.
glutMainLoop();
}
示例11: CPlApplet
LONG APIENTRY CPlApplet(HWND hWnd, UINT uMsg, LPARAM lp1, LPARAM lp2)
{
switch (uMsg)
{
case CPL_DBLCLK:
return OnDblclk(hWnd, lp1, lp2);
case CPL_EXIT:
return OnExit();
case CPL_GETCOUNT:
return OnGetCount();
case CPL_INIT:
return OnInit();
case CPL_INQUIRE:
return OnInquire(lp1, (CPLINFO*)lp2);
case CPL_NEWINQUIRE:
return OnNewInquire(lp1, (NEWCPLINFO*)lp2);
case CPL_STOP:
return OnStop(lp1, lp2);
case CPL_STARTWPARMS:
return OnDblclk(hWnd, lp1, lp2);
default:
break;
}
return 1;
}
示例12: OnExecute
int CApp::OnExecute(int argc, char **argv) {
if(OnInit(argc, argv) == false) {
return -1;
}
SDL_Event Event;
bool calculatedFrame;
while(Running) {
//BulletManager::Step();
while(SDL_PollEvent(&Event))
{
OnEvent(&Event);
}
calculatedFrame= false;
while ((SDL_GetTicks() - GameBaseTime) > GameTickLength)
{
gameTime = SDL_GetTicks() / 1000.0f;
GameBaseTime += GameTickLength;
OnUpdate();
calculatedFrame = true;
}
BulletManager::Step();
OnDraw();
}
OnCleanup();
return 0;
}
示例13: OnExecute
//------------------------------------------------------------------------------
int CApp::OnExecute() {
if(OnInit() == false) {
return -1;
}
SDL_Event Event;
while(Running) {
if(AIenabled && CurrentPlayer && GameState == GAME_STATE_RUNNING)
{
GameClick(AIMove());
}
while(SDL_PollEvent(&Event)) {
OnEvent(&Event);
}
OnLoop();
OnRender();
}
OnCleanup();
return 0;
}
示例14: OnClose
/**
* 重新加载
* @param void
* @return void
*/
void CBlastMachineList::OnReload()
{
// 关闭
OnClose();
// 初始化
OnInit();
}
示例15: switch
//==============================
// OvrSliderComponent::OnEvent_Impl
eMsgStatus OvrSliderComponent::OnEvent_Impl( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
switch ( event.EventType )
{
case VRMENU_EVENT_INIT:
return OnInit( guiSys, vrFrame, self, event );
case VRMENU_EVENT_FRAME_UPDATE:
return OnFrameUpdate( guiSys, vrFrame, self, event );
case VRMENU_EVENT_TOUCH_DOWN:
return OnTouchDown( guiSys, vrFrame, self, event );
case VRMENU_EVENT_TOUCH_UP:
if ( OnReleaseFunction )
{
( *OnReleaseFunction )( this, OnReleaseObject, SliderFrac );
}
TouchDown = false;
return OnTouchUp( guiSys, vrFrame, self, event );
case VRMENU_EVENT_TOUCH_RELATIVE:
return OnTouchRelative( guiSys, vrFrame, self, event );
default:
OVR_ASSERT( false );
return MSG_STATUS_ALIVE;
}
return MSG_STATUS_CONSUMED;
}