Board index » kylix » Using biHelp from BorderIcons and QWhatsThis_xxx

Using biHelp from BorderIcons and QWhatsThis_xxx


2005-10-31 10:22:22 AM
kylix0
Hi
(Kylix 3 + KDE 3.3)
I would like to drag de [?] button from the window (bsDialog type) title
bar to some visible components and activate a small window with short
help information about it.
I searched my 6 Kylix books and "googled" about borderIcons+biHelp and
was unsuccessfull to find a little sample online.
I found in Qt.pas a declaration "procedure QWhatsThis_add(p1: QWidgetH;
p2: PWideString); cdecl;" to add a small text to a Widget, however don't
know how to connect this action with dragin the [?] button from the
title bar.
I need some direction or a small sample
Thanks in advance
Arnaldo Braun
 
 

Re:Using biHelp from BorderIcons and QWhatsThis_xxx

Quote

I found in Qt.pas a declaration "procedure QWhatsThis_add(p1: QWidgetH;
p2: PWideString); cdecl;" to add a small text to a Widget, however don't
know how to connect this action with dragin the [?] button from the
title bar.

This works for me (a TPanel on a Form):
procedure TForm1.FormCreate(Sender: TObject);
begin
PanelWhat:='Panel Whatsthis';
Qt.QWhatsThis_add(Panel1.Handle, @PanelWhat);
FormWhat:='Form Whatsthis';
Qt.QWhatsThis_add(Self.Handle, @FormWhat);
end;
 

Re:Using biHelp from BorderIcons and QWhatsThis_xxx

theo wrote:
Quote
>
>I found in Qt.pas a declaration "procedure QWhatsThis_add(p1:
>QWidgetH; p2: PWideString); cdecl;" to add a small text to a Widget,
>however don't know how to connect this action with dragin the [?]
>button from the title bar.
>

This works for me (a TPanel on a Form):

procedure TForm1.FormCreate(Sender: TObject);
begin
PanelWhat:='Panel Whatsthis';
Qt.QWhatsThis_add(Panel1.Handle, @PanelWhat);
FormWhat:='Form Whatsthis';
Qt.QWhatsThis_add(Self.Handle, @FormWhat);
end;
Its working after I declared PanelWhat and FormWhat as WideString type.
Thanks a lot!!!
 

{smallsort}

Re:Using biHelp from BorderIcons and QWhatsThis_xxx

Quote

Its working after I declared PanelWhat and FormWhat as WideString type.

Yes, that's what the Parameterlist says :-)
Maybe making it a procedure is even more convenient:
procedure AddWhatsThis(Contrl:TWidgetControl; Text:WideString);
begin
QWhatsThis_add(Contrl.Handle, @Text);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
AddWhatsThis(self, 'Main Form');
AddWhatsThis(Panel1, 'A Panel');
end;