luca71
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by luca71
-
-
Hi,
I have a problem with the size of the UnimLabel.Please check the attached picture.
I have a UnimPanel, which I create at runtime, with 5 TUnimLabel inside it.
If I set the TUnimLabel.caption with a long text, the TUnimLabel is enlarged and is superimposed on the successive TUnimLabel.
I would like to understand if it is possible:
1) Set a maximum height to UnimLabel2 in such a way that it can not overlap with UnimLabel3 (and UnimLabel4, ...).
2) Without setting a maximum height to the UnimLabel2, after having set UnimLabel2.caption know what is its height in order to move down UnimLabel3, UnimLabel4, UnimLabel5 and increase the height of UnimPanel1
Thanks.
This is the code:
//******************************************************************************
{ MyPanel }
constructor MyPanel.Create( Aowner :TComponent ; CodiceProdotto: Integer; DescrizioneSinteticaProdotto, DescrizioneMarca: String;
Disponibilita, QtaPerConfezione: Integer );
begin
inherited Create ( Aowner ) ;
self.Color := clWhite ;
self.Height := 136 ;
// UnimLabel1
UnimLabel1 := TUnimLabel.Create ( self ) ;
UnimLabel1.Name := 'UnimLabel1_' + IntToStr ( CodiceProdotto ) ;
UnimLabel1.Caption := DescrizioneMarca ;
UnimLabel1.Top := 7 ;
UnimLabel1.Left := 139;
UnimLabel1.Height := 23 ;
UnimLabel1.ClientEvents.UniEvents.Add ( 'beforeInit=function beforeInit(sender, config)'#13#10'{'#13#10' config.style = "font-size:18px; font-weight:bold; color:red";'#13#10'}' ) ;
UnimLabel1.Parent := self;
// UnimLabel2
UnimLabel2 := TUnimLabel.Create ( self ) ;
UnimLabel2.Name := 'UnimLabel2_' + IntToStr ( CodiceProdotto ) ;
UnimLabel2.Caption := DescrizioneSinteticaProdotto ;
UnimLabel2.Top := 28 ;
UnimLabel2.Left := 139;
UnimLabel2.Height := 23 ;
UnimLabel2.AutoSize := false ;
UnimLabel2.ClientEvents.UniEvents.Add ( 'beforeInit=function beforeInit(sender, config)'#13#10'{'#13#10' config.style = "font-size:18px; font-weight:bold; color:green";'#13#10'}' ) ;
UnimLabel2.Parent := self;
// UnimLabel3
UnimLabel3 := TUnimLabel.Create ( self ) ;
UnimLabel3.Name := 'UnimLabel3_' + IntToStr ( CodiceProdotto ) ;
UnimLabel3.Caption := 'Codice prodotto: <b>' + IntToStr ( CodiceProdotto ) + '</b>' ;
UnimLabel3.Top := 70 ;
UnimLabel3.Left := 139;
UnimLabel3.Height := 14 ;
UnimLabel3.ClientEvents.UniEvents.Add ( 'beforeInit=function beforeInit(sender, config)'#13#10'{'#13#10' config.style = "font-size:12px; color:black";'#13#10'}' ) ;
UnimLabel3.Parent := self ;
// UnimLabel4
UnimLabel4 := TUnimLabel.Create ( self ) ;
UnimLabel4.Name := 'UnimLabel4_' + IntToStr ( CodiceProdotto ) ;
UnimLabel4.Caption := 'Disponibilità: <b>' + IntToStr ( Disponibilita ) + '</b>' ;
UnimLabel4.Top := 85 ;
UnimLabel4.Left := 139;
UnimLabel4.Height := 14 ;
UnimLabel4.ClientEvents.UniEvents.Add ( 'beforeInit=function beforeInit(sender, config)'#13#10'{'#13#10' config.style = "font-size:12px; color:black";'#13#10'}' ) ;
UnimLabel4.Parent := self ;
// UnimLabel5
UnimLabel5 := TUnimLabel.Create ( self ) ;
UnimLabel5.Name := 'UnimLabel5_' + IntToStr ( CodiceProdotto ) ;
UnimLabel5.Caption := 'Q.tà per confezione: <b>' + IntToStr ( QtaPerConfezione ) + '</b>' ;
UnimLabel5.Top := 100 ;
UnimLabel5.Left := 139;
UnimLabel5.Height := 14 ;
UnimLabel5.ClientEvents.UniEvents.Add ( 'beforeInit=function beforeInit(sender, config)'#13#10'{'#13#10' config.style = "font-size:12px; color:black";'#13#10'}' ) ;
UnimLabel5.Parent := self ;
end; -
Hi,
I'd like to call from a UniMobileApplication a UnimForm inserted in a DLL
but, when I call it, I receive this error message:"Form Owner must be UniApplication"
Someone can help me?
Thanks.
Example******************************************* MyMobileApplication.exe
*****************************************program ApplicationServer;uses
Forms,
ServerModule in 'ServerModule.pas' {UniServerModule: TUniGUIServerModule},
MainModule in 'MainModule.pas' {UniMainModule: TUniGUIMainModule},
Mainm in 'Mainm.pas' {MainmForm: TUnimForm},
{$R *.res}begin
ReportMemoryLeaksOnShutdown := True;
Application.Initialize;
TUniServerModule.Create(Application);
Application.Run;
end.unit Mainm;type
TMainmForm = class(TUnimForm)
UnimBitBtn1: TUnimBitBtn;
private
{ Private declarations }
public
{ Public declarations }
end;
function my_external_form ( UniApplication: TUniGUIApplication ): TUnimForm; StdCall ; external "c:\temp\my_dll.dll" ;
implementation..
..
..procedure TMainmForm.UnimBitBtn1Click(Sender: TObject);
beginresult := my_externat_form ( UniApplication ) ;end;*******************************
** c:\temp\my_dll.dll **
*******************************
library My_dll;uses
Mobile_form in 'Mobile_form.pas' {UnimForm1: TUnimForm};{$R *.res}exports
my_external_form ;beginend.
************************************
unit Mobile_form;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics,
uniGUIServer, uniGUIMainModule, uniGUIApplication, uIdCustomHTTPServer,
uniGUITypes,
Controls, uniGUIAbstractClasses,
uniGUIClasses, uniGUImClasses, uniGUIForm, uniGUImForm, uniGUImJSForm ;
type
TUnimForm1 = class(TUnimForm)
private
{ Private declarations }
public
{ Public declarations }
end;Var MyUniApplication :TUniGUIApplication ;function my_external_form ( UniApplication :TUniGUIApplication ) :TUnimForm ; stdCall ;
function UnimForm1: TUnimForm1;implementation{$R *.dfm}
function my_external_form( UniApplication :TUniGUIApplication ):TUnimForm ;
Begin
MyUniApplication := UniApplication ;
Result := UnimForm1 ;End;function UnimForm1: TUnimForm1;
beginResult := TUnimForm1 ( MyUniApplication.UniMainModule.GetFormInstance ( TUnimForm1 ) );end;
end.
UnimLabel Height
in uniGUI Mobile
Posted
Thanks for the reply.
About point 1)
I tried using this CSS
.ellipsisText {
white-space: normal;
text-overflow: ellipsis;
overflow: hidden;
}
and the result is quite good (the text does not exceed the spaces I have assigned to it, but unfortunately "text-overflow: ellipsis" does not work: it does not put "..." when cutting the text, but I think it's a Sencha problem)
About point 2)
Do you have any idea how I can do?
If I assign UnimLabel2.caption a long text, its size is enlarged and I would like the UnimLabel3 to move down.
I tried setting Align = alTop for both UnimLabel2 and UnimLabel3, but without result.
Thank you.