本文整理汇总了C++中OpenWindow函数的典型用法代码示例。如果您正苦于以下问题:C++ OpenWindow函数的具体用法?C++ OpenWindow怎么用?C++ OpenWindow使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OpenWindow函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AskExit
void AskExit()
{
if(CheckIfModified()==TRUE)
{
SetColor(LIGHTWHITE);
SetBackColor(RED);
OpenWindow(10,24,5,32);
SetColor(YELLOW);
Print_At(11,29,"Apply Changes on Exit?");
SetColor(BLUE);
SetBackColor(WHITE);
SetBlink(ON);
Print_At(13,32," <Yes> ");
Print_At(13,42," <No> ");
SetBlink(OFF);
GetKey();
}
CloseAllWindows();
VideoReset();
if(keycode!=ESC && keychar!='n' && keychar!='N')
if(WriteHeader(&id32)!=0)
{
printf("%s could not write to file\n" ,errstr);
exit(1);
}
CloseFile();
exit(0);
}
示例2: do_QueryInterface
NS_IMETHODIMP nsMessengerContentHandler::HandleContent(const char * aContentType,
nsIInterfaceRequestor* aWindowContext, nsIRequest *request)
{
nsresult rv = NS_OK;
if (!request)
return NS_ERROR_NULL_POINTER;
// First of all, get the content type and make sure it is a content type we know how to handle!
if (PL_strcasecmp(aContentType, "application/x-message-display") == 0) {
nsCOMPtr<nsIURI> aUri;
nsCOMPtr<nsIChannel> aChannel = do_QueryInterface(request);
if (!aChannel) return NS_ERROR_FAILURE;
rv = aChannel->GetURI(getter_AddRefs(aUri));
if (aUri)
{
rv = request->Cancel(NS_ERROR_ABORT);
if (NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIURL> aUrl = do_QueryInterface(aUri);
if (aUrl)
{
nsCAutoString queryPart;
aUrl->GetQuery(queryPart);
queryPart.ReplaceSubstring("type=message/rfc822", "type=application/x-message-display");
aUrl->SetQuery(queryPart);
rv = OpenWindow(aUri);
}
}
}
}
return rv;
}
示例3: fnkdat
void SinglePlayerMenu::OnLoadReplay()
{
char tmp[FILENAME_MAX];
fnkdat("replay/", tmp, FILENAME_MAX, FNKDAT_USER | FNKDAT_CREAT);
std::string replaypath(tmp);
OpenWindow(LoadSaveWindow::Create(false, pTextManager->getLocalized("Load Replay"), replaypath, "rpl"));
}
示例4: Init
bool Init(void)
{
// platform-specific initialization
Platform::Init();
// create window
OpenWindow();
// hide the mouse cursor
Platform::ShowCursor(false);
// grab input
Platform::GrabInput(true);
// print OpenGL attributes
PrintAttributes();
// initialize console
console = new Console(cmdCB);
// initialize sound system
Sound::Init();
// pause audio
Sound::Pause();
// success!
return true;
}
示例5: startSinglePlayerGame
void SinglePlayerMenu::CloseChildWindow() {
std::string filename = "";
std::string extension = "";
LoadSaveWindow* pLoadSaveWindow = dynamic_cast<LoadSaveWindow*>(pChildWindow);
if(pLoadSaveWindow != NULL) {
filename = pLoadSaveWindow->GetFilename();
extension = pLoadSaveWindow->GetExtension();
}
MenuClass::CloseChildWindow();
if(filename != "") {
if(extension == "dls") {
try {
startSinglePlayerGame( GameInitSettings(filename) );
} catch (std::exception& e) {
// most probably the savegame file is not valid or from a different dune legacy version
OpenWindow(MessageBox::Create(e.what()));
}
} else if(extension == "rpl") {
startReplay(filename);
}
}
}
示例6: RestoreConfig
void RestoreConfig()
{
int n;
char *envname;
char envbuf[256];
char *name;
char *ptr;
char buf[80];
SetColor(LIGHTWHITE);
SetBackColor(BLUE);
OpenWindow(10,10,3,60);
SetColor(YELLOW);
Print_At(10,13," Restore Predefined Configuration ");
SetColor(LIGHTWHITE);
Print_At(11,12,"Enter file name:");
name=InputString(11,30,37,cfgfilename);
if(name!=NULL && name[0]!=0)
{
strcpy(buf,name);
ptr=(char *)strchr(buf,'.');
if(ptr!=NULL) strset(ptr,0);
strcpy(cfgfilename,buf);
strcat(buf,".d32");
n=open(buf,O_RDONLY | O_BINARY);
if(n==-1)
{
envname=getenv("DOS32A");
if(envname!=NULL)
{
ptr=strchr(envname,' ');
if(ptr==NULL) ptr=strchr(envname,0);
memset(envbuf,0,256);
strncpy(envbuf,envname,(dword)ptr-(dword)envname);
strcat(envbuf,"\\D32\\"); strcat(envbuf,buf);
n=open(envbuf,O_RDWR | O_BINARY);
}
}
if(n!=-1)
{
read(n,&id32,24);
close(n);
SetColor(LIGHTWHITE);
SetBackColor(BLUE);
strupr(buf);
for(n=0; n<13; n++)
{
SetPos(24,66+n);
PrintC(' ');
}
Print_At(24,66,"%.13s",buf);
}
else DiskError();
}
ValidateConfig();
CloseWindow();
if(mainmenu_sel==1) ShowBannerStatus();
}
示例7: OpenWindow
int
nsNativeViewerApp::Run()
{
OpenWindow();
mAppShell->Run();
return 0;
}
示例8: OpenWindow
CApp::CApp( )
{
fSpawnTimer = 0.0f;
iLife = 10;
OpenWindow( );
Run( );
}
示例9: QueryUserStop
int QueryUserStop(void)
{
int control, result;
static int Initialized = FALSE;
PushHelpIndex(USER_STOP_INDEX);
if (!Initialized)
{
Initialize();
Initialized = TRUE;
}
SetStatusBar(RED, WHITE, " ");
SetStatusBar(RED, WHITE, " Defragmentation process stopped.");
OpenWindow(&QueryBox);
control = ControlWindow(&QueryBox);
CloseWindow();
/* Interpret values. */
if (control == YESBUTTON)
result = TRUE;
else
result = FALSE;
PopHelpIndex();
return result;
}
示例10: first
extern "C" int first()
{
SysBase = *((struct ExecBase**)4);
IntuitionBase = (struct IntuitionBase*)OpenLibrary("intuition.library", 37);
DOSBase = (struct DosLibrary*)OpenLibrary("dos.library", 37);
struct NewWindow nw = {0};
nw.TopEdge = 0;
nw.LeftEdge = 0;
nw.Width = 100;
nw.Height = 100;
nw.Flags = WFLG_DRAGBAR;
nw.Type = WBENCHSCREEN;
struct Window* win = OpenWindow(&nw);
if (win == NULL)
{
Write(Output(), (void* const)"Failed\n", 7);
return 0;
}
Delay(50*4);
CloseWindow(win);
//DisplayBeep(NULL);
return 0;
}
示例11: Init
bool Init(void)
{
// initialize SDL
if( SDL_Init( SDL_INIT_EVERYTHING ) < 0 )
return false;
// Check for joystick
if (SDL_NumJoysticks() > 0)
{
// Open joystick
SDL_Joystick *joy = SDL_JoystickOpen(0);
if(joy)
{
DebugPrint("Opened Joystick 0\n");
DebugPrint("Name: %s\n", SDL_JoystickName(0));
}
}
// enable unicode
SDL_EnableUNICODE(1);
// create the window
OpenWindow();
// set window title
SDL_WM_SetCaption( "Shmup!", NULL );
// platform-specific attributes
PrintAttributes();
// success!
return true;
}
示例12: ASSERT
void cChestEntity::OpenNewWindow(void)
{
if (m_Neighbour != nullptr)
{
ASSERT( // This should be the primary chest
(m_Neighbour->GetPosX() < GetPosX()) ||
(m_Neighbour->GetPosZ() < GetPosZ())
);
OpenWindow(new cChestWindow(this, m_Neighbour));
}
else
{
// There is no chest neighbour, open a single-chest window:
OpenWindow(new cChestWindow(this));
}
}
示例13: FailOSErr
PDoc* PApp::OpenWorksheet()
{
try
{
if (!gPrefsDir.Contains("Worksheet", B_FILE_NODE | B_SYMLINK_NODE))
{
BFile file;
gPrefsDir.CreateFile("Worksheet", &file);
}
BEntry w;
entry_ref wr;
FailOSErr(gPrefsDir.FindEntry("Worksheet", &w, true));
FailOSErr(w.GetRef(&wr));
OpenWindow(wr);
PDoc *d = dynamic_cast<PDoc*>(CDoc::FindDoc(wr));
if (d)
d->MakeWorksheet();
return d;
}
catch (HErr& e)
{
e.DoError();
}
return NULL;
} /* PApp::OpenWorksheet */
示例14: ReportDefragDone
int ReportDefragDone(void)
{
static int Initialized = FALSE;
int control, i, result;
if (!Initialized)
{
Initialize();
Initialized = TRUE;
}
SetStatusBar(RED, WHITE, " ");
SetStatusBar(RED, WHITE, " Defragmentation done.");
OpenWindow(&DoneDialog);
do {
control = ControlWindow(&DoneDialog);
} while (control != OKBUTTON);
CloseWindow();
for (i = 0; i < 3; i++)
if (SelectButtons[i].selected)
{
result = i;
SelectButtons[i].selected = FALSE;
}
SelectButtons[DEFAULT_OPTION].selected = TRUE;
return result;
}
示例15: cOpenDouble
void cChestEntity::OpenNewWindow(void)
{
// TODO: cats are an obstruction
if ((GetPosY() + 1 < cChunkDef::Height) && cBlockInfo::IsSolid(GetWorld()->GetBlock(GetPosX(), GetPosY() + 1, GetPosZ())))
{
// Obstruction, don't open
return;
}
// Callback for opening together with neighbor chest:
class cOpenDouble :
public cChestCallback
{
cChestEntity * m_ThisChest;
public:
cOpenDouble(cChestEntity * a_ThisChest) :
m_ThisChest(a_ThisChest)
{
}
virtual bool Item(cChestEntity * a_Chest) override
{
if ((a_Chest->GetPosY() + 1 < cChunkDef::Height) && cBlockInfo::IsSolid(a_Chest->GetWorld()->GetBlock(a_Chest->GetPosX(), a_Chest->GetPosY() + 1, a_Chest->GetPosZ())))
{
// Obstruction, don't open
return false;
}
// The primary chest should eb the one with lesser X or Z coord:
cChestEntity * Primary = a_Chest;
cChestEntity * Secondary = m_ThisChest;
if (
(Primary->GetPosX() > Secondary->GetPosX()) ||
(Primary->GetPosZ() > Secondary->GetPosZ())
)
{
std::swap(Primary, Secondary);
}
m_ThisChest->OpenWindow(new cChestWindow(Primary, Secondary));
return false;
}
} ;
// Scan neighbors for adjacent chests:
cOpenDouble OpenDbl(this);
if (
m_World->DoWithChestAt(m_PosX - 1, m_PosY, m_PosZ, OpenDbl) ||
m_World->DoWithChestAt(m_PosX + 1, m_PosY, m_PosZ, OpenDbl) ||
m_World->DoWithChestAt(m_PosX, m_PosY, m_PosZ - 1, OpenDbl) ||
m_World->DoWithChestAt(m_PosX, m_PosY, m_PosZ + 1, OpenDbl)
)
{
// The double-chest window has been opened in the callback
return;
}
// There is no chest neighbor, open a single-chest window:
OpenWindow(new cChestWindow(this));
}