Beispiel #1
0
bool Label::Create(LPCTSTR name, HINSTANCE hInstance)
{
    // Set this instance's name
    StrCopy(mName, MAX_NAME, name);
    
    // Read configuration first since we need it to create the window
    ReadConfig();
    
    // Create the window
    mWindow = CreateWindowEx(WS_EX_TOOLWINDOW,
        WINDOW_CLASS, NULL,
        WS_POPUP,
        mX, mY,
        mWidth, mHeight,
        NULL, NULL,
        hInstance, this);
    
    if (!mWindow)
    {
        TRACE2("%s: CreateWindowEx failed, GetLastError returns %d", MODULE_NAME, GetLastError());
        return false;
    }
    
    // Adjust the window's z-order, make it sticky, and show it
    SetAlwaysOnTop(mAlwaysOnTop);
    SetSticky(true);
    SetVisible(mVisible);
    
    return true;
}
Beispiel #2
0
void WXAppBar::UnSetDockedModeStep2()
{
	Display *dd= (Display *) wxGetDisplay();

	// Window X11 handle
	GtkWidget *gtkWidget= (GtkWidget *) this->GetHandle();
	Window w= GDK_WINDOW_XWINDOW (gtkWidget->window);
	
	Refresh();
	Update();
	
	//
	// Set window style back to normal again
	//
	Atom atomTmp= XInternAtom (dd, "_NET_WM_WINDOW_TYPE", False);
	Atom atom_NET_WM_WINDOW_TYPE_NORMAL= XInternAtom (dd, "_NET_WM_WINDOW_TYPE_NORMAL", False);
	unsigned long propInfo= atom_NET_WM_WINDOW_TYPE_NORMAL;
	XChangeProperty (dd, w, atomTmp, XA_ATOM, 32, PropModeReplace, (unsigned char *) &propInfo, 1);
	XSync(dd, False);
	
	// The code above disables the sticky property, so we enable it again
	SetSticky(true);
	
	// Restore decorations when needed
	SetBorderDecorations(m_dialogHadBorderDecorations);
	
	// Restore original size
	wxSize proposedSize= DoGetBestSize();
	//SetSize (0, 0, proposedSize.GetWidth(), proposedSize.GetHeight());
	SetSize (proposedSize.GetWidth(), proposedSize.GetHeight());
}
Beispiel #3
0
bool WXAppBar::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
	bool retval= wxDialog::Create( parent, id, caption, pos, size, style );
	// Sticky window by default
	SetSticky(true);
	return retval;
}
Beispiel #4
0
	MouseToolTip()
	{
		fView = new MouseView();
		SetSticky(true);
	}
Beispiel #5
0
void WXAppBar::SetAutohideModeStep ()
{
	//CheckCreateWindow();

	//
	// Get X11 display
	//
	Display* dd= (Display *) wxGetDisplay(); assert (dd);
	
	//
	// Get desktop working area dimensions
	//
	int xDesktop, yDesktop, widthDesktop, heightDesktop, screenWidth, screenHeight;
	GetDesktopDimensions (dd, xDesktop, yDesktop, widthDesktop, heightDesktop, screenWidth, screenHeight);
	
	//
	// As we need to dock the window disable decorations
	//
	m_dialogHadBorderDecorations= GetBorderDecorations();
	SetBorderDecorations(false);
	
	//
	// Get X11 handle for our window
	//
	GtkWidget *gtkWidget= (GtkWidget *) this->GetHandle();
	Window w= GDK_WINDOW_XWINDOW (gtkWidget->window);
	
	// Get original dimensions of the bar
	wxSize proposedSize= GetBestSize();

	// Compute bar position and size depending on docking mode
	m_Width= proposedSize.GetWidth();
	m_Height= proposedSize.GetHeight();
	
	switch (m_currentDockingMode) {
		case TOP_DOCKED:
			m_X= (screenWidth - proposedSize.GetWidth())/2;
			m_Y= 0 - proposedSize.GetHeight() + AUTOHIDE_FLANGE;
			break;
		case BOTTOM_DOCKED:
			m_X= (screenWidth - proposedSize.GetWidth())/2;
			m_Y= screenHeight - AUTOHIDE_FLANGE;
			break;
		case LEFT_DOCKED:
			m_X= 0 - proposedSize.GetWidth() + AUTOHIDE_FLANGE;
			m_Y= (screenHeight - proposedSize.GetHeight())/2;
			break; 
		case RIGHT_DOCKED:
			m_X= screenWidth - AUTOHIDE_FLANGE;
			m_Y= (screenHeight - proposedSize.GetHeight())/2;
			break;
		case NON_DOCKED:
		default:
			assert (false);
	}
	
	
	//
	// Functional type of the window (_NET_WM_WINDOW_TYPE)
	//
	Atom atomTmp= XInternAtom (dd, "_NET_WM_WINDOW_TYPE", False);
	Atom atom_NET_WM_WINDOW_TYPE_DOCK= XInternAtom (dd, "_NET_WM_WINDOW_TYPE_DOCK", False);
	Atom atom_NET_WM_WINDOW_TYPE_NORMAL= XInternAtom (dd, "_NET_WM_WINDOW_TYPE_NORMAL", False);
	unsigned long propInfo[2];
	propInfo[0]= atom_NET_WM_WINDOW_TYPE_DOCK;
	propInfo[1]= atom_NET_WM_WINDOW_TYPE_NORMAL;		
	XChangeProperty (dd, w, atomTmp, XA_ATOM, 32, PropModeReplace, (unsigned char *) &propInfo[0], 2);
	SetSticky(true);
	XSync(dd, False);

	// Set desired location and dimensions
	SetSize(m_X, m_Y, m_Width, m_Height);	
}