mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
.reference
git-svn-id: svn://ultimatepp.org/upp/trunk@11863 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d4a71a9568
commit
c702b39d03
4 changed files with 44 additions and 0 deletions
12
reference/FileSelFileCtrl/FileSelFileCtrl.upp
Normal file
12
reference/FileSelFileCtrl/FileSelFileCtrl.upp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
description "Uses FileSel::FileCtrl to add widgets to FileSel\377";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
format.lay,
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
5
reference/FileSelFileCtrl/format.lay
Normal file
5
reference/FileSelFileCtrl/format.lay
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
LAYOUT(FormatCtrlLayout, 164, 16)
|
||||
ITEM(Label, dv___0, SetLabel(t_("Encoding")).LeftPosZ(0, 52).TopPosZ(0, 19))
|
||||
ITEM(DropList, list, LeftPosZ(52, 112).TopPosZ(0, 19))
|
||||
END_LAYOUT
|
||||
|
||||
25
reference/FileSelFileCtrl/main.cpp
Normal file
25
reference/FileSelFileCtrl/main.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#define LAYOUTFILE <FileSelFileCtrl/format.lay>
|
||||
#include <CtrlCore/lay.h>
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
FileSel sel;
|
||||
|
||||
sel.Types("Example\t*.ext");
|
||||
|
||||
WithFormatCtrlLayout<ParentCtrl> format;
|
||||
CtrlLayout(format);
|
||||
format.list.Add("First");
|
||||
format.list.Add("Second");
|
||||
format.list.GoBegin();
|
||||
|
||||
sel.FileCtrl(format);
|
||||
|
||||
if(sel.ExecuteSaveAs())
|
||||
PromptOK(String() << "Path: [* \1" << ~sel << "\1]&"
|
||||
<< "Format: [* \1" << ~format.list);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue