void
TBarView::HideDeskbar(bool hide)
{
	BRect screenFrame = (BScreen(Window())).Frame();

	if (hide) {
		Hide();
		PositionWindow(screenFrame);
		SizeWindow(screenFrame);
	} else {
		Show();
		SizeWindow(screenFrame);
		PositionWindow(screenFrame);
	}
}
Esempio n. 2
0
// Sets the content of the balloon (plain text only)
void CBalloonHelp::SetContent(const CString& strContent)
{
	m_strContent = strContent;
	// if already visible, resize & move
	if ( NULL != m_hWnd )
		PositionWindow();
}
Esempio n. 3
0
/** \brief
 *
 * Constructor. Sets up a modeless window and adds the HUD component to a
 * ScrolledWindow component.
 *
 */
HUDWindow::HUDWindow()
{
	set_type_hint(Gdk::WINDOW_TYPE_HINT_NORMAL);
	set_title(gettext("Player HUD Window"));
	set_resizable(true);
	set_decorated(true);
	set_position(Gtk::WIN_POS_CENTER);
	set_modal(false);
	set_icon( Gdk::Pixbuf::create_from_xpm_data( Helmet_xpm ) );

	PositionWindow();

    f_charView.AddHUDColumns();
    f_charView.set_border_width( 1 );
    //f_charView.update();
	//
    f_scrolledWindow.add( f_charView );
	f_scrolledWindow.set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC );
	f_scrolledWindow.set_shadow_type( Gtk::SHADOW_IN  );
	f_scrolledWindow.set_border_width( 1 );
	//
	f_mainBox.pack_start( f_scrolledWindow, Gtk::PACK_EXPAND_WIDGET );
	f_mainBox.pack_start( f_statusBox, Gtk::PACK_SHRINK );
	//
	add( f_mainBox );

	f_statusBox.Update();
	
	show_all_children();
}
Esempio n. 4
0
void OSD::LoadWindows(void)
{
    static const char* default_windows[7] = {
        "osd_message", "osd_input", "program_info", "browse_info", "osd_status",
        "osd_program_editor", "osd_debug"};

    for (int i = 0; i < 7; i++)
    {
        const char* window = default_windows[i];
        MythOSDWindow *win = new MythOSDWindow(NULL, window, true);

        win->SetPainter(m_CurrentPainter);
        if (win->Create())
        {
            PositionWindow(win);
            LOG(VB_PLAYBACK, LOG_INFO, LOC +
                QString("Loaded window %1").arg(window));
            m_Children.insert(window, win);
        }
        else
        {
            LOG(VB_GENERAL, LOG_ERR, LOC + QString("Failed to load window %1")
                .arg(window));
            delete win;
        }
    }
}
Esempio n. 5
0
void CHyperLink::PreSubclassWindow() 
{
	// We want to get mouse clicks via STN_CLICKED
	DWORD dwStyle = GetStyle();
	::SetWindowLong(m_hWnd, GWL_STYLE, dwStyle | SS_NOTIFY);
	
	// Set the URL as the window text
	if (m_strURL.IsEmpty())
		GetWindowText(m_strURL);

	// Check that the window text isn't empty. If it is, set it as the URL.
	CString strWndText;
	GetWindowText(strWndText);
	if (strWndText.IsEmpty()) {
		ASSERT(!m_strURL.IsEmpty());	// Window and URL both empty. DUH!
		SetWindowText(m_strURL);
	}

	// Adjust size of window to fit URL if necessary
	PositionWindow();		

	// Load up the (standard) hyperlink cursor
	m_hLinkCursor = AfxGetApp()->LoadStandardCursor(IDC_ARROW);

	// Create the tooltip
	CRect rect; 
	GetClientRect(rect);
	m_ToolTip.Create(this);
	m_ToolTip.AddTool(this, m_strURL, rect, TOOLTIP_ID);

	CStatic::PreSubclassWindow();
}
Esempio n. 6
0
File: OSD.cpp Progetto: tg44/3RVX
void OSD::InitMeterWnd(MeterWnd &mWnd) {
    mWnd.AlwaysOnTop(_settings->AlwaysOnTop());
    mWnd.HideAnimation(_settings->HideAnim(), _settings->HideSpeed());
    mWnd.VisibleDuration(_settings->HideDelay());

    std::vector<Monitor> monitors = ActiveMonitors();
    for (unsigned int i = 1; i < monitors.size(); ++i) {
        mWnd.Clone();
    }

    PositionWindow(monitors[0], mWnd);
    std::vector<LayeredWnd *> clones = mWnd.Clones();
    for (unsigned int i = 1; i < monitors.size(); ++i) {
        PositionWindow(monitors[i], *clones[i - 1]);
    }
}
Esempio n. 7
0
void CHyperLink::SetAutoSize(bool bAutoSize /* = true */)
{
    m_bAdjustToFit = bAutoSize;

    if (::IsWindow(GetSafeHwnd()))
        PositionWindow();
}
Esempio n. 8
0
HWND
CalendarCtrl::CreateGrid(HWND hwndparent, DataView *dv, wyBool isDate, wyBool isResult)
{
	m_hwndparent= hwndparent;
    wyChar* temp = dv->m_data->m_rowarray->GetRowExAt(CustomGrid_GetCurSelRow(dv->m_hwndgrid))->m_row[CustomGrid_GetCurSelCol(dv->m_hwndgrid)];
	if(temp)
		m_orgdata.SetAs(temp);
	else
		m_orgdata.SetAs(L"(NULL)");
	m_isDate = isDate;
	m_date.SetAs(m_orgdata);
	m_dv	= dv;
	m_isResult = isResult;

	m_hwnd = Create();
	
	if(isDate)
		ShowWindow(GetDlgItem(m_hwnd,IDC_DATETIMEPICKER1),SW_HIDE);

	CustomGrid_GetSubItemRect(m_hwndparent, m_row, m_col, &m_rectCell);
 
	PositionWindow(&m_rectCell);
	ShowWindow(m_hwnd,SW_SHOW);
	
	return m_hwnd;
}
Esempio n. 9
0
// Sets the title of the balloon
void CBalloonHelp::SetTitle(const CString& strTitle)
{
	SetWindowText(strTitle);
	// if already visible, resize & move
	if ( NULL != m_hWnd )
		PositionWindow();
}
Esempio n. 10
0
void CHyperLink::SetAutoSize(BOOL bAutoSize /* = TRUE */)
{
    m_bAdjustToFit = bAutoSize;

    if (::IsWindow(GetSafeHwnd()))
        PositionWindow();
}
Esempio n. 11
0
/*
	SetUrl()
*/
void CHyperLink::SetUrl(LPCSTR lpcszUrl)
{
	m_strUrl.Format("%s",lpcszUrl);

	if(m_bAdjustToFit)
		if(::IsWindow(GetSafeHwnd()))
			PositionWindow();
}
Esempio n. 12
0
void CHyperLink::SetURL(CString strURL)
{
    m_strURL = strURL;

    if (::IsWindow(GetSafeHwnd())) {
        PositionWindow();
        m_ToolTip.UpdateTipText(strURL, this, TOOLTIP_ID);
    }
}
Esempio n. 13
0
// Sets the font used for drawing the balloon content.  Deleted by balloon, do not use CFont* after passing to this function.
void CBalloonHelp::SetContentFont(CFont* pFont)
{
	if ( NULL != m_pContentFont )
		delete m_pContentFont;
	m_pContentFont = pFont;
	// if already visible, resize & move
	if ( NULL != m_hWnd )
		PositionWindow();
}
Esempio n. 14
0
/////////////////////////////////////////////////////////////////////////////
// CXHyperLink operations
void CXHyperLink::SetURL(CString strURL)
{
	m_strURL = strURL;

	if (::IsWindow(GetSafeHwnd())) 
	{
		PositionWindow();		
	}
}
///////////////////////////////////////////////////////////////////////////////
// SetWindowText
void CXHyperLink::SetWindowText(LPCTSTR lpszString)
{
	ASSERT(lpszString);
	if (!lpszString)
		return;
	CStatic::SetWindowText(_T(""));
	RedrawWindow();
	CStatic::SetWindowText(lpszString);
	PositionWindow();
}
Esempio n. 16
0
void ShowFrameRate(FrameRateWnd *w, int frameRate)
{
    if (w->frameRate == frameRate) {
        return;
    }
    w->frameRate = frameRate;
    SIZE s = GetIdealSize(w);
    PositionWindow(w, s);
    ScheduleRepaint(w->hwnd);
}
Esempio n. 17
0
void CStaticHyperLink::SetDisplayString(CString strDisplay)
{
	m_strDisplay = strDisplay;
	if (::IsWindow(GetSafeHwnd())) 
	{
		SetFont();
		SetWindowText(m_strDisplay);
		PositionWindow();
	}
}
Esempio n. 18
0
//设置超级连接
void CHyperLink::SetURL(CString strURL)
{
    m_strURL=strURL;
    if (::IsWindow(GetSafeHwnd())) 
	{
        PositionWindow();
		m_ToolTip.AddTool(this,m_strURL);
    }
	return;
}
Esempio n. 19
0
static LRESULT CALLBACK WndProcFrameRateAssociated(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
{
    if (WM_MOVING == msg ||
        WM_SIZING == msg ||
        WM_WINDOWPOSCHANGED  == msg ||
        WM_MOVE == msg) {
        FrameRateWnd *w = (FrameRateWnd*) dwRefData;
        PositionWindow(w, w->maxSizeSoFar);
    }
    return DefSubclassProc(hwnd, msg, wp, lp);
}
Esempio n. 20
0
/** \brief
 *
 * Called when the window is shown.
 *
 * \todo Add functionality as needed to handle CharacterListUI object showing.
 */
void HUDWindow::on_show()
{
	Gtk::Window::on_show();
	//
	PositionWindow();

	// Listen to this now
	//
	motk::ActionPtr changeHUDFont = motk::ActionPtr::cast_dynamic( GetActionsMgr().lock()->GetAction( "HUD::ChangeFont" ) );
	f_connectChangeFont = changeHUDFont->signal_activate().connect( sigc::mem_fun( *this, &HUDWindow::OnHUDChangeFont ) );
}
Esempio n. 21
0
// Window Return hook: used to implement window following
LRESULT CBalloonHelp::CallWndRetProc(int code, WPARAM wParam, LPARAM lParam)
{
	if (code>=0 && NULL != m_hWnd )
	{
		CWPRETSTRUCT* pcwpr = (CWPRETSTRUCT*)lParam;
		if ( WM_MOVE == pcwpr->message && pcwpr->hwnd == m_hwndAnchor )
			PositionWindow();
	}
	
	return ::CallNextHookEx(m_hCallWndRetHook, code, wParam, lParam);
}
Esempio n. 22
0
LRESULT CECardDialog::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
	// list box
	m_ECardList.SubclassWindow(GetDlgItem(IDC_ECARD_LIST));
	m_ECardList.ModifyStyle(NULL, LVS_REPORT | LVS_NOCOLUMNHEADER | LVS_SINGLESEL);
	m_ECardList.SetExtendedListViewStyle(m_ECardList.GetExtendedListViewStyle()| LVS_EX_TRACKSELECT | LVS_EX_ONECLICKACTIVATE);
	InitListBox();
	PositionWindow();
	ShowWindow(SW_SHOW);
    return TRUE;
}
Esempio n. 23
0
void cWindow::SetWindowSize(const int pMultiplier) {
	mWindow_Multiplier = pMultiplier;

	if (mWindow) {
		if (mWindowMode)
			SDL_SetWindowFullscreen(mWindow, 0);

		SDL_SetWindowSize(mWindow, GetWindowSize().mWidth, GetWindowSize().mHeight);

		PositionWindow();
	}
}
///////////////////////////////////////////////////////////////////////////////
// PreSubclassWindow
void CXHyperLink::PreSubclassWindow() 
{
	// We want to get mouse clicks via STN_CLICKED
	DWORD dwStyle = GetStyle();
	::SetWindowLong(GetSafeHwnd(), GWL_STYLE, dwStyle | SS_NOTIFY);
	
	// Set the URL as the window text
	if (m_strURL.IsEmpty())
		GetWindowText(m_strURL);

	// Check that the window text isn't empty. If it is, set it as the URL.
	CString strWndText;
	GetWindowText(strWndText);
	if (strWndText.IsEmpty()) 
	{
		ASSERT(!m_strURL.IsEmpty());	// Window and URL both NULL. DUH!
		SetWindowText(m_strURL);
	}

	CFont* pFont = GetFont();
	if (!pFont)
	{
		HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
		if (hFont == NULL)
			hFont = (HFONT) GetStockObject(ANSI_VAR_FONT);
		if (hFont)
			pFont = CFont::FromHandle(hFont);
	}
	ASSERT(pFont->GetSafeHandle());

	// Create the underline font
	LOGFONT lf;
	pFont->GetLogFont(&lf);
	m_StdFont.CreateFontIndirect(&lf);
	lf.lfUnderline = (BYTE) TRUE;
	m_UnderlineFont.CreateFontIndirect(&lf);

	PositionWindow();		// Adjust size of window to fit URL if necessary
	SetDefaultCursor();		// Try and load up a "hand" cursor
	SetUnderline();

	// Create the tooltip
	if (m_bToolTip)
	{
		CRect rect; 
		GetClientRect(rect);
		m_ToolTip.Create(this);
		m_ToolTip.AddTool(this, m_strURL, rect, TOOLTIP_ID);
	}

	CStatic::PreSubclassWindow();
}
Esempio n. 25
0
// Sets the icon displayed in the top left of the balloon (pass NULL to hide icon)
void CBalloonHelp::SetIcon(HICON hIcon)
{
	if ( NULL != m_ilIcon.m_hImageList )
		m_ilIcon.DeleteImageList();
	ICONINFO iconinfo;
	if ( NULL != hIcon && ::GetIconInfo(hIcon, &iconinfo) )
	{
		SetIcon(iconinfo.hbmColor, iconinfo.hbmMask);
		::DeleteObject(iconinfo.hbmColor);
		::DeleteObject(iconinfo.hbmMask);
	}
	// if already visible, resize & move (icon size may have changed)
	if ( NULL != m_hWnd )
		PositionWindow();
}
Esempio n. 26
0
// Set icon displayed in the top left of the balloon to image # nIconIndex from pImageList
void CBalloonHelp::SetIcon(CImageList* pImageList, int nIconIndex)
{
	// sanity checks
	ASSERT_VALID(pImageList);
	ASSERT(nIconIndex >= 0 && nIconIndex < pImageList->GetImageCount() );
	
	HICON hIcon = NULL;
	if ( NULL != pImageList && nIconIndex >= 0 && nIconIndex < pImageList->GetImageCount() )
		hIcon = pImageList->ExtractIcon(nIconIndex);
	SetIcon(hIcon);
	if ( NULL != hIcon )
		::DestroyIcon(hIcon);
	// if already visible, resize & move (icon size may have changed)
	if ( NULL != m_hWnd )
		PositionWindow();
}
Esempio n. 27
0
bool CECardDialog::Display(HWND hParent)
{
	if (!::IsWindow(m_hWnd))
	{
		HWND hWndParent = hParent;
		if (NULL == hWndParent)
			hWndParent= ::GetDesktopWindow();
		if (!Create(hWndParent))
			return false;
	}

	PositionWindow();
	ShowWindow(SW_SHOW);
	
	return true;
}
Esempio n. 28
0
// Sets the point to which the balloon is "anchored"
void CBalloonHelp::SetAnchorPoint(CPoint ptAnchor, CWnd* pWndAnchor /*= NULL*/)
{
	m_ptAnchor = ptAnchor;
	m_hwndAnchor = pWndAnchor->GetSafeHwnd();
	
	// if we're anchored to a window, set hook
	if ( NULL != m_hwndAnchor )
		SetCallWndRetHook();
	else
		RemoveCallWndRetHook();
	
	// if already visible, move
	if ( NULL != m_hWnd )
	{
		// reposition
		PositionWindow();
	}
}
Esempio n. 29
0
// Sets the icon displayed in the top left of the balloon
void CBalloonHelp::SetIcon(HBITMAP hBitmap, HBITMAP hMask)
{
	if ( NULL != m_ilIcon.m_hImageList )
		m_ilIcon.DeleteImageList();
	
	ASSERT(NULL != hBitmap);
	ASSERT(NULL != hMask);
	
	BITMAP bm;
	if (::GetObject(hBitmap, sizeof(bm),(LPVOID)&bm))
	{
		m_ilIcon.Create(bm.bmWidth, bm.bmHeight, ILC_COLOR24|ILC_MASK,1,0);
		m_ilIcon.Add(CBitmap::FromHandle(hBitmap), CBitmap::FromHandle(hMask));
	}
	// if already visible, resize & move (icon size may have changed)
	if ( NULL != m_hWnd )
		PositionWindow();
}
Esempio n. 30
0
//Sets the parameters of the control in Formview
HWND
CalendarCtrl::CreateForm(htmlayout::dom::element hwndedit, FormView *pfv, wyBool isDate)
{
	m_edit = hwndedit;
	m_hwndparent = m_edit.get_element_hwnd(true);
	m_button = m_edit.next_sibling();
	
	m_pfv = pfv;
	
	if(pfv->m_pdv)
	{
		m_dv = pfv->m_pdv;
	}
	
	m_isDate = isDate;
	m_orgdata.SetAs(m_edit.text());
	m_isForm = wyTrue;
	m_rectCell = m_button.get_location();
	
	while(m_edit.get_ctl_type() != CTL_EDIT)
	{
		m_edit = m_edit.prev_sibling();
	}
	
	m_hwnd = Create();
	
	if(isDate)
	{
		ShowWindow(GetDlgItem(m_hwnd,IDC_DATETIMEPICKER1),SW_HIDE);
	}
	
	PositionWindow(&m_rectCell);
	ShowWindow(m_hwnd,SW_SHOW);
    m_dv->m_hwndcal = m_hwnd;
    //m_dvb->m_hwndcal = m_hwnd;
	
	//set focus to the edit box
	m_edit.set_state(STATE_FOCUS);
	
	return m_hwnd;
}