Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Box text Position problem ... (Read 2121 times)
parkwonwoo
Junior Member
**
Offline


Open the Podbay Doors
HAL!

Posts: 61
Joined: Dec 8th, 2006
Box text Position problem ...
Jan 25th, 2007 at 4:13am
Print Post  
Hi, Long time No see ~

I show the Box's Tag using text prpperty.
The text is showed inside the box.
So, Resizing or SizeToText method is used.

But fitted Box and Text is not pretty.  --;
and the linked arrow's postion also changed --;
* and disturb the arrows attaching to the box.

is there any method of out-box display of text?
ex> upper left near of box.

Thanks in advance.
  

OS: WinXP sp2&&RAD: Borland Delphi7, C++Builder6, JBuilder9&&FrameWork: VCL+Win32 or J2SE&&FCX: FCX 4.1.x
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Box text Position problem ...
Reply #1 - Jan 25th, 2007 at 9:02am
Print Post  
Hi,

You could create a label box to contain the text and place it at the upper-left of the main box. Set the label's Transparent, Locked and IgnoreLayout properties to true, and attach it to the main box using

fc.CreateGroup(main).AttachToCorner(label, 0)

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
parkwonwoo
Junior Member
**
Offline


Open the Podbay Doors
HAL!

Posts: 61
Joined: Dec 8th, 2006
Re: Box text Position problem ...
Reply #2 - Jan 29th, 2007 at 5:19am
Print Post  
Thanks ~

Code
Select All
var
  Form1: TForm1;
  count: integer;
  aa, bb: iBoxItem;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  count:=0;
end;

procedure TForm1.FC1MouseDown(ASender: TObject; button: TOleEnum;
  keys: Smallint; docX, docY: Integer);
begin

end;

procedure TForm1.FC1BoxCreated(ASender: TObject; const box: IBoxItem);
begin
  box.UserData:=0; // Box 표시용.
  bb:=FC1.CreateBox(box.left, box.top, 60, 30);
  bb.Tag:=box.Tag;
  bb.UserData:=1; // 아이디 표시용.
  bb.Transparent:=true;
  bb.Locked:=true;
  bb.IgnoreLayout:=true;

  fc1.CreateGroup(box).AttachToCorner(bb, 0);
end;

procedure TForm1.FC1Clicked(ASender: TObject; button: TOleEnum; x,
  y: Integer);
begin
  aa:=FC1.CreateBox(X, Y, 10, 10);
  aa.Tag:=count;
  count:=count+1;

  FC1.OnBoxCreated(self, aa);
end;
// 감추기,
procedure TForm1.Button1Click(Sender: TObject);
var
  i: integer;
begin
  for i:=0 to FC1.boxes.count-1 do
  begin
    if FC1.boxes[i].UserData=1 then begin
	FC1.boxes[i].Text:='';

    end;
  end;

end;
// 보이기
procedure TForm1.Button2Click(Sender: TObject);
var  i: integer;
begin

  for i:=0 to FC1.boxes.count-1 do
  begin
    if FC1.boxes[i].UserData=1 then begin
	//bb:=FC1.boxes[i].ContainedItems.AttachedBoxes[0];
	FC1.boxes[i].Text:=IntToSTR(FC1.boxes[i].Tag);
    end;
  end;

end;
 

  

OS: WinXP sp2&&RAD: Borland Delphi7, C++Builder6, JBuilder9&&FrameWork: VCL+Win32 or J2SE&&FCX: FCX 4.1.x
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint