Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Is it possible to set the Font type for the arrayctrl?
Re: Is it possible to set the Font type for the arrayctrl? [message #3108 is a reply to message #3104] |
Sun, 07 May 2006 19:44   |
 |
forlano
Messages: 1213 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
forlano wrote on Sun, 07 May 2006 14:45 | This time the composite widget should not be a problem because I do not need to retrieve data. But I am afraid of the array cursor that could be not aware that I clicked on the label.
Ok, I'll do some experiment... but gime ve time and I'll post a test case.
Luigi
|
Well, I was too optimistic .
You can see how it looks the twolabel widget. It is very nice (I would add the national flag of the player one day), but the array cursor as usual is unsensitive to the click on the embedded ctrl. So when the array is covered by label I hope to move this damned cursor.
Moreover, and most important, I was not able to set these labels as I wanted! You can see the two edits that wait to be sent in the twolabel widget and then in the array but the callback is absent
I attach the code, maybe some volunter will retouch it. So we returned again on the set method of the previous thread. If I can see how work the "Set" maybe I'll catch the "Get" one.
Thank you
#include <CtrlLib/CtrlLib.h>
#define LAYOUTFILE <twolabelwidget/a.lay>
#include <CtrlCore/lay.h>
//--------------------- begin class -----------------
class TwoLabel : public WithTwoLabel<ParentCtrl> {
String str1;
String str2;
public:
typedef TwoLabel CLASSNAME;
void WriteLabel(String s1, String s2);
TwoLabel();
};
void TwoLabel::WriteLabel(String s1, String s2) //should be the Constructor?
{ str1 = s1;
str2 = s2;
}
TwoLabel::TwoLabel()
{ CtrlLayout(*this);
str1 = "left";
str2 = "right";
lbl1.SetLabel( str1 );
lbl2.SetLabel( str2 );
}
void Extra2(One<Ctrl>& ctrl)
{ ctrl.Create<TwoLabel>();
}
//--------------------- end class -------------------
//--------------------- begin class MyApp-----------------
class MyApp : public TopWindow {
TopWindow w;
ArrayCtrl arr;
Button btn;
EditString edit1, edit2;
public:
typedef MyApp CLASSNAME;
MyApp();
void SetIntoArray();
};
void MyApp::SetIntoArray()
{ TwoLabel twolbl;
String s1, s2;
s1 = ~edit1;
s2 = ~edit2;
arr.Add("aaa", Null/* ??? */);
}
MyApp::MyApp()
{ Add(arr);
arr.SizePos();
arr.AddColumn("col1",20);
arr.AddColumn("col2",20).Ctrls(Extra2);
arr.SetLineCy(20);
arr.Add("aaa");
arr.Add("bbb");
arr.Add("ccc");
arr.Inserting(true);
Add(edit1);
Add(edit2);
edit1.LeftPosZ(48, 76).TopPosZ(280, 19);
edit2.LeftPosZ(140, 76).TopPosZ(280, 19);
Add(btn);
btn.SetLabel("set into array").LeftPosZ(236, 88).TopPosZ(280, 20);
btn.WhenAction = THISBACK(SetIntoArray);
}
//--------------------- end MyApp -------------------
GUI_APP_MAIN
{ MyApp a;
a.Sizeable().Run();
}
/////////////////////////
layout file: a.lay
LAYOUT(TwoLabel, 188, 20)
ITEM(Label, lbl1, SetFont(StdFont(13).Bold()).SetInk(SLtBlue).LeftPosZ(4, 128).VCenterPosZ(17, 1))
ITEM(Label, lbl2, SetAlign(ALIGN_CENTER).SetFont(StdFont(13).Bold()).SetInk(SLtRed).LeftPosZ(132, 56).VCenterPosZ(17, 1))
END_LAYOUT
-
Attachment: swiss4.jpg
(Size: 11.88KB, Downloaded 1575 times)
|
|
|
 |
|
Is it possible to set the Font type for the arrayctrl?
By: forlano on Sat, 06 May 2006 14:56
|
 |
|
Re: Is it possible to set the Font type for the arrayctrl?
|
 |
|
Re: Is it possible to set the Font type for the arrayctrl?
|
 |
|
Re: Is it possible to set the Font type for the arrayctrl?
By: forlano on Sun, 07 May 2006 14:45
|
 |
|
Re: Is it possible to set the Font type for the arrayctrl?
By: forlano on Sun, 07 May 2006 19:44
|
 |
|
Re: Is it possible to set the Font type for the arrayctrl?
By: forlano on Wed, 28 June 2006 18:45
|
 |
|
Re: Is it possible to set the Font type for the arrayctrl?
By: mirek on Thu, 29 June 2006 20:16
|
 |
|
Re: Is it possible to set the Font type for the arrayctrl?
By: forlano on Sat, 01 July 2006 09:38
|
 |
|
Re: Is it possible to set the Font type for the arrayctrl?
By: mirek on Sun, 07 May 2006 19:53
|
 |
|
Re: Is it possible to set the Font type for the arrayctrl?
By: mirek on Sun, 09 July 2006 16:04
|
 |
|
Re: Is it possible to set the Font type for the arrayctrl?
By: forlano on Mon, 10 July 2006 15:46
|
 |
|
Re: Is it possible to set the Font type for the arrayctrl?
By: mirek on Mon, 10 July 2006 17:31
|
Goto Forum:
Current Time: Sun Aug 17 01:30:49 CEST 2025
Total time taken to generate the page: 0.04807 seconds
|