Exemplo n.º 1
0
void AutoHideBar::OnHighlight()
{
    DockableCtrl* hiddenwindow = NULL;

    if(highlight >= 0)
        hiddenwindow = tabs[highlight].dock;
    if(!hiddenwindow || hiddenwindow == ctrl)
        return;
    else if(ctrl)
    {
        if(hiddenwindow)
        {
            if(popup.IsOpen())
                popup.Close();
            ctrl->Remove();
            ctrl = NULL;
        }
        else HideWindow();
    }
    if(hiddenwindow)
    {
        TabInterface::SetActiveTab(highlight);
        ShowWindow();
    }
}
Exemplo n.º 2
0
static void OnSpKeyDown(WPARAM wParam, LPARAM lParam)
{
	switch(wParam){
	case	VK_TAB:
		if(!IsWindowVisible(g_hWnd)){
			OnListUpdate();
		}
		else{
			if(!g_Shift){
				g_WndList->MoveCursor(1);
			}
			else{
				g_WndList->MoveCursor(-1);
			}
			InvalidateItem();
		}
		break;
	case	VK_ESCAPE:
	case	VK_KANJI:
		HideWindow();
		break;
	case	VK_UP:
		g_WndList->MoveCursor(-1);
		InvalidateItem();
		break;
	case	VK_DOWN:
		g_WndList->MoveCursor(1);
		InvalidateItem();
		break;
	case	VK_LSHIFT:
	case	VK_RSHIFT:
		g_Shift = TRUE;
		break;
	}
}
Exemplo n.º 3
0
CityEspionage::~CityEspionage()
{
	HideWindow();

	if (m_inventoryList)
	{
		m_inventoryList->ClearUserData CALL_TEMPLATE_FUNCTION_WITHOUT_ARGUMENT(InventoryItemInfo);
		m_inventoryList->Clear();
	}

	for (size_t unitIndex = 0; unitIndex < k_MAX_ARMY_SIZE; ++unitIndex) 
	{
		MBCHAR  block [k_MAX_NAME_LEN];
		sprintf(block, "DialogBackground.FortifiedUnitsBox.Unit%i", unitIndex);

		ctp2_Static * unitPicture  = static_cast<ctp2_Static *>
		                                (aui_Ldl::GetObject(LDL_BLOCK, block));
		if (unitPicture) 
		{
			unitPicture->ExchangeImage(0, 0, NULL);
		}
	}

	aui_Ldl::DeleteHierarchyFromRoot(LDL_BLOCK);
}
Exemplo n.º 4
0
void StartCarbonModalDialog(void)
{
	HiliteMenu(0);
	DisableMenus();
	if (gWindow)
		HideWindow(gWindow);
}
Exemplo n.º 5
0
LRESULT CDlgPopup::OnMsgTabItemHit( WPARAM wParam,LPARAM lParam )
{
	SendEmoticon((LPCTSTR)wParam);
	HideWindow();

	return 0;
}
Exemplo n.º 6
0
void PouringWindow::updateUI()
{
    if (pouring == false)
    {
        double now = time(NULL);
        if (closeWindowAt < now)
            HideWindow();
        return;
    }

    updateScanningText();

    if (foundNewUser)
    {
        int userIndex = std::find(User::UsersList.begin(), User::UsersList.end(), currentUser) - User::UsersList.begin();
        ui->usersComboBox->setCurrentIndex(userIndex);
        foundNewUser = false;
    }

    liters = FlowMeterManager::Ticks / (double)ticksPerLiter;
    ounces = liters * Constants::OuncesPerLiter;
    price = FlowMeterManager::CurrentKeg->GetPrice(liters);

    ui->volumePouredField->setText(QString("%1oz").arg(QString::number(ounces, 'f', 1)));
    ui->priceField->setText(QString("$%1").arg(QString::number(price, 'f', 2)));
}
Exemplo n.º 7
0
void PouringWindow::on_finishPourButton_clicked()
{
    if (pouring)
        FlowMeterManager::Instance->FinishPour();
    else
        HideWindow();
}
Exemplo n.º 8
0
bool unloadPlayerWin()
{
    ControlRef cRef;
    ControlID cID;
    OSStatus iErr;

    cID.signature = FOUR_CHAR_CODE('volu');
    cID.id = 6;
    if (noErr != (iErr = GetControlByID(g_refPlayerWin, &cID, &cRef)))
    {
        /* We don't return false here since this is always called on the way out. */
        fprintf(stderr, "unloadPlayerWin() - GetControlByID() failed, returning %lu!\n", (unsigned long) iErr);
    }
    else
    {
        SetControlAction(cRef, (ControlActionUPP) -1);        
    }
    
    HideWindow(g_refPlayerWin);
    RemoveEventHandler(g_refSeekHdlr);
    RemoveEventHandler(g_refPlayerHdlr);
    DisposeWindow(g_refPlayerWin);
    DisposeEventHandlerUPP(g_lpfnPlayerProc);
    DisposeControlActionUPP(g_lpfnVolumeProc);

    return true;
}
Exemplo n.º 9
0
bool unloadInfoWin()
{
    DataBrowserCallbacks dbc;
    ControlRef cRef;
    ControlID cID;

    cID.signature = FOUR_CHAR_CODE('tags');
    cID.id = 16;
    if (noErr == GetControlByID(g_refInfoWin, &cID, &cRef))
    {
        dbc.version = kDataBrowserLatestCallbacks;
        if (noErr == InitDataBrowserCallbacks(&dbc))
        {
            SetDataBrowserCallbacks(cRef, &dbc);
        }
    }

    clearInfoWin();

    HideWindow(g_refInfoWin);
    RemoveEventHandler(g_refInfoHdlr);
    DisposeWindow(g_refInfoWin);
    DisposeEventHandlerUPP(g_lpfnInfoProc);
    DisposeDataBrowserItemDataUPP(g_lpfnGSIDProc);

    /* Clean up any previous contents */
    
    return true;
}
Exemplo n.º 10
0
void GBWindow::Hide() {
#if MAC
	HideWindow(window);
#elif WINDOWS
	ShowWindow(win, SW_HIDE);
#endif
	visible = false;
}
Exemplo n.º 11
0
void
GUI::ToggleWindow(uint16 id)
{
	if (IsWindowShown(id))
		HideWindow(id);
	else
		ShowWindow(id);
}
Exemplo n.º 12
0
bool unloadAboutWin()
{
    HideWindow(g_refAboutWin);
    RemoveEventHandler(g_refAboutHdlr);
    DisposeWindow(g_refAboutWin);
    DisposeEventHandlerUPP(g_lpfnAboutProc);
    return true;
}
Exemplo n.º 13
0
/*** DESTRUCTOR ***/
WindowObject::~WindowObject( void )
{
	if( window )
	{
		HideWindow( window );
		DisposeWindow( window );
	}
}
void CXTPReportInplaceEdit::OnEnKillfocus()
{
	if (pControl && pItem)
	{
		pItem->OnValidateEdit((XTP_REPORTRECORDITEM_ARGS*)this);
		//pItem->OnCancelEdit(pControl, TRUE);
		HideWindow();
	}
}
Exemplo n.º 15
0
void TermWindow::ReShowWindow() {
    if(this->isVisible()) {
        HideWindow(); //start with same animation as hide
        animRunning = 3; //flag as a re-show (hide, then show);
    } else {
        //Already hidden, just show it
        ShowWindow();
    }
}
Exemplo n.º 16
0
bool hideInfoWin()
{
    if (!g_bLoaded)  {  return false;  }
    if (!g_bVisible)  {  return true;  }

    HideWindow(g_refInfoWin);
    g_bVisible = false;
    return true;
}
Exemplo n.º 17
0
void OSD::RemoveWindow(const QString &window)
{
    if (!m_Children.contains(window))
        return;

    HideWindow(window);
    MythScreenType *child = m_Children.value(window);
    m_Children.remove(window);
    delete child;
}
Exemplo n.º 18
0
bool8 NPServerDialog (void)
{
	OSStatus	err;
	IBNibRef	nibRef;

	npserver.dialogcancel = true;

	err = CreateNibReference(kMacS9XCFString, &nibRef);
	if (err == noErr)
	{
		WindowRef	tWindowRef;

		err = CreateWindowFromNib(nibRef, CFSTR("ClientList"), &tWindowRef);
		if (err == noErr)
		{
			EventHandlerRef		eref;
			EventLoopTimerRef	tref;
			EventHandlerUPP		eventUPP;
			EventLoopTimerUPP	timerUPP;
			EventTypeSpec		windowEvents[] = { { kEventClassCommand, kEventCommandProcess      },
												   { kEventClassCommand, kEventCommandUpdateStatus } };
			HIViewRef			ctl;
			HIViewID			cid = { 'Chse', 0 };

			npserver.dialogprocess = kNPSDialogInit;

			eventUPP = NewEventHandlerUPP(NPServerDialogEventHandler);
			err = InstallWindowEventHandler(tWindowRef, eventUPP, GetEventTypeCount(windowEvents), windowEvents, (void *) tWindowRef, &eref);

			timerUPP = NewEventLoopTimerUPP(NPServerDialogTimerHandler);
			err = InstallEventLoopTimer(GetCurrentEventLoop(), 0.0f, 0.1f, timerUPP, (void *) tWindowRef, &tref);

			HIViewFindByID(HIViewGetRoot(tWindowRef), cid, &ctl);
			HIViewSetVisible(ctl, false);

			MoveWindowPosition(tWindowRef, kWindowServer, false);
			ShowWindow(tWindowRef);
			err = RunAppModalLoopForWindow(tWindowRef);
			HideWindow(tWindowRef);
			SaveWindowPosition(tWindowRef, kWindowServer);

			err = RemoveEventLoopTimer(tref);
			DisposeEventLoopTimerUPP(timerUPP);

			err = RemoveEventHandler(eref);
			DisposeEventHandlerUPP(eventUPP);

			CFRelease(tWindowRef);
		}

		DisposeNibReference(nibRef);
	}

	return (!npserver.dialogcancel);
}
Exemplo n.º 19
0
void  ThermDialog::RemoveTherm(void)
{

    HideWindow(dp);
    DisposDialog (dp);
    HPurge ((Handle) dt);
    ReleaseResource((Handle)dt);

    SetPort(olddp);

}
Exemplo n.º 20
0
 //-------------------------------------------------------------------------------------------------//
 void OSXCarbonWindow::setHidden(bool hidden)
 {
     mHidden = hidden;
     if (!mIsExternal)
     {
         if (hidden)
             HideWindow(mWindow);
         else
             ShowWindow(mWindow);
     }
 }
