Jump to content

small tips : change tunidbnavigator icon, Border at runtime.


rullomare

Recommended Posts

 small tips :   change tunidbnavigator icon, Border  at runtime. 
 
 
1) add 
 
Type
 
  txnav = class(TUniDBNavigator);                      <<<<<=============================
  
  TFUnitName = class(TUniForm)
    UniLabel1: TUniLabel;
    ...
    ... 
    navdbgrid: TUniDBNavigator;
    .....
    ......
 
  end;
 
 
2) add in  uses clause
   
        vcl.dbctrls;                                   <<<<<============================    
 
 
3) add  UniformCreate 
 
 
 
..........
 
 
procedure TFUnitName.UniFormCreate(Sender: TObject); 
 
var 
 
 jsnameButton : String 
 
Begin 
 
   // Js Solution With Border and Style   
  
  
  jsnamebutton :=  txnav(navadbgrid).Buttons[nbrefresh].jsname;
  unisession.AddJS(jsnamebutton+'.nm=' + '"' + jsnamebutton + '";_cdo_("' +jsnamebutton + '",' + jsnamebutton + ',null,FunitName);' +
                                 '_coe_(FunitName,"' + jsnamebutton + '",null,"beforerender",function(sender,eOpts) {sender.border = 1  ;' +
                                 ' sender.style = { borderColor: ''blue'', borderStyle: ''solid''}  ;' +
                                 ' sender.icon = "' + servermodule.UniServerModule.FilesFolderURL + 'nbrefreshbutton.png' +
                                  '"; });'  ) ; 
 
    
 
   jsnamebutton :=  txnav(navdbgrid).Buttons[nbcancel].jsname;
   unisession.AddJS(jsnamebutton+'.nm=' + '"' + jsnamebutton + '";_cdo_("' +jsnamebutton + '",' + jsnamebutton + ',null,FunitName);' +
                                 '_coe_(FunitName,"' + jsnamebutton + '",null,"beforerender",function(sender,eOpts) {sender.border = 1  ;' +
                                 ' sender.style = { borderColor: ''blue'', borderStyle: ''solid''}  ;' +
                                 ' sender.icon = "' + servermodule.UniServerModule.FilesFolderURL + 'nbcancelbutton.png' +
                                  '"; });'  ) ; 
 
 
   .................
   .................
   .................
   .................
 
 
   // Delphi Solution Without Border and Style 
 
 
 (*
   
  txnav(navdbgrid).Buttons[nbrefresh].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderpath+'nbrefreshbutton.png') ;
  txnav(navdbgrid).Buttons[nbcancel].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderpath+'nbcancelbutton.png') ;
  txnav(navdbgrid).Buttons[nbedit].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nbeditbutton.png') ;
  txnav(navdbgrid).Buttons[nbinsert].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderURL+'nbinsertbutton.png') ;
  txnav(navdbgrid).Buttons[nblast].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nblastbutton.png') ;
  txnav(navdbgrid).Buttons[nbnext].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nbnextbutton.png') ;
  txnav(navdbgrid).Buttons[nbprior].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nbpriorbutton.png') ;
  txnav(navdbgrid).Buttons[nbfirst].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nbfirstbutton.png') ;
  txnav(navdbgrid).Buttons[nbdelete].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nbdeletebutton.png') ;
  txnav(navdbgrid).Buttons[nbpost].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nbpostbutton.png') ;
 *)
 
 
end;
 
 
 
 
P.s. 
 
 have not been able to monitor if there are any performance issues on the Internet. 
 
 
Regards 
 
Salvatore Marullo
 
 
 
 
 

post-1298-0-31504700-1386589430_thumb.png

  • Upvote 1
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...