Jump to content

How to modify the UniDBNavigator hint content?


szlbz

Recommended Posts

  • 6 years later...

I need change the hint, too. 
Which is the resourcestring file for change the resourcestring value?

I take example from http://www.delphibasics.info/home/delphibasicssnippets/changeresourcestringsatruntime

And put that procedure HookResourceString(rs: PResStringRec; newStr: PChar); 

I was tested on ServerModuleCreate, MainModuleCreate and MainFormCreate and nothing ....

using Vcl.Consts,  Vcl.VDBConsts

procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);
begin
  HookResourceString(@SFirstRecord,          'Primer registro');
  HookResourceString(@SPriorRecord,          'Registro anterior');
  HookResourceString(@SNextRecord,           'Siguiente registro');
  HookResourceString(@SLastRecord,           'Último registro');
  HookResourceString(@SInsertRecord,         'Agregar');
  HookResourceString(@SDeleteRecord,         'Eliminar');
  HookResourceString(@SEditRecord,           'Editar');
  HookResourceString(@SPostEdit,             'Grabar');
  HookResourceString(@SCancelEdit,           'Cancelar edición');
  HookResourceString(@SConfirmCaption,       'Confirmar');
  HookResourceString(@SRefreshRecord,        'Refrescar');
  HookResourceString(@SDeleteRecordQuestion, 'Eliminar registro?');
end;

it still showing in English 

image.png.2c57b8659a5b9f5bf1af7af68c54424b.png

Edited by NizamUlMulk
More data
Link to comment
Share on other sites

14 hours ago, NizamUlMulk said:

I need change the hint, too. 

Hello,

Maybe you can try something like this...

//    'FIRST', 'PRIOR', 'NEXT',
//    'LAST', 'INSERT', 'DELETE', 'EDIT', 'POST', 'CANCEL', 'REFRESH', 'APPLYUPDATES', 'CANCELUPDATES'

procedure TMainForm.UniFormReady(Sender: TObject);
var
  btnName: string;
  btnHint: string;
begin

  btnName := 'FIRST'; //uni_dbn_xxx
  btnHint := 'First';
  UniSession.AddJS('Ext.ComponentQuery.query("[uname=uni_dbn_'+ btnName +']").forEach(function(el){el.setTooltip("'+ btnHint +'")});');

  btnName := 'PRIOR'; //uni_dbn_xxx
  btnHint := 'Prior';
  UniSession.AddJS('Ext.ComponentQuery.query("[uname=uni_dbn_'+ btnName +']").forEach(function(el){el.setTooltip("'+ btnHint +'")});');

  //...

end;

 

Link to comment
Share on other sites

  • 4 years later...
  • 1 month later...
  • 3 weeks later...
×
×
  • Create New...