Exemplo n.º 21
0
static OSStatus infoEvtHandler(EventHandlerCallRef nextHdlr, EventRef thisEvt, void *pvUserData)
{
    if ( (kEventClassWindow != GetEventClass(thisEvt)) ||
         (kEventWindowClose != GetEventKind(thisEvt)) )
    {
        return CallNextEventHandler(nextHdlr, thisEvt);
    }

    HideWindow(g_refInfoWin);
    g_bVisible = false;
    return noErr;
}
Exemplo n.º 22
0
void cvSetModeWindow_CARBON( const char* name, double prop_value)//Yannick Verdie
{
    OSStatus err = noErr;


    CV_FUNCNAME( "cvSetModeWindow_QT" );

    __BEGIN__;

    CvWindow* window;

    if(!name)
        CV_ERROR( CV_StsNullPtr, "NULL name string" );

    window = icvFindWindowByName( name );
    if( !window )
        CV_ERROR( CV_StsNullPtr, "NULL window" );

    if(window->flags & CV_WINDOW_AUTOSIZE)//if the flag CV_WINDOW_AUTOSIZE is set
        EXIT;

    if (window->status==CV_WINDOW_FULLSCREEN && prop_value==CV_WINDOW_NORMAL)
    {
        err = EndFullScreen(window->restoreState,0);
        if (err != noErr)
            fprintf(stdout,"Error EndFullScreen\n");
        window->window = window->oldwindow;
        ShowWindow( window->window );

        window->status=CV_WINDOW_NORMAL;
        EXIT;
    }

    if (window->status==CV_WINDOW_NORMAL && prop_value==CV_WINDOW_FULLSCREEN)
    {
        GDHandle device;
        err = GetWindowGreatestAreaDevice(window->window, kWindowTitleBarRgn, &device, NULL);
        if (err != noErr)
            fprintf(stdout,"Error GetWindowGreatestAreaDevice\n");

        HideWindow(window->window);
        window->oldwindow = window->window;
        err = BeginFullScreen(&(window->restoreState), device, 0, 0, &window->window, 0, fullScreenAllowEvents | fullScreenDontSwitchMonitorResolution);
        if (err != noErr)
            fprintf(stdout,"Error BeginFullScreen\n");

        window->status=CV_WINDOW_FULLSCREEN;
        EXIT;
    }

    __END__;
}
Exemplo n.º 23
0
// --------------------------------------------------------------------------------------
void ClosePrefsDialog(DialogRef prefsDialog)
{
	ControlRef listBoxControl;
	ListHandle iconList;
	
	HideWindow(GetDialogWindow(prefsDialog));
	GetDialogItemAsControl(prefsDialog, iIconList, &listBoxControl);
	GetControlData(listBoxControl, kControlEntireControl, kControlListBoxListHandleTag, 
					sizeof(ListHandle), &iconList, NULL);
	ReleaseIconListIcons(iconList);
	DisposeDialog(prefsDialog);
	EnableMenuItem(GetMenuRef(mDemonstration), iPrefsDialog);
}
Exemplo n.º 24
0
void
XUnmapWindow(
    Display *display,		/* Display. */
    Window window)		/* Window. */
{
    MacDrawable *macWin = (MacDrawable *) window;
    XEvent event;

    display->request++;
    macWin->winPtr->flags &= ~TK_MAPPED;
    if (Tk_IsTopLevel(macWin->winPtr)) {
	if (!Tk_IsEmbedded(macWin->winPtr) &&
		macWin->winPtr->wmInfoPtr->hints.initial_state!=IconicState) {
	    /*
	     * XXX This should be HideSheetWindow for kSheetWindowClass
	     * XXX windows that have a wmPtr->master parent set.
	     */

	    WindowRef wref = TkMacOSXDrawableWindow(window);

	    if ((macWin->winPtr->wmInfoPtr->macClass == kSheetWindowClass)
		    && (macWin->winPtr->wmInfoPtr->master != None)) {
		HideSheetWindow(wref);
	    } else {
		HideWindow(wref);
	    }
	}
	TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr);

	/*
	 * We only need to send the UnmapNotify event for toplevel windows.
	 */

	event.xany.serial = display->request;
	event.xany.send_event = False;
	event.xany.display = display;

	event.xunmap.type = UnmapNotify;
	event.xunmap.window = window;
	event.xunmap.event = window;
	event.xunmap.from_configure = false;
	Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
    } else {
	/*
	 * Generate damage for that area of the window.
	 */

	TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
	TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr->parentPtr);
    }
}
Exemplo n.º 25
0
void AutoHideBar::Detach(DockableCtrl& ctrl)
{
    DockWindow& c = reinterpret_cast<DockWindow&>(ctrl);
    active = TabInterface::Find(ctrl);
    if(tabs.GetCount() == 1)
    {
        CloseAll();
        HideBar();
    }
    else Close(active);
    childcount--;
    c.SetOwnerBar(NULL);
    HideWindow();
}
Exemplo n.º 26
0
/*
 * show or hide vumeter window as specified trough "flag" argument
 */
