Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Adding Tab and Slaves to a TabCtrl
Re: Adding Tab and Slaves to a TabCtrl [message #48453 is a reply to message #48452] Tue, 04 July 2017 13:42 Go to previous messageGo to previous message
rafiwui is currently offline  rafiwui
Messages: 105
Registered: June 2017
Location: Stuttgart, Germany
Experienced Member
This is my current calling code:
SettingsWindow::SettingsWindow()
{
    m_language = GetCurrentLanguage();
    
    CtrlLayout(*this, t_("Settings"));
    InitTabs();
        
    b_ok <<= THISBACK(OnClickOK);
    b_cancel <<= THISBACK(OnClickCancel);
}

void SettingsWindow::InitTabs()
{
    ParentCtrl languageCtrl;
    /*languageCtrl.AddChild(&lng_language);
    languageCtrl.AddChild(&txt_lang_check);
    languageCtrl.AddChild(&b_preview);
    languageCtrl.AddChild(&txt_preview);
    /**/ // did not work as well
    languageCtrl
        << lng_language
        << txt_lang_check
        << b_preview
        << txt_preview;
    /**/
    tab_settings.Add(languageCtrl.SizePos(), t_("Language"));
    txt_preview.Show(false);
    b_preview <<= THISBACK(OnClickPreview);
    
    m_retriever // header -> CtrlRetriever m_retriever
        (lng_language, m_language) // header -> int m_language
    ;
}


And this is the .lay:
LAYOUT(SettingsLayout, 250, 300)
	ITEM(TabCtrl, tab_settings, LeftPosZ(0, 250).TopPosZ(0, 300))
	ITEM(Button, b_ok, SetLabel(t_("OK")).LeftPosZ(10, 100).BottomPosZ(10, 30))
	ITEM(Button, b_cancel, SetLabel(t_("Cancel")).RightPosZ(10, 100).BottomPosZ(10, 30))
	ITEM(LNGCtrl, lng_language, LeftPosZ(30, 190).TopPosZ(50, 30))
	ITEM(StaticText, txt_lang_check, SetText(t_("Press the preview button.")).SetFont(StdFontZ(11)).LeftPosZ(30, 190).TopPosZ(90, 30))
	ITEM(Button, b_preview, SetLabel(t_("Preview")).LeftPosZ(30, 50).TopPosZ(125, 20))
	ITEM(StaticText, txt_preview, SetText(t_("English text")).SetAlign(ALIGN_CENTER).SetFont(StdFontZ(16)).SetFrame(ThinInsetFrame()).LeftPosZ(30, 190).TopPosZ(150, 100))
END_LAYOUT


Thanks for your effort Thumbs Up


Greetings
Daniel
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Switching layout inside class
Next Topic: Example Serial pak
Goto Forum:
  


Current Time: Fri Mar 29 09:17:15 CET 2024

Total time taken to generate the page: 0.01056 seconds