本文整理汇总了C++中IsVisible函数的典型用法代码示例。如果您正苦于以下问题:C++ IsVisible函数的具体用法?C++ IsVisible怎么用?C++ IsVisible使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsVisible函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsVisible
bool Field::MakeVisible()
{
bool wasAlreadyVisible = IsVisible();
_visible = true;
return !(wasAlreadyVisible); //return TRUE if we just made this field visible
}
示例2: OnKeyEvent
bool GuiTextEdit::OnKeyEvent(const KeyEvent& ke)
{
if (!IsVisible())
{
return false;
}
// Buttons can generate key events, so this GuiTextEdit object may not have the focus (the button
// just clicked would have it). So the last GuiTextEdit to have the focus should accept this key.
if (!HasFocus())
{
#ifdef TEXT_EDIT_DEBUG
std::cout << "Key event ignored by " << m_name << " as does not have focus.\n";
#endif
return false;
}
// Is this the current or most recent GuiTextEdit to have focus ?
// TODO
if (!ke.keyDown)
{
return true;
}
switch (ke.keyType)
{
case AMJU_KEY_CHAR:
// Prevent chars like Tab
if (ke.key >= ' ') // && ke.key <= (char)127)
{
Insert(ke.key);
}
else
{
// TODO Alert user that character is out of range
}
break;
case AMJU_KEY_UP:
case AMJU_KEY_DOWN:
// TODO Multi line text
break;
case AMJU_KEY_LEFT:
#ifdef MACOSX
if (ke.modifier & AMJU_KEY_MOD_ALT) // jump to prev word
#else
if (ke.modifier & AMJU_KEY_MOD_CTRL)
#endif
{
// Prev word
if (ke.modifier & AMJU_KEY_MOD_SHIFT)
{
#ifdef TEXT_EDIT_DEBUG
std::cout << "Prev word + select\n";
#endif
m_caret = PrevWord(m_caret);
m_triListSelection = 0;
}
else
{
#ifdef TEXT_EDIT_DEBUG
std::cout << "Prev word\n";
#endif
m_caret = PrevWord(m_caret);
m_selectedText = m_caret;
m_triListSelection = 0;
}
}
else if (ke.modifier & AMJU_KEY_MOD_SHIFT)
{
#ifdef TEXT_EDIT_DEBUG
std::cout << "Prev char + select\n";
#endif
// Select char to left
if (m_caret > 0)
{
m_caret--;
m_triListSelection = 0;
}
}
else
{
#ifdef TEXT_EDIT_DEBUG
std::cout << "Prev char\n";
#endif
if (m_caret > 0)
{
// Move caret left
m_caret--;
m_selectedText = m_caret;
m_triListSelection = 0;
}
}
break;
case AMJU_KEY_RIGHT:
#ifdef MACOSX
if (ke.modifier & AMJU_KEY_MOD_ALT) // jump to next word
//.........这里部分代码省略.........
示例3: IsVisible
void CActiveXUI::SetInternVisible(bool bVisible)
{
CControlUI::SetInternVisible(bVisible);
if( m_hwndHost != NULL && !m_pControl->m_bWindowless )
::ShowWindow(m_hwndHost, IsVisible() ? SW_SHOW : SW_HIDE);
}
示例4: SetVisible
void CEditUI::SetVisible(bool bVisible)
{
CControlUI::SetVisible(bVisible);
if( !IsVisible() && m_pWindow != NULL ) m_pManager->SetFocus(NULL);
}
示例5: _OnSetSize
void Container::_OnSetSize()
{
if (IsVisible()) UpdateAllChildSizes();
}
示例6: DebugPrintf
HRESULT UIPdfTrimColumnedDlg::Draw(DK_IMAGE drawingImg)
{
DebugPrintf(DLC_ZHY,"enter %s::%s,%s(%d)",GetClassName(), __FUNCTION__, __FILE__, __LINE__);
if (!IsVisible())
return S_OK;
HRESULT hr(S_OK);
CTpGraphics grf(drawingImg);
DK_IMAGE imgSelf;
DK_RECT rcSelf={m_iLeft, m_iTop, m_iLeft + m_iWidth, m_iTop + m_iHeight};
RTN_HR_IF_FAILED(CropImage(drawingImg, rcSelf, &imgSelf));
RTN_HR_IF_FAILED(DrawBackGround(imgSelf));
//draw flag
SPtr<ITpImage> spImageCursor = ImageManager::GetImage(IMAGE_PDF_LOCATE_CURSOR);
int w = spImageCursor->GetWidth();
int h = spImageCursor->GetHeight();
if (m_bIsActionFinished)
{
m_btnConfirmed.SetVisible(true);
m_btnCancel.SetVisible(true);
RTN_HR_IF_FAILED(m_btnConfirmed.Draw(imgSelf));
RTN_HR_IF_FAILED(m_btnCancel.Draw(imgSelf));
}
else
{
m_btnConfirmed.SetVisible(false);
m_btnCancel.SetVisible(false);
}
//draw lines
if (m_iCurAction == PdfTrimAction)
{
//Trim
grf.DrawImage(spImageCursor.Get(), m_iLeftCuttingEdge - w/2, m_iTopCuttingEdge -h/2);
grf.DrawImage(spImageCursor.Get(), m_iRightCuttingEdge - w/2, m_iBottomCuttingEdge - h/2);
DebugPrintf(DLC_ZHY,"rect,left,top,right,bottom:%d,%d,%d,%d",m_iLeftCuttingEdge, m_iTopCuttingEdge, m_iRightCuttingEdge, m_iBottomCuttingEdge);
grf.DrawLine(m_iLeftCuttingEdge, m_iTop, 2, m_iHeight, SOLID_STROKE);
grf.DrawLine(m_iRightCuttingEdge, m_iTop, 2, m_iHeight, SOLID_STROKE);
grf.DrawLine(m_iLeft, m_iTopCuttingEdge, m_iWidth, 2, SOLID_STROKE);
grf.DrawLine(m_iLeft, m_iBottomCuttingEdge, m_iWidth, 2, SOLID_STROKE);
}
else
{
grf.DrawLine(m_iColumnedX, m_iTop, 2, m_iHeight, SOLID_STROKE);
grf.DrawImage(spImageCursor.Get(), m_iColumnedX - w/2, m_iColumnedY - h/2);
if (m_iCurAction==PdfColumnedComicOrderLR || m_iCurAction==PdfColumnedComicOrderRL)
{
//split to 2 pages
}
else
{
//split to 4 pages
grf.DrawLine(m_iLeft, m_iColumnedY, m_iWidth, 2, SOLID_STROKE);
}
}
if (m_btnTips.IsVisible())
m_btnTips.SetVisible(false);
DebugPrintf(DLC_ZHY,"leave %s::%s,%s(%d)",GetClassName(), __FUNCTION__, __FILE__, __LINE__);
return hr;
}
示例7: IsVisible
int Win::DoModal()
{
WinID lastParentFC = parent ? parent->lastFocusChild : 0;
bool visibled = IsVisible();
bool enabled = IsEnabled();
try {
if (!visibled) Show();
if (!enabled) Enable(true);
if (parent && type != WT_POPUP) parent->RecalcLayouts();
AppBlock(GetID());
UnblockTree(GetID());
ModalStruct modalStruct;
modal = &modalStruct;
MSG msg;
while (!modalStruct.end)
{
wth_DoEvents();
if (modalStruct.end) break;
if (!PeekMessage(&msg, NULL, 0, 0,PM_NOREMOVE))
{
unsigned waitTime = RunTimers();
if (waitTime > 5000) waitTime = 5000;
if (modalStruct.end) break;
HANDLE thEvent = wthInternalEvent.SignalFD();
DWORD res = MsgWaitForMultipleObjects(1,&thEvent,FALSE, waitTime, QS_ALLINPUT);
if (res == WAIT_TIMEOUT) CheckMousePosition();
continue;
}
if (!GetMessage(&msg, NULL, 0, 0))
break;
DispatchMessage(&msg);
}
modal = 0;
AppUnblock(GetID());
if (!visibled) Hide();
///
if (type == WT_POPUP || type == WT_CHILD && parent)
{
Win *w = GetWinByID(lastParentFC);
if (w) w->SetFocus();
}
return modalStruct.id;
} catch (...) {
modal = 0;
AppUnblock(GetID());
if (!visibled) Hide();
throw;
}
}
示例8: PutEnemy
/*@Function============================================================
@Desc: PutEnemy: This function draws an enemy into the combat window.
The only parameter given is the number of the enemy within the
AllEnemys array. Everything else is computed in here.
@Ret: void
* $Function----------------------------------------------------------*/
void
PutEnemy (int Enum , int x , int y)
{
SDL_Rect dst;
enemy *droid = &AllEnemys[Enum];
int type = droid->type;
int phase = droid->phase;
char *name = Druidmap[type].druidname;
if ( (droid->status == TERMINATED) || (droid->status == OUT) ||
(droid->levelnum != CurLevel->levelnum) )
return;
// if the enemy is out of sight, we need not do anything more here
if ((!show_all_droids) && (!IsVisible (&AllEnemys[Enum].pos)) )
{
DebugPrintf (3, "\nvoid PutEnemy(int Enum): ONSCREEN=FALSE --> usual end of function reached.\n");
return;
}
// We check for incorrect droid types, which sometimes might occor, especially after
// heavy editing of the crew initialisation functions ;)
if ( droid->type >= Number_Of_Droid_Types )
{
DebugPrintf (0, "ERROR: nonexistant droid-type encountered: %d\n", droid->type);
Terminate(ERR);
}
//--------------------
// First blit just the enemy hat and shoes.
SDL_BlitSurface (EnemySurfacePointer[phase], NULL, BuildBlock, NULL);
//--------------------
// Now the numbers should be blittet.
dst.x = FirstDigit_Rect.x;
dst.y = FirstDigit_Rect.y;
SDL_BlitSurface( EnemyDigitSurfacePointer[name[0]-'1'+1 ], NULL, BuildBlock, &dst);
dst.x = SecondDigit_Rect.x;
dst.y = SecondDigit_Rect.y;
SDL_BlitSurface( EnemyDigitSurfacePointer[name[1]-'1'+1 ], NULL, BuildBlock, &dst);
dst.x = ThirdDigit_Rect.x;
dst.y = ThirdDigit_Rect.y;
SDL_BlitSurface( EnemyDigitSurfacePointer[name[2]-'1'+1], NULL, BuildBlock, &dst);
// now blit the whole construction to screen:
if ( x == -1 )
{
dst.x=UserCenter_x + (droid->pos.x - Me.pos.x) * Block_Rect.w - Block_Rect.w/2;
dst.y=UserCenter_y + (droid->pos.y - Me.pos.y) * Block_Rect.h - Block_Rect.h/2;
}
else
{
dst.x=x ;
dst.y=y ;
}
SDL_BlitSurface (BuildBlock, NULL, ne_screen, &dst);
//--------------------
// At this point we can assume, that the enemys has been blittet to the
// screen, whether it's a friendly enemy or not.
//
// So now we can add some text the enemys says. That might be fun.
//
if ( (x == -1)
&& ( AllEnemys[Enum].TextVisibleTime < GameConfig.WantedTextVisibleTime )
&& GameConfig.Droid_Talk )
{
PutStringFont ( ne_screen , Font0_BFont ,
User_Rect.x+(User_Rect.w/2) + Block_Rect.w/3 + (AllEnemys[Enum].pos.x - Me.pos.x) * Block_Rect.w ,
User_Rect.y+(User_Rect.h/2) - Block_Rect.h/2 + (AllEnemys[Enum].pos.y - Me.pos.y) * Block_Rect.h ,
AllEnemys[Enum].TextToBeDisplayed );
}
DebugPrintf (2, "\nvoid PutEnemy(int Enum): ENEMY HAS BEEN PUT --> usual end of function reached.\n");
} // void PutEnemy(int Enum , int x , int y)
示例9: Assemble_Combat_Picture
void
Assemble_Combat_Picture (int mask)
{
int MapBrick;
int line, col;
int i;
static float TimeSinceLastFPSUpdate=10;
static int FPS_Displayed=1;
SDL_Rect TargetRectangle;
SDL_Rect TxtRect;
finepoint pos, vect;
float len;
bool vis = TRUE;
grob_point upleft, downright;
#define UPDATE_FPS_HOW_OFTEN 0.75
DebugPrintf (2, "\nvoid Assemble_Combat_Picture(...): Real function call confirmed.");
SDL_SetClipRect (ne_screen , &User_Rect);
if ( !GameConfig.AllMapVisible )
Fill_Rect (User_Rect, Black);
if ( (mask & SHOW_FULL_MAP) != 0 )
{
upleft.x = -5; upleft.y = -5;
downright.x = CurLevel->xlen + 5; downright.y = CurLevel->ylen + 5;
}
else
{
upleft.x = Me.pos.x - 6; upleft.y = Me.pos.y - 5;
downright.x = Me.pos.x + 7; downright.y = Me.pos.y + 5;
}
for (line = (int)upleft.y; line < (int)downright.y; line++)
{
for (col = (int)upleft.x; col < (int)downright.x; col++)
{
vis = TRUE;
if ( !GameConfig.AllMapVisible && ( (mask & SHOW_FULL_MAP) == 0x0) )
{
pos.x = col;
pos.y = line;
vect.x = Me.pos.x - pos.x;
vect.y = Me.pos.y - pos.y;
len = sqrt( vect.x * vect.x + vect.y * vect.y) + 0.01;
vect.x /= len;
vect.y /= len;
if (len > 0.5)
{
pos.x += vect.x;
pos.y += vect.y;
}
if ( !IsVisible (&pos) )
continue;
}
MapBrick = GetMapBrick( CurLevel, col , line );
TargetRectangle.x = UserCenter_x + (int)rint( (-Me.pos.x+1.0*col-0.5 )*Block_Rect.w);
TargetRectangle.y = UserCenter_y + (int)rint( (-Me.pos.y+1.0*line-0.5 )*Block_Rect.h);
SDL_BlitSurface( MapBlockSurfacePointer[CurLevel->color][MapBrick], NULL, ne_screen, &TargetRectangle);
} // for(col)
} // for(line)
// if we don't use Fullscreen mode, we have to clear the text-background manually
// for the info-line text:
TxtRect.x = Full_User_Rect.x;
TxtRect.y = Full_User_Rect.y+Full_User_Rect.h - FontHeight (Font0_BFont);
TxtRect.h = FontHeight (Font0_BFont);
TxtRect.w = Full_User_Rect.w;
SDL_SetClipRect (ne_screen, &TxtRect);
if (!GameConfig.FullUserRect)
SDL_FillRect(ne_screen, &TxtRect, 0);
if ( GameConfig.Draw_Position )
{
PrintStringFont( ne_screen , Font0_BFont , Full_User_Rect.x+Full_User_Rect.w/6 ,
Full_User_Rect.y+Full_User_Rect.h - FontHeight( Font0_BFont ),
"GPS: X=%d Y=%d Lev=%d" , (int) rintf(Me.pos.x) , (int) rintf(Me.pos.y) ,
CurLevel->levelnum );
}
if (!(mask & ONLY_SHOW_MAP) )
{
if ( GameConfig.Draw_Framerate )
{
TimeSinceLastFPSUpdate += Frame_Time();
if ( TimeSinceLastFPSUpdate > UPDATE_FPS_HOW_OFTEN )
{
FPS_Displayed=(int)(1.0/Frame_Time());
TimeSinceLastFPSUpdate=0;
//.........这里部分代码省略.........
示例10: Log
//.........这里部分代码省略.........
thisparty->exp = GetColorExp( thisclient->Stats->Level, thismon->thisnpc->level + special_lvl, exp );
thisparty->flag = false;
//LMA: bug
//thisparty->exp += exp * (unsigned long long) ((thisclient->Party->party->PartyLevel*2) / 100);
thisparty->exp += (unsigned long long) ((exp*thisclient->Party->party->PartyLevel*2) / 100);
thisparty->num = 1;
thisparty->partymember[0] = thisclient->CharInfo->charid;
thisparty->cheat_max_lvl=thisclient->Stats->Level;
thisparty->cheat_min_lvl=thisclient->Stats->Level;
thisparty->maxlevel = thisclient->Stats->Level;
for(unsigned int p=0;p<ClientList.size();p++)
{
CPlayer* otherclient = (CPlayer*) ClientList.at( p )->player;
if(otherclient->client==NULL) continue;
if(otherclient->Party->party==NULL) continue;
if(!otherclient->client->isActive) continue;
if(!otherclient->Session->inGame) continue;
//LMA: checking the gap between the max and min level of people in the party.
if (thisclient->Party->party == otherclient->Party->party)
{
if(otherclient->Stats->Level>thisparty->cheat_max_lvl)
{
thisparty->cheat_max_lvl=otherclient->Stats->Level;
}
if(otherclient->Stats->Level<thisparty->cheat_min_lvl)
{
thisparty->cheat_min_lvl=otherclient->Stats->Level;
}
}
if( IsVisible(thisclient, otherclient))
{
if(thisclient->Party->party == otherclient->Party->party )
{
//LMA: Little stupid check.
if (thisparty->num==7)
{
Log(MSG_WARNING,"Too many people in this party, already at max, skipping");
break;
}
thisparty->partymember[thisparty->num] = otherclient->CharInfo->charid;
thisparty->num++;
thisparty->maxlevel += otherclient->Stats->Level;
}
}
}
PartyExp.push_back( thisparty );
}
continue;
}
//LMA BEGIN
//20070621-211100
//mod for CF
//Adding bonusxp (mileage)
//UINT prev_xp=thisclient->CharInfo->Exp;
//LMA: Xp nullifier.
if(!thisclient->no_exp)
{
int tempexp = thisclient->bonusxp*GetColorExp( thisclient->Stats->Level, thismon->thisnpc->level + special_lvl, exp );
if (tempexp <= 0)
示例11: IsVisible
bool CGUIRenderingControl::CanFocusFromPoint(const CPoint &point) const
{ // mouse is allowed to focus this control, but it doesn't actually receive focus
return IsVisible() && HitTest(point);
}
示例12: UplinkAssert
void UserIDScreenInterface::Create ( ComputerScreen *newcs )
{
UplinkAssert ( newcs );
cs = newcs;
if ( !IsVisible () ) {
EclRegisterButton ( 130, 90, 320, 25, GetComputerScreen ()->maintitle, "", "useridscreen_maintitle" );
EclRegisterButtonCallbacks ( "useridscreen_maintitle", DrawMainTitle, NULL, NULL, NULL );
EclRegisterButton ( 130, 110, 320, 20, GetComputerScreen ()->subtitle, "", "useridscreen_subtitle" );
EclRegisterButtonCallbacks ( "useridscreen_subtitle", DrawSubTitle, NULL, NULL, NULL );
EclRegisterButton ( 168, 155, 220, 120, "", "", "useridscreen_image" );
button_assignbitmap ( "useridscreen_image", "userid.tif" );
EclRegisterButtonCallbacks ( "useridscreen_image", imagebutton_draw, CodeButtonClick, button_click, button_highlight );
EclRegisterButton ( 227, 210, 148, 15, "", "Enter your userID here", "useridscreen_name" );
EclRegisterButtonCallbacks ( "useridscreen_name", UserIDButtonDraw, CodeButtonClick, button_click, button_highlight );
EclRegisterButton ( 227, 236, 148, 15, "", "Enter your access code here", "useridscreen_code" );
EclRegisterButtonCallbacks ( "useridscreen_code", CodeButtonDraw, CodeButtonClick, button_click, button_highlight );
EclRegisterButton ( 168, 280, 120, 15, "", "", "useridscreen_message" );
EclRegisterButtonCallbacks ( "useridscreen_message", textbutton_draw, NULL, NULL, NULL );
EclRegisterButton ( 308, 280, 80, 15, "Proceed", "Click here when done", "useridscreen_proceed" );
button_assignbitmaps ( "useridscreen_proceed", "proceed.tif", "proceed_h.tif", "proceed_c.tif" );
EclRegisterButtonCallback ( "useridscreen_proceed", ProceedClick );
EclMakeButtonEditable ( "useridscreen_name" );
EclMakeButtonEditable ( "useridscreen_code" );
// Create the box that will show the currently known codes for this screen
UplinkAssert ( cs->GetComputer () );
if ( game->GetWorld ()->GetPlayer ()->codes.LookupTree ( cs->GetComputer ()->ip ) ) {
DArray <char *> *codes = game->GetWorld ()->GetPlayer ()->codes.ConvertToDArray ();
DArray <char *> *ips = game->GetWorld ()->GetPlayer ()->codes.ConvertIndexToDArray ();
EclRegisterButton ( 200, 310, 250, 15, "Known Access Codes", "", "useridscreen_codestitle" );
EclRegisterButtonCallbacks ( "useridscreen_codestitle", textbutton_draw, NULL, NULL, NULL );
int currentcode = 0;
for ( int i = 0; i < codes->Size (); ++i ) {
if ( codes->ValidIndex (i) && ips->ValidIndex (i) ) {
if ( strcmp ( ips->GetData (i), cs->GetComputer ()->ip ) == 0 ) {
char name [64];
UplinkSnprintf ( name, sizeof ( name ), "useridscreen_code %d", currentcode );
EclRegisterButton ( 200, 330 + currentcode*15, 250, 15, codes->GetData (i), "Use this code", name );
EclRegisterButtonCallbacks ( name, textbutton_draw, AccessCodeClick, button_click, button_highlight );
++currentcode;
}
}
}
delete codes;
delete ips;
}
#ifdef CHEATMODES_ENABLED
// Create a symbol for quick entry into this screen
EclRegisterButton ( 3, 20, 30, 15, "#", "Click here to bypass this screen (DEBUG MODE ONLY)", "useridscreen_bypass" );
EclRegisterButtonCallbacks ( "useridscreen_bypass", textbutton_draw, BypassClick, button_click, button_highlight );
#endif
}
}
示例13: Update
void CriminalScreenInterface::Update ()
{
if ( searchname && IsVisible () ) {
int timems = (int)EclGetAccurateTime () - lastupdate;
if ( timems > 100 ) {
// We are searching for a record
// Is this one it?
Computer *comp = game->GetWorld ()->GetComputer ( "Global Criminal Database" );
UplinkAssert (comp);
// Have we searched all records?
//if ( recordindex == comp->recordbank.records.Size () ) {
if ( recordindex == -1 ) {
delete [] searchname;
searchname = NULL;
recordindex = -1;
return;
}
Record *rec = comp->recordbank.GetRecord ( recordindex );
char *thisname = rec->GetField ( RECORDBANK_NAME );
UplinkAssert (thisname);
char *lowercasethisname = LowerCaseString (thisname);
// Update display with the current record
UpdateScreen ();
if ( strcmp ( searchname, lowercasethisname ) == 0 ) {
// Record found - stop searching
delete [] searchname;
searchname = NULL;
}
else {
// Record not found
//recordindex++;
recordindex = comp->recordbank.FindNextRecordIndexNameNotSystemAccount ( recordindex );
}
delete [] lowercasethisname;
lastupdate = (int)EclGetAccurateTime ();
}
}
}
示例14: UplinkAssert
void CriminalScreenInterface::Create ( ComputerScreen *newcs )
{
UplinkAssert (newcs);
cs = newcs;
if ( !IsVisible () ) {
// Draw the screen titles
EclRegisterButton ( 80, 60, 350, 25, GetComputerScreen ()->maintitle, "", "criminalscreen_maintitle" );
EclRegisterButtonCallbacks ( "criminalscreen_maintitle", DrawMainTitle, NULL, NULL, NULL );
EclRegisterButton ( 80, 80, 350, 20, GetComputerScreen ()->subtitle, "", "criminalscreen_subtitle" );
EclRegisterButtonCallbacks ( "criminalscreen_subtitle", DrawSubTitle, NULL, NULL, NULL );
EclRegisterButton ( 30, 130, 128, 160, "", "Shows the person's photograph", "criminal_photo" );
button_assignbitmap ( "criminal_photo", "photos/image0.tif" );
EclRegisterButton ( 180, 130, 210, 15, "Name", " ", "criminal_nametitle" );
EclRegisterButtonCallbacks ( "criminal_nametitle", button_draw, NULL, NULL, NULL );
EclRegisterButton ( 190, 146, 190, 38, " ", " ", "criminal_name" );
EclRegisterButtonCallbacks ( "criminal_name", NameDraw, NULL, NULL, NULL );
EclRegisterButton ( 180, 145, 210, 40, " ", " ", "criminal_nameborder" );
EclRegisterButtonCallbacks ( "criminal_nameborder", NameBorderDraw, NULL, NULL, NULL );
// History text box
EclRegisterButton ( 180, 200, 210, 15, "Criminal History", "", "criminal_historytitle" );
EclRegisterButtonCallbacks ( "criminal_historytitle", button_draw, NULL, NULL, NULL );
EclRegisterButton ( 180, 215, 210, 140, "", "", "criminal_history" );
EclRegisterButtonCallbacks ( "criminal_history", HistoryDraw, NULL, NULL, NULL );
if ( game->GetInterface ()->GetRemoteInterface ()->security_level <= 2 ) {
EclRegisterButton ( 180, 354, 180, 16, "", "Enter new convictions here", "criminal_newconvictiontext" );
EclRegisterButtonCallbacks ( "criminal_newconvictiontext", HistoryDraw, NULL, NULL, button_highlight );
EclRegisterButton ( 360, 355, 30, 15, "Add", "Click to add this conviction", "criminal_newconvictionadd" );
EclRegisterButtonCallback ( "criminal_newconvictionadd", AddConvictionClick );
// Control buttons
EclRegisterButton ( 30, 315, 128, 15, "Clear history", "Click here to clear this man's record", "criminal_clear" );
EclRegisterButtonCallback ( "criminal_clear", ClearClick );
EclRegisterButton ( 30, 335, 128, 15, "Authorise Arrest", "Click here to authorise this man's arrest", "criminal_arrest" );
EclRegisterButtonCallback ( "criminal_arrest", ArrestClick );
}
EclRegisterButton ( 30, 355, 128, 15, "Done", "Close this screen", "criminal_close" );
EclRegisterButtonCallback ( "criminal_close", CloseClick );
EclMakeButtonEditable ( "criminal_newconvictiontext" );
}
}
示例15: CoGetInterfaceAndReleaseStream
HRESULT CWordObject::Release()
{
HRESULT hr;
if (m_pUnknown == NULL)
return S_OK;
LPUNKNOWN lpUnk = NULL;
if (m_pStrUnknown != NULL)
{
hr = CoGetInterfaceAndReleaseStream(m_pStrUnknown, IID_IUnknown, (void**) &lpUnk);
if (FAILED(hr))
{
LOG_WS_ERROR(_T("CoGetInterfaceAndReleaseStream FAILED."));
}
}
else
{
lpUnk = m_pUnknown;
m_pWordCreator->AddRef(lpUnk);
}
try
{
m_pUnknown->Release();
m_pUnknown = NULL;
}
catch(...)
{
m_pUnknown = NULL;
LOG_WS_ERROR(_T("m_pUnknown Failed to release"));
}
if (NULL == lpUnk)
{
LOG_WS_ERROR(_T("lpUnk == NULL"));
return E_FAIL;
}
if (m_bUsingCurrentInstance)
{
hr = S_FALSE;
}
else if (!IsVisible(lpUnk))
{
hr = Quit(lpUnk);
}
else
{
// If Word is visible, then only quit the cached Word instance if we are sure that
// there aren't any manually opened documents. i.e. if the user has opened a document,
// so that there is a visible instance of Word open while DeltaVw is still open.
Word::_ApplicationPtr pApp = GetApplicationPtr();
if( pApp )
{
long lNumDocs = pApp->Documents->Count;
if( lNumDocs <= 0 )
{
LOG_WS_INFO(L"No open documents found for the current Word instance. Quitting Word");
SetVisible(false);
hr = Quit(lpUnk);
}
else
{
LOG_WS_INFO(L"Documents are still open in the current Word instance. NOT quitting Word");
}
}
}
if (IsCachingWordEnabled())
m_pGit->RevokeInterfaceFromGlobal(m_dwSessionCookie);
try
{
if (lpUnk)
{
lpUnk->Release();
lpUnk = NULL;
}
}
catch(...)
{
lpUnk = NULL;
LOG_WS_ERROR(_T("m_pUnknown Failed to release"));
}
// This is required to stop the DeltaView app tests from hanging
Sleep(125);
return hr;
}