rejetto forum

account hint

Mars · 11 · 2597

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2038
    • View Profile
Bug with mime type confirmed (post from @f2065)


******************************************************
Can you see the difference?

And nevertheless they are not the same groups.

The one is named:  can change password
 
Other one: can change password hello

The idea would be of to show the name in the HINT (event onmouseover)
« Last Edit: April 08, 2010, 02:22:45 PM by Mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
The idea would be of to show the name in the HINT (event onmouseover)

i tried, and had problems with it, because the main window is brought to front.
do you have an idea why?


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2038
    • View Profile
i tried, and had problems with it, because the main window is brought to front.
do you have an idea why?


Quote
optionsdlg.pas
.....
var
  optionsFrm: ToptionsFrm;
  pointedAccount: integer = -1;
implementation

{$R *.dfm}
.....
procedure ToptionsFrm.FormActivate(Sender: TObject);
begin
traymsgBoxChange(NIL);
application.MainForm.Hide;
end;

procedure ToptionsFrm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
application.MainForm.Show();
end;


procedure ToptionsFrm.accountsBoxMouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
with accountsbox do
  begin
  ShowHint:=True;
  pointedAccount:=ItematPos(point(x,y), FALSE);
  end;
end;

procedure ToptionsFrm.accountsPageEnter(Sender: TObject);
begin
accountsbox.setfocus;
end;


main.pas
......

procedure TmainFrm.appEventsShowHint(var HintStr: String;
...

  function connhint():string;
  var
    data: TconnData;
  begin
  result:=if_(HintsForNewcomersChk.checked,
    'This box shows info about current connections');
  data:=pointedConnection();
  if data = NIL then exit;
  result:='Start time: '+DateTimeToStr(data.time)
    +#13'Agent: '+first(data.agent,'<unknown>')
  end; // connhint

 function accountshint():string;
  begin
  result:=optionsfrm.accountsBox.items.Strings[optionsdlg.pointedAccount];
  end;


begin
//canShow:=mainFrm.Active;

if hintinfo.HintControl = optionsfrm.accountsBox then
  begin
  hintinfo.ReshowTimeout:=100;
  hintStr:=accountshint();
  end;


if hintinfo.HintControl = filesBox then
  begin
  hintinfo.ReshowTimeout:=800;
  hintStr:=filehint();
  end;

it's important to add application.MainForm.Hide and application.MainForm.show  to allow the use of hint in another form ;)

It is time to you to simplify the thing :D
« Last Edit: April 12, 2010, 07:26:55 PM by Mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
it's sad we must hide the main form, but thank you very much!


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
Warning rejetto, there remains a huge bug when applying the solution given by Mars.

Right click on a VFS resource > Properties ... > Permissions > Manage accounts > Apply, OK, or Cancel... .

The main form hide the properties form.

It still lacks a bit of code without doubt.

--------------------------------------------

I've succeeded with the beta in french language, with a part of code above... that works ok without bugs and without hiding the main form.

I tried to apply the same thing with official beta. I failed ... there is still a bug somewhere with the beta version in english language. I don't know what causes this bug.

« Last Edit: May 04, 2010, 06:41:50 AM by SilentPliz »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
Ok .. I completed the Mars's solution... everything seems OK. ;)

You just add this:

filepropDlg.pas:

Quote
procedure TfilepropFrm.goToAccountsBtnClick(Sender: TObject);
begin
filepropFrm.Hide;   // add by SP
showOptions(optionsFrm.accountsPage);
updateAccountsBox();
actionTabsChange(NIL);
filepropFrm.Show;   // add by SP
end;

Obsolete post

« Last Edit: May 05, 2010, 09:31:32 AM by SilentPliz »


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
Yeaaa! I found why it work on the French version.
No need to hide the main form now.  ;)
I put here all the necessary changes:

Edit: on the french version I putted an checkbox for activate/deactivate, because, in case of short names for all accounts, this option is useless.

Quote
Main.pas:

 end; // connhint

function accountshint():string;
  begin
  result:=optionsfrm.accountsBox.items.Strings[optionsdlg.pointedAccount];
  end;


begin
//canShow:=mainFrm.Active;

if hintinfo.HintControl = optionsfrm.accountsBox then
  begin
  hintinfo.ReshowTimeout:=100;
  hintStr:=accountshint();
  end;


if hintinfo.HintControl = filesBox then




optionsDlg.pas:

var
  optionsFrm: ToptionsFrm;
  pointedAccount: integer = -1;  
implementation

..........
..........


procedure ToptionsFrm.FormShow(Sender: TObject);
var
  i: integer;
  s: string;
begin
i:=round(mainfrm.images.Height*1.25);  
accountsBox.ItemHeight:= round(i*0.9);  
margin:=i div 10;                                                
// setwindowlong(handle, GWL_HWNDPARENT, 0); // get a taskbar button  Commented by SP
loadValues();
if pageCtrl.activePage <> a2nPage then exit;
s:=mainfrm.ipPointedInLog();
if s = '' then exit;
..........
..........


procedure ToptionsFrm.accountsBoxMouseMove(Sender: TObject; Shift: TShiftState;  
  X, Y: Integer);
begin
with accountsbox do
  begin
  ShowHint:=True;
  pointedAccount:=ItematPos(point(x,y), FALSE);
  end;
end;


« Last Edit: May 05, 2010, 04:02:08 PM by SilentPliz »


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2038
    • View Profile
The simplest of the solutions to avoid the change of focus on the windows which is engendered by hints

Finally, now it is not necessary any more to mask whatever it is, as I recommended it at the beginning of this topic
 ;)
Quote
procedure TmainFrm.appEventsShowHint(var HintStr: String;
.....

begin
//canShow:=mainFrm.Active;
if  mainfrm.Active and (hintinfo.HintControl = filesBox) then
  begin
  hintinfo.ReshowTimeout:=800;
  hintStr:=filehint();
  end;
if  mainfrm.Active and (hintinfo.HintControl = connBox) then
  begin
  hintinfo.ReshowTimeout:=800;
  hintStr:=connhint();
  end;
if not hintsForNewcomersChk.checked
and ((hintinfo.hintcontrol = modeBtn)
  or (hintinfo.hintcontrol = menuBtn)
  or (hintinfo.hintcontrol = graphBox))
then hintStr:='';
hintStr:=chop(#0, hintStr); // info past null char are used for extra data storing
canShow:=hintstr > '';
end;
« Last Edit: May 11, 2010, 09:06:41 PM by Mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
Yeaaa! I found why it work on the French version.
No need to hide the main form now.  ;)
I put here all the necessary changes:

thank you very much SP, that was it!