ide, CtrlLib: Vertical labels support in Laydes and .usc

This commit is contained in:
Mirek Fidler 2025-04-29 16:33:39 +02:00
parent 0ea89ac598
commit 609167ede2
8 changed files with 116 additions and 11 deletions

View file

@ -0,0 +1,16 @@
#ifndef _VerticalLabel_VerticalLabel_h
#define _VerticalLabel_VerticalLabel_h
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#define LAYOUTFILE <VerticalLabel/VerticalLabel.lay>
#include <CtrlCore/lay.h>
class VerticalLabel : public WithVerticalLabelLayout<TopWindow> {
public:
VerticalLabel();
};
#endif

View file

@ -0,0 +1,15 @@
LAYOUT(VerticalLabelLayout, 804, 248)
ITEM(Upp::Label, dv___0, SetLabel(t_("Label!")).SetOrientation(Upp::ORIENTATION_CLOCKWISE).LeftPosZ(8, 128).TopPosZ(8, 116))
ITEM(Upp::Label, dv___1, SetLabel(t_("Label!")).SetAlign(Upp::ALIGN_RIGHT).SetOrientation(Upp::ORIENTATION_CLOCKWISE).LeftPosZ(140, 128).TopPosZ(8, 116))
ITEM(Upp::Label, dv___2, SetLabel(t_("Label!")).SetAlign(Upp::ALIGN_CENTER).SetOrientation(Upp::ORIENTATION_CLOCKWISE).LeftPosZ(272, 128).TopPosZ(8, 116))
ITEM(Upp::Label, dv___3, SetLabel(t_("Label!")).SetOrientation(Upp::ORIENTATION_ANTICLOCKWISE).LeftPosZ(8, 128).TopPosZ(128, 116))
ITEM(Upp::Label, dv___4, SetLabel(t_("Label!")).SetAlign(Upp::ALIGN_RIGHT).SetOrientation(Upp::ORIENTATION_ANTICLOCKWISE).LeftPosZ(140, 128).TopPosZ(128, 116))
ITEM(Upp::Label, dv___5, SetLabel(t_("Label!")).SetAlign(Upp::ALIGN_CENTER).SetOrientation(Upp::ORIENTATION_ANTICLOCKWISE).LeftPosZ(272, 128).TopPosZ(128, 116))
ITEM(Upp::Label, dv___6, SetLabel(t_("Label!")).SetAlign(Upp::ALIGN_CENTER).SetVAlign(Upp::ALIGN_TOP).SetOrientation(Upp::ORIENTATION_CLOCKWISE).LeftPosZ(404, 128).TopPosZ(8, 116))
ITEM(Upp::Label, dv___7, SetLabel(t_("\001[/ Label!")).SetAlign(Upp::ALIGN_CENTER).SetVAlign(Upp::ALIGN_BOTTOM).SetOrientation(Upp::ORIENTATION_CLOCKWISE).LeftPosZ(536, 128).TopPosZ(8, 116))
ITEM(Upp::Label, dv___8, SetLabel(t_("\001[/ Label!")).SetAlign(Upp::ALIGN_CENTER).SetVAlign(Upp::ALIGN_TOP).SetOrientation(Upp::ORIENTATION_CLOCKWISE).LeftPosZ(668, 128).TopPosZ(8, 116))
ITEM(Upp::Label, dv___9, SetLabel(t_("Label!")).SetOrientation(Upp::ORIENTATION_ANTICLOCKWISE).LeftPosZ(404, 128).TopPosZ(128, 116))
ITEM(Upp::Label, dv___10, SetLabel(t_("\001[/ Label!")).SetAlign(Upp::ALIGN_CENTER).SetVAlign(Upp::ALIGN_TOP).SetOrientation(Upp::ORIENTATION_ANTICLOCKWISE).LeftPosZ(536, 128).TopPosZ(128, 116))
ITEM(Upp::Label, dv___11, SetLabel(t_("\001[/ Label!")).SetAlign(Upp::ALIGN_CENTER).SetVAlign(Upp::ALIGN_BOTTOM).SetOrientation(Upp::ORIENTATION_ANTICLOCKWISE).LeftPosZ(668, 128).TopPosZ(128, 116))
END_LAYOUT

View file

@ -2,7 +2,9 @@ uses
CtrlLib;
file
main.cpp;
VerticalLabel.h,
main.cpp,
VerticalLabel.lay;
mainconfig
"" = "GUI";

View file

@ -1,13 +1,11 @@
#include <CtrlLib/CtrlLib.h>
#include "VerticalLabel.h"
using namespace Upp;
VerticalLabel::VerticalLabel()
{
CtrlLayout(*this, "Window title");
}
GUI_APP_MAIN
{
TopWindow win;
Label l;
l = "This is a label";
win << l.SizePos();
l.SetOrientation(ORIENTATION_VERTICAL_LEFT);
win.Run();
VerticalLabel().Run();
}