Exemplo n.º 1
0
void
RowFormWidget::Show(const PixelRect &rc)
{
  PanelControl &panel = *(PanelControl *)GetWindow();
  panel.Move(rc);

  UpdateLayout();

  panel.Show();
}
Exemplo n.º 2
0
void
RowFormWidget::SetRowAvailable(unsigned i, bool available)
{
  Row &row = rows[i];
  if (available == row.available)
    return;

  row.available = available;
  UpdateLayout();
}
Exemplo n.º 3
0
void CMainFrame::OnViewToolBar(UINT uNotifyCode, int nID, CWindow wndCtl)
{
	static BOOL bVisible = TRUE;	// initially visible
	bVisible = !bVisible;
	CReBarCtrl rebar = m_hWndToolBar;
	int nBandIndex = rebar.IdToIndex(ATL_IDW_BAND_FIRST + 1);	// toolbar is 2nd added band
	rebar.ShowBand(nBandIndex, bVisible);
	UISetCheck(ID_VIEW_TOOLBAR, bVisible);
	UpdateLayout();
}
Exemplo n.º 4
0
VOID CDUITreeViewImpl::OnItemClick(const DUIEvent& info)
{
	HDUITREEITEM	hItem = (HDUITREEITEM)info.pSender;
	if ( hItem && hItem->HaveChild() )
	{
		hItem->SetExpand(!hItem->IsExpand());

		UpdateLayout(TRUE);
	}
}
Exemplo n.º 5
0
bool CHUDTimer::Init()
{
	UpdateLayout();

	Update();

	SetSourceString( LoadString("HUD_Timer_Chars"));

	return true;
}
Exemplo n.º 6
0
void
RowFormWidget::Show(const PixelRect &rc)
{
  Window &panel = GetWindow();
  panel.Move(rc);

  UpdateLayout();

  panel.Show();
}
Exemplo n.º 7
0
void
TrafficWidget::Show(const PixelRect &rc)
{
  // Update Radar and Selection for the first time
  Update();

  ContainerWidget::Show(rc);
  UpdateLayout();

  CommonInterface::GetLiveBlackboard().AddListener(*this);
}
Exemplo n.º 8
0
void
WndForm::OnCreate()
{
  ContainerWindow::OnCreate();

  UpdateLayout();

  WindowStyle client_style;
  client_style.ControlParent();
  client_area.Create(*this, client_rect, look.background_color, client_style);
}
Exemplo n.º 9
0
bool CHUDScoreDiff::Init()
{
	UpdateLayout();

	EnableFade(false);
	
	SetSourceString( LoadString("HUD_Score_Chars"));

	return true;

}
Exemplo n.º 10
0
void
WndForm::SetTitleFont(const Font &font)
{
  if (mhTitleFont != &font){
    // todo
    mhTitleFont = &font;

    invalidate();
    UpdateLayout();
  }
}
Exemplo n.º 11
0
LRESULT 
CHelperbarWindow::OnWindowPosChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	WINDOWPOS * lpwndpos = (WINDOWPOS *) lParam;
	if (!(lpwndpos->flags & SWP_NOSIZE))
	{
		UpdateLayout();
		bHandled = TRUE;
	}
	return 0;
}
Exemplo n.º 12
0
void nuiSlider::DoInvalidate(const nuiEvent& rEvent)
{
  //ValueChanged();
  InteractiveValueChanged();
  if (!mInteractiveValueChanged)
    ValueChanged();
  
  // mInteractiveValueChanged = true;
  
  UpdateLayout();
}
Exemplo n.º 13
0
LRESULT CMainFrame::OnViewToolBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	static BOOL bVisible = TRUE;	// initially visible
	bVisible = !bVisible;
	CReBarCtrl rebar = m_hWndToolBar;
	int nBandIndex = rebar.IdToIndex(ATL_IDW_BAND_FIRST + 1);	// toolbar is 2nd added band
	rebar.ShowBand(nBandIndex, bVisible);
	UISetCheck(ID_VIEW_TOOLBAR, bVisible);
	UpdateLayout();
	return 0;
}
Exemplo n.º 14
0
LTBOOL CHUDWpnChooser::Init()
{
    // get first and last weapon indices
    uint8 nFirstWeaponCommandId = g_pWeaponMgr->GetFirstWeaponCommandId();
    uint8 nLastWeaponCommandId = g_pWeaponMgr->GetLastWeaponCommandId();
    uint8 nWeaponCount[kMaxClasses];
    memset(nWeaponCount,0,sizeof(nWeaponCount));
    for (uint8 nWpnCommandId = nFirstWeaponCommandId; nWpnCommandId <= nLastWeaponCommandId; nWpnCommandId++)
    {
        uint8 nWpn = g_pWeaponMgr->GetWeaponId( nWpnCommandId );

        if (g_pWeaponMgr->IsPlayerWeapon(nWpn))
        {
            // get the weapon data struct
            uint8 nClass = g_pWeaponMgr->GetWeaponClass( nWpn ) - 1;
            if (nClass < kMaxClasses && nWeaponCount[nClass] < kMaxItemsPerClass)
            {
                m_nWeaponID[nClass][nWeaponCount[nClass]] = nWpn;
                nWeaponCount[nClass]++;
            }

        }
    }

    UpdateLayout();


    for( uint8 i = 0; i < kMaxClasses; ++i )
    {
        g_pDrawPrim->SetRGBA( &m_ClassPoly[i], argbWhite );

        for (uint8 n = nWeaponCount[i]; n < kMaxItemsPerClass; n++)
        {
            m_nWeaponID[i][n] = WMGR_INVALID_ID;
        }
    }
    for( i = 0; i < kMaxItemsPerClass; ++i )
    {
        g_pDrawPrim->SetRGBA( &m_ItemPoly[i], argbWhite );

        m_hItemIcon[i] = NULL;

    }

    uint8 nFont = g_pLayoutMgr->GetHUDFont();
    CUIFont* pFont = g_pInterfaceResMgr->GetFont(nFont);

    m_pStr = g_pFontManager->CreateFormattedPolyString(pFont,"",0.0f, 0.0f);
    m_pStr->SetColor(m_TextColor);



    return LTTRUE;
}
Exemplo n.º 15
0
void MCPrinter::DoLayout(MCCard *p_first_card, uint32_t p_number_of_cards, const MCRectangle& p_src_rect, bool p_marked)
{
    if (m_loop_nesting > 0 && m_loop_status == STATUS_READY)
    {
        MCStack *t_card_owner;
        t_card_owner = p_first_card -> getstack();

        // MW-2010-10-04: We should back up the *current* card of the stack, to restore after layout.
        MCCard *t_old_card;
        t_old_card = t_card_owner -> getcard(0);

        Boolean t_old_lock;
        t_old_lock = MClockmessages;

        // Lock messages, as we do not want any opencard messages etc. to be sent when cycling cards.
        MClockmessages = True;

        uint32_t t_number_cards_left;
        t_number_cards_left = p_number_of_cards;

        MCCard *t_current_card;
        t_current_card = p_first_card;

        while(t_number_cards_left > 0 && m_loop_status == STATUS_READY)
        {
            // Set the card of the stack.
            t_card_owner -> setcard(t_current_card, False, False);

            /// Calculate the layout for this card, and do a page break if required
            MCRectangle t_dst_rect;
            if (CalculateLayout(p_src_rect, t_dst_rect))
                DoPageBreak();

            // Print the card
            DoPrint(t_current_card, p_src_rect, t_dst_rect);

            UpdateLayout(t_dst_rect);

            // Advance card
            do
            {
                t_current_card = t_current_card -> next();
            }
            while(!t_current_card -> countme(0, p_marked)); // Skip marked cards if p_marked is true

            t_number_cards_left -= 1;
        }

        // Reset old state.
        t_card_owner -> setcard(t_old_card, False, False);
        MClockmessages = t_old_lock;
    }
}
Exemplo n.º 16
0
bool CHUDDebugInput::Init()
{

	UpdateLayout();
	ScaleChanged();

	wchar_t szTemp[64];
	LTSNPrintF(szTemp,LTARRAYSIZE(szTemp),L"%s: ",LoadString("IDS_DEBUGMSG"));
	m_Text.SetText(szTemp);

	return true;
}
Exemplo n.º 17
0
LRESULT RSSNewsFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
//	CreateSimpleStatusBar(ATL_IDS_IDLEMESSAGE, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP);  //[-] SCALOlaz
//	ctrlStatus.Attach(m_hWndStatusBar);

	ctrlList.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
	                WS_HSCROLL | WS_VSCROLL | LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_SINGLESEL, WS_EX_CLIENTEDGE, IDC_RSS);
	SET_EXTENDENT_LIST_VIEW_STYLE(ctrlList);
	
	ctrlList.SetImageList(g_fileImage.getIconList(), LVSIL_SMALL);
	SET_LIST_COLOR(ctrlList);
	
	// Create listview columns
	WinUtil::splitTokens(columnIndexes, SETTING(RSS_COLUMNS_ORDER), COLUMN_LAST);
	WinUtil::splitTokensWidth(columnSizes, SETTING(RSS_COLUMNS_WIDTHS), COLUMN_LAST);
	
	for (size_t j = 0; j < COLUMN_LAST; j++)
	{
		const int fmt = (j == COLUMN_DATE) ? LVCFMT_RIGHT : LVCFMT_LEFT;
		ctrlList.InsertColumn(j, TSTRING_I(rss_columnNames[j]), fmt, columnSizes[j], j);
	}
	
	ctrlList.setColumnOrderArray(COLUMN_LAST, columnIndexes);
	ctrlList.setVisible(SETTING(RSS_COLUMNS_VISIBLE));
	
	//  ctrlList.setSortColumn(COLUMN_DATE);
	//  ctrlList.setAscending(false);
	
	ctrlList.setSortColumn(SETTING(RSS_COLUMNS_SORT));
	ctrlList.setAscending(BOOLSETTING(RSS_COLUMNS_SORT_ASC));
	
	ctrlRemoveAll.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
	                     BS_PUSHBUTTON , 0, IDC_REMOVE_ALL);
	ctrlRemoveAll.SetWindowText(CTSTRING(CDM_CLEAR));
	ctrlRemoveAll.SetFont(Fonts::g_systemFont);
	
	copyMenu.CreatePopupMenu();
	copyMenu.AppendMenu(MF_STRING, IDC_COPY_URL, CTSTRING(RSS_URL));
	copyMenu.AppendMenu(MF_STRING, IDC_COPY_ACTUAL_LINE, (CTSTRING(RSS_TITLE) + Text::toT(" + ") + CTSTRING(RSS_URL)).c_str());
	
	UpdateLayout();
	
	SettingsManager::getInstance()->addListener(this);
	RSSManager::getInstance()->addListener(this);
	
	RSSManager::updateFeeds();
	
	updateList(RSSManager::lockNewsList());
	RSSManager::unlockNewsList();
	
	bHandled = FALSE;
	return TRUE;
}
Exemplo n.º 18
0
void
WndForm::SetCaption(const TCHAR *_caption)
{
  if (_caption == NULL)
    _caption = _T("");

  if (!caption.equals(_caption)) {
    caption = _caption;
    UpdateLayout();
    invalidate(title_rect);
  }
}
Exemplo n.º 19
0
void
WndForm::SetCaption(const TCHAR *Value)
{
  if (Value == NULL)
    Value = _T("");

  if (_tcscmp(mCaption, Value) != 0){
    _tcscpy(mCaption, Value);
    UpdateLayout();
    invalidate(mTitleRect);
  }
}
Exemplo n.º 20
0
	void Label::Init(const std::string &text, TextLayout::ColourMarkupMode colourMarkupMode)
	{
		m_needsUpdate = true;
		m_colourMarkupMode = colourMarkupMode;
		m_shadow = false;
		m_layout = 0;
		m_dlist = 0;
		m_font = Gui::Screen::GetFont();
		m_color = ::Color::WHITE;
		UpdateLayout();
		SetText(text);
	}
