Exemplo n.º 1
0
GUIButton::GUIButton()
{
	Init();
	SetCaption(NULL);
	SetCaptionFont(NULL);
	SetCaptionColor(DEFAULT_TEXT_COLOR);
}
Exemplo n.º 2
0
GUIButton::GUIButton(string name)
{
	Init();
	SetCaption(NULL);
	SetCaptionFont(NULL);
	SetCaptionColor(DEFAULT_TEXT_COLOR);
	SetName(name);
}
Exemplo n.º 3
0
GUITextBox::GUITextBox()
{
	Init();
	SetCaption(NULL);
	SetCaptionFont(NULL);
	SetCaptionColor(DEFAULT_TEXT_COLOR);
	SetText("");
	SetTextFont(NULL);
	SetTextColor(DEFAULT_TEXT_COLOR);
	SetTextCaretPos(0);
	SetShift(false);
	SetTextLength(0);
	SetMaxTextLength(DEFAULT_MAX_TEXT_LENGTH);
}
Exemplo n.º 4
0
GUIControl::GUIControl()
{
	prev_key_update = 0;
	SetPatternCount(0);
	SetCurrentPattern(0);
	SetFocus(true);
	SetEnabled(true);
	SetDead(false);
	SetLastCursorPos(0);
	SetLastPressState(0);
	SetLastSentMsg(0);
	SetLastPressedKey(0);
	SetCaption(NULL);
	SetCaptionFont(NULL);
	SetCaptionColor(DEFAULT_TEXT_COLOR);
	SetSelectedCaptionColor(DEFAULT_TEXT_COLOR);
	SetPressedCaptionColor(DEFAULT_TEXT_COLOR);
	SetCaptionX(0);
	SetCaptionY(0);
	sgns.resize(0);
	_draw_border = false;
}
Exemplo n.º 5
0
BOOL CBCGPMSMCaptionBar::CreateEx (CWnd* pParentWnd, UINT nID)
{
    ASSERT_VALID(pParentWnd);   // must have a parent

	DWORD dwStyle = WS_VISIBLE | WS_CHILD | CBRS_TOP;

	// save the style
	SetBarAlignment (dwStyle & CBRS_ALL);

	// create the HWND
	CRect rect(0, 0, 0, 0);

	LPCTSTR lpszClass = AfxRegisterWndClass(CS_DBLCLKS, ::LoadCursor(NULL, IDC_ARROW),
		(HBRUSH)(COLOR_BTNFACE+1), NULL);

	m_dwBCGStyle = 0; // can't float, resize, close, slide
/*
	if (pParentWnd->GetStyle() & WS_THICKFRAME)
	{
		dwStyle |= SBARS_SIZEGRIP;
	}	
*/

	BOOL bSystemSmall = (pParentWnd->GetExStyle() & WS_EX_TOOLWINDOW) != 0;

	if (!CWnd::Create(lpszClass, NULL, dwStyle | WS_CLIPSIBLINGS, rect, pParentWnd, nID))
	{
		return FALSE;
	}

	if (pParentWnd->IsKindOf (RUNTIME_CLASS (CBCGPFrameWnd)))
	{
		((CBCGPFrameWnd*) pParentWnd)->AddControlBar (this);
	}
	else
	{
		ASSERT (FALSE);
		return FALSE;
	}

	HINSTANCE hInstance = AfxFindResourceHandle (MAKEINTRESOURCE (nID), RT_GROUP_ICON);

	if (hInstance != NULL)
	{
		CSize szIcon (::GetSystemMetrics (SM_CXSMICON), ::GetSystemMetrics (SM_CYSMICON));

		HICON hIcon = (HICON)::LoadImage (hInstance, MAKEINTRESOURCE (nID), IMAGE_ICON, 
			szIcon.cx, szIcon.cy, LR_DEFAULTCOLOR);

		if (hIcon != NULL)
		{
			SetIcon (hIcon);
		}
	}

	CString strCaption;

	pParentWnd->GetWindowText (strCaption);

	if (strCaption.IsEmpty ())
	{
		strCaption.LoadString (nID);
	}

	if (!strCaption.IsEmpty ())
	{
		SetWindowText (strCaption);
	}

	NONCLIENTMETRICS ncm;
	ZeroMemory (&ncm, sizeof (NONCLIENTMETRICS));
	ncm.cbSize = sizeof (NONCLIENTMETRICS);

	globalData.GetNonClientMetrics (ncm);

	m_SystemHeight  = ::GetSystemMetrics (bSystemSmall ? SM_CYSMCAPTION : SM_CYCAPTION);
	m_CaptionHeight = m_SystemHeight;

	SetCaptionFont (bSystemSmall ? ncm.lfSmCaptionFont : ncm.lfCaptionFont);

	CRect rt (0, 0, bSystemSmall ? ncm.iSmCaptionWidth : ncm.iCaptionWidth, 
		            bSystemSmall ? ncm.iSmCaptionHeight : ncm.iCaptionHeight);


	CBCGPMSMVisualManager* pManager = DYNAMIC_DOWNCAST (CBCGPMSMVisualManager,
		CBCGPVisualManager::GetInstance ());

	if (pManager != NULL)
	{
		if (pManager->LoadBCGPMSMCaptionButtonsIcons (_T("IDB_BCGPMSM_CAPTION_BTNS")))
		{
			rt.right  = pManager->GetBCGPMSMCaptionButtonsSize ().cx;
			rt.bottom = pManager->GetBCGPMSMCaptionButtonsSize ().cx;
		};

		m_CaptionHeight = rt.bottom + 2;
	}


	m_BtnClose.Create (_T(""), BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 
		               rt, this, SC_CLOSE);
	m_BtnClose.SetTooltip (_T("Close"));

	m_BtnMaximize.Create (_T(""), BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 
		               rt, this, SC_MAXIMIZE);
	m_BtnMaximize.SetTooltip (_T("Maximize"));

	m_BtnMinimize.Create (_T(""), BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 
		               rt, this, SC_MINIMIZE);
	m_BtnMinimize.SetTooltip (_T("Minimize"));

	return TRUE;
}
Exemplo n.º 6
0
BOOL CTreePropertySheet::OnInitDialog() 
{
	CPropertySheet::OnInitDialog();
	
	if(m_bSpecialCaption) {
		CRect	rcWindow;

		ModifyStyle(WS_CAPTION,0,0);
		ModifyStyle(WS_SYSMENU,0,0);
		
		GetWindowRect(&rcWindow);
		rcWindow.bottom-=GetSystemMetrics(SM_CYCAPTION);
		MoveWindow(&rcWindow,FALSE);
	}

	if(m_bDisableStandardButtons)
		HidePpgButtons();

	HideTabControl();
	AddTreeView();
	AlignControls();

	int			nPage,nPages=m_acPropPages.GetSize();
	CArray<HTREEITEM,HTREEITEM>	stack;

	for(nPage=0;nPage<nPages;nPage++) {
		cPropPage&	page=m_acPropPages[nPage];
		HTREEITEM	parent=stack.GetSize()?stack[stack.GetSize()-1]:TVI_ROOT;
		HTREEITEM	cur=NULL;
		
		if(page.sCaption.GetLength()==0)
			GetPage(nPage)->GetWindowText(page.sCaption);

		cur			=m_cTreeCtrl.InsertItem(page.sCaption,parent);
		m_cTreeCtrl.SetItemData(cur,nPage);

		int			nType=page.nType&tps_item_type_mask;

		if(nType==tps_item_branch)
			stack.Add(cur);

		if(nType==tps_item_endbranch)
			stack.SetSize(stack.GetSize()-1);

		if(page.nType&tps_item_expanded)
			m_cTreeCtrl.SetItemState(cur,
									 TVIS_EXPANDED,
									 TVIS_EXPANDED);

    if (nPage == m_iWantedPage)
       m_cTreeCtrl.Select (cur, TVGN_CARET);

	}

	if(m_pCaptionFont==NULL)
		SetCaptionFont("MS Sans Serif",18,TRUE);
	if(m_pCaptionDescrFont==NULL)
		SetCaptionDescrFont("MS Sans Serif",18,TRUE);

  // remove apply button
  CWnd* pTemp;
  pTemp = GetDlgItem(ID_APPLY_NOW);
  if (pTemp)
      pTemp->ShowWindow (SW_HIDE);

	return TRUE;  // return TRUE unless you set the focus to a control
}