Jump to content

UniRadiogroup multi column


uniguibbs

Recommended Posts

Hi, 

 

For version 0.94 is quite simple.
Use ClientEvents.ExtEvents uses.
 
see image attachments.
 
post-1298-0-71676500-1386851814_thumb.pngpost-1298-0-43415200-1386851839_thumb.pngpost-1298-0-13759800-1386851859_thumb.pngpost-1298-0-01750100-1386851882_thumb.png
 
 
 
 
 
For version 0.93 is a little bit complicated, let me know if you are interested in the solution for version 0.93
 
 
Regards
 
Salvatore Marullo
 

 

  • Upvote 5
Link to comment
Share on other sites

 
Hi Semper, 
 
Solution for Version 0.93
 
........
........
 
 
type
  TxRadio    = class(TUniRadioGroup);       <<<<<=============================  add 
  
  TMainForm = class(TUniForm)
     
    UniRadioGroup1: TUniRadioGroup;
    .................................
    .................................
    .................................    
  procedure UniFormCreate(Sender: TObject);
    
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
 
//  change the name of the form if uniradiogroup1 is defined in a other Form
 
 
procedure TMainForm.UniFormCreate(Sender: TObject);
 
Var      jsnameRadio : string ;
begin
  
 if  txradio(uniradiogroup1).GetTabControlCount  = 1 then begin     //  I believe it's always 1
 
     jsnameradio :=  txradio(uniradiogroup1).GetFormControlExtName(1) ;
     
       // set Columns of uniradioGroup1 to 4    
     
     unisession.AddJS(
     jsnameRadio +'.nm=' + '"' + jsnameRadio+ '";_cdo_("' +jsnameRadio+ '",' + jsnameRadio+ ',null,MainForm);' +
                        '_coe_(MainForm,"' + jsnameRadio+ '",null,"beforerender",function(sender) {sender.columns = 4  ;' +
 
      '});'  ) ; 
 
 end; 
 
 
 
end;
 
 
I hope can help  You

 

 

Reagrds ,

 

Salvatore Marullo 

 

 

  • Upvote 1
Link to comment
Share on other sites

hi , rullomare.

 

 unigui 0.94  

 delphi xe2

 

Dynamic create TUniRadioGroup.

following code,  the columns doesn't divide to 6. 

what's wrong?

 

  RemoveControl(rgEmp2);  
  rgEmp2 := TUniRadioGroup(InsertControl(TUniRadioGroup.Create(Self)));
  rgEmp2.ClientEvents.ExtEvents.Add(
    'radioGroup.beforerender=function radioGroup.beforerender(sender, eOpts)'
    + #13#10
    + '{'
    + #13#10
    + 'sender.columns = 6'
    + #13#10
    + '}'
  ); 
  rgEmp2.ClientEvents.Enabled := True;
 
  if not cdsDepMan.IsEmpty then
  begin
    cdsDepMan.First;
    while not cdsDepMan.Eof do
    begin
      ListLeader.Add(Format('%S=%S', [cdsDepManempid.AsString, cdsDepManempname.AsString]));
      rgEmp2.Items.Add(cdsDepManempname.AsString);
      cdsDepMan.Next;
    end;
  end;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...