Exemplo n.º 21
0
bool CHUDArmor::Init()
{
	g_vtHUDArmorRender.Init( g_pLTClient, "HUDArmorRender", NULL, 1.0f );

	m_nFadeThreshold = 0;
	m_nLastValue = 0;
	UpdateLayout();
	ScaleChanged();
	SetSourceString( LoadString("HUD_Number_Chars"));

	return true;
}
Exemplo n.º 22
0
void
WndForm::SetCaption(const TCHAR *Value)
{
  if (Value == NULL)
    Value = _T("");

  if (!mCaption.equals(Value)){
    mCaption = Value;
    UpdateLayout();
    invalidate(mTitleRect);
  }
}
Exemplo n.º 23
0
void
WndProperty::SetDataField(DataField *Value)
{
  assert(mDataField == NULL || mDataField != Value);

  delete mDataField;
  mDataField = Value;

  UpdateLayout();

  RefreshDisplay();
}
Exemplo n.º 24
0
VOID CDUIProgressBarBase::SetPos(INT nPos)
{
	DUI_ASSERT(nPos >= m_nMin && nPos <= m_nMax);
	if(nPos < m_nMin) nPos = m_nMin;
	if(nPos > m_nMax) nPos = m_nMax;
	
	if(m_nPos != nPos)
	{
		m_nPos = nPos;
		SendNotify(WM_NOTIFY_PROGRESS_POS_CHANGED, nPos);
		UpdateLayout(FALSE);
	}
}
Exemplo n.º 25
0
void CHUDArmor::Update()
{
	for(int i = 0; i < 6; i++)
	{
		m_bHavePiece[i] = g_pSubroutineMgr->HaveArmorPiece(i);
	}

	if (m_fScale != g_pInterfaceResMgr->GetXRatio())
	{
		UpdateLayout();
		m_fScale = g_pInterfaceResMgr->GetXRatio();
	}
}
Exemplo n.º 26
0
void
WndForm::SetCaption(const TCHAR *_caption)
{
  if (_caption == nullptr)
    _caption = _T("");

  if (!caption.equals(_caption)) {
    caption = _caption;
    UpdateLayout();
    client_area.Move(client_rect);
    Invalidate(title_rect);
  }
}
Exemplo n.º 27
0
bool CHUDAmmo::Init()
{
	g_vtHUDAmmoRender.Init( g_pLTClient, "HUDAmmoRender", NULL, 1.0f );

	UpdateLayout();

	m_Text.SetDropShadow(2);

	ScaleChanged();

	SetSourceString(LoadString("HUD_Ammo_Chars"));

	return true;
}
Exemplo n.º 28
0
LTBOOL CHUDMessageQueue::Init()
{
	UpdateLayout();

	g_pLTClient->RegisterConsoleProgram("SimulateChat", SimulateChatFn);

	ASSERT(m_nMaxActiveMsgs);
	if (!m_nMaxActiveMsgs) return LTFALSE;

	m_ActiveMsgs.reserve(m_nMaxActiveMsgs);
	m_HistoryMsgs.reserve(m_nMaxHistoryMsgs);

	m_History.reserve(32);


	MsgCreate fmt = m_MsgFormat;
	fmt.sString = "";
	fmt.fDuration = 0.0f;

	for (int i = 0; i < m_nMaxActiveMsgs; i++)
	{
		CHUDMessage *pMsg = debug_new(CHUDMessage);
		if (pMsg->Create(fmt))
		{
			pMsg->Show(LTFALSE);
			m_ActiveMsgs.push_back(pMsg);
		}
		else
		{
			debug_delete(pMsg);
		}
	}

	for (i = 0; i < m_nMaxHistoryMsgs; i++)
	{
		CHUDMessage *pMsg = debug_new(CHUDMessage);
		if (pMsg->Create(fmt))
		{
			pMsg->Show(LTFALSE);
			m_HistoryMsgs.push_back(pMsg);
		}
		else
		{
			debug_delete(pMsg);
		}
	}

	return LTTRUE;

}
Exemplo n.º 29
0
// ----------------------------------------------------------------------- //
// initialize item
// ----------------------------------------------------------------------- //
bool CHUDWeapon::Init()
{
	g_vtHUDWeaponRender.Init( g_pLTClient, "HUDWeaponRender", NULL, 1.0f );

	UpdateLayout();

	SetSourceString( LoadString("HUD_Number_Chars"));

	m_bSelected = false;
	m_nCount = -1;
	EnableFade( true );

	return true;
}
Exemplo n.º 30
0
BOOL Cdlg_login::OnInitDialog() 
{
	ETSLayoutDialog::OnInitDialog();
	CreateRoot(VERTICAL)
		<< (pane(HORIZONTAL, ABSOLUTE_VERT)
			<< (pane(VERTICAL, GREEDY)
				<< item(IDC_GAME, GREEDY)
				<< item(IDC_USER, GREEDY)
				)
			<< (pane(VERTICAL, GREEDY)
				<< item(IDOK, NORESIZE)
				<< item(IDCANCEL, NORESIZE)
				)
			)
		<< item(IDC_EDIT, GREEDY)
		;
	UpdateLayout();
	xcc_dirs::load_from_registry();
	add_game("Software\\Westwood\\Emperor", game_ebfd, 0x1f);
	add_game("Software\\Westwood\\Nox", game_nox, 0x25);
	add_game("Software\\Westwood\\Tiberian Sun", game_ts, 0x12);
	add_game("Software\\Westwood\\Tiberian Sun", game_ts_fs, 0x1c);
	add_game("Software\\Westwood\\Red Alert 2", game_ra2, 0x21);
	add_game("Software\\Westwood\\Renegade", game_rg, 0xc);
	add_game("Software\\Westwood\\Yuri's Revenge", game_ra2_yr, 0x29);
	for (int i = 1; i < 26; i++)
	{
		t_nick e;
		Creg_key key;
		if (ERROR_SUCCESS == key.open(HKEY_CLASSES_ROOT, string("Wchat\\Nick" + n(i) + "\\Nick"), KEY_READ)
			&& ERROR_SUCCESS == key.query_value("", e.name)
			&& ERROR_SUCCESS == key.open(HKEY_CLASSES_ROOT, string("Wchat\\Nick" + n(i) + "\\Pass"), KEY_READ)
			&& ERROR_SUCCESS == key.query_value("", e.password)
			&& !e.name.empty() 
			&& e.password.length() == 8)
		{
			m_user.SetItemData(m_user.AddString(e.name.c_str()), m_nicks.size());
			m_nicks.push_back(e);
		}
	}
	if (m_nicks.empty())
	{
		m_user.SetItemData(m_user.AddString(""), m_nicks.size());
		m_nicks.push_back(t_nick());
	}
	m_game.SetCurSel(0);
	m_user.SetCurSel(0);	
	return true;
}