void CARBON_GUI::showVumeters(bool flag) {
	OSStatus err;
	if(flag) {
	//	OpenDrawer(vumeterWindow,kWindowEdgeTop,false);
		Rect bounds;
		GetWindowBounds(window,kWindowGlobalPortRgn,&bounds);
		MoveWindow(vumeterWindow,bounds.right+15,bounds.top-5,false);
		ShowWindow(vumeterWindow);
	}
	else {
	//	CloseDrawer(vumeterWindow,false);
		HideWindow(vumeterWindow);
	}
}
Exemplo n.º 27
0
static OSStatus playerEvtHandler(EventHandlerCallRef nextHdlr, EventRef thisEvt, void *pvUserData)
{
    ControlRef cRef;
    ControlID cID;
    OSStatus iErr;

    UInt32 iSize, iPos;
    HIPoint pMouse;
    Rect rDims;
    int iPct;
    
    if ( (kEventClassWindow == GetEventClass(thisEvt)) &&
         (kEventWindowClose == GetEventKind(thisEvt)) )
    {
        HideWindow(g_refPlayerWin);
        g_bVisible = false;
        return noErr;
    }
    else if ( (kEventClassControl == GetEventClass(thisEvt)) &&
              (kEventControlClick == GetEventKind(thisEvt)) )
    {
        if (noErr != (iErr = GetEventParameter(thisEvt, kEventParamWindowMouseLocation, typeHIPoint, NULL, sizeof(Point), NULL, &pMouse)))
        {
            fprintf(stderr, "playerEvtHandler() - GetEventParameter(HitTest) failed, returning %lu!\n", (unsigned long) iErr);
        }

        cID.signature = FOUR_CHAR_CODE('fpos');
        cID.id = 7;
        if (noErr == (iErr = GetControlByID(g_refPlayerWin, &cID, &cRef)))
        {
            GetControlBounds(cRef, &rDims);
            iSize = rDims.right - rDims.left;
            iPos = (UInt32) pMouse.x - rDims.left;
            iPct = (int) (100.0 * ((double) iPos) / ((double) iSize));
        }
        else
        {
            fprintf(stderr, "playerEvtHandler() - GetControlByID() failed, returning %lu!\n", (unsigned long) iErr);
        }
        
        attemptSeekTo(iPct);
        
        return CallNextEventHandler(nextHdlr, thisEvt);        
    }
    else
    {
        return CallNextEventHandler(nextHdlr, thisEvt);
    }
}
Exemplo n.º 28
0
// --------------------------------------------------------------------------------------
void ClosePrefsDialog(DialogRef prefsDialog)
{
	ControlRef listBoxControl;
	ListHandle iconList;
	
	HideWindow(GetDialogWindow(prefsDialog));
	GetDialogItemAsControl(prefsDialog, iIconList, &listBoxControl);
	GetControlData(listBoxControl, kControlEntireControl, kControlListBoxListHandleTag, 
					sizeof(ListHandle), &iconList, NULL);
	ReleaseIconListIcons(iconList);
	DisposeEventHandlerUPP(gDialogEventHandler);
	DisposeEventHandlerUPP(gListBoxControlEventHandler);
	RegisterListDefinition(kIconListLDEF, NULL);	// unregister the list definition
	DisposeDialog(prefsDialog);
	EnableMenuItem(GetMenuRef(mDemonstration), iPrefsDialog);
}
Exemplo n.º 29
0
static void OnSpKeyUp(WPARAM wParam, LPARAM lParam)
{
	switch(wParam){
	case	VK_LSHIFT:
	case	VK_RSHIFT:
		g_Shift = FALSE;
		break;
	case	VK_LMENU:
	case	VK_RMENU:
		if(IsWindowVisible(g_hWnd)){
			g_WndList->Activate();
			HideWindow();
		}
		break;
	}
}
Exemplo n.º 30
0
void Shell::CloseWindow()
{
	// Shutdown OpenGL if necessary.
	if (opengl_attached)
	{
		aglSetCurrentContext(NULL);
		aglSetDrawable(gl_context, NULL);
		aglDestroyContext(gl_context);
		
		gl_context = NULL;
	}

	// Close the window.
	HideWindow(window);
	ReleaseWindow(window);
}