Autor Beitrag
HBriele
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80



BeitragVerfasst: So 17.04.05 14:04 
:?:
Hallo,
ich möchte mir eine Direkthilfe programmieren.
Mit dem Hilfe Tool ist mir das zu kompliziert.

Nun meine Frage:
wie platziert man z.B. ein Memofeld neben, unter dem Cursor?

Gruß
HB


Moderiert von user profile iconraziel: Topic aus Sonstiges verschoben am So 17.04.2005 um 19:44
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: So 17.04.05 14:08 
Soll die Anwendung den ganzen Bilschirm bedecken osder nur nen Teil?
Wenn Sie den gnzen Bildschirm bedeckt, hol dir einfach die CursorPOs auf dem Bildschirm, und setze Left, Top vom Memo auf diese Werte. Dann zeigen lassen Text laden und es müsste fuktionieren...
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: So 17.04.05 14:18 
und warum nutzt du keine Hints?

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
LH_Freak
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 385

Win XP
D7 PE, D2k5 Trial
BeitragVerfasst: So 17.04.05 14:20 
Form.MouseMove reinschreiben, dass Left und Top = X bzw. Y ist
HBriele Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80



BeitragVerfasst: So 17.04.05 14:41 
user profile iconLH_Freak hat folgendes geschrieben:
Form.MouseMove reinschreiben, dass Left und Top = X bzw. Y ist


Wie soll ich das verstehen?
Bitte etwas genauer.



Also

Hint wird zusätzlich als Kurzinformation benutzt,

Bei der Wahl der Direkt Hilfe erschein ein Curser mit Fragezeichen, und bei Auswahl auf dem Button soll sich ein Memo öffnen,
der cursor verschwinden und bei erneutem Mausklick soll das Fenster sich wieder schließen.

Mein zweites Problem besteht darin, wenn das memo geöffnet ist,
wie ich es wieder schließe und zwar mit Mausklick auf irgend einer Position der Form.
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: So 17.04.05 14:48 
du könntest das memo ausblenden sobald es den Fokus verliert (OnExit)

Zitat:
Bitte etwas genauer
einfach beim Klicken die Mausposition mit GetCursorPos abfragen und das Memo entsprechend platzieren.

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: So 17.04.05 15:17 
Er meint das:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls;

...


var
a: TPoint

GetCursorPos(a);
Memo1.Top := a.y;
Memo1.left := a.x;


Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
HBriele Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80



BeitragVerfasst: So 17.04.05 15:41 
Danke Euch,

alles bestens!!



Gruß

HB
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: So 17.04.05 16:20 
Vielleicht hilft dir auch das (2 Checkboxes in der Form, FormCreate und FormDestroy). Sofern du nicht mehrere Forms hast sollte das reichen.
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    procedure FormDestroy(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    HelpPos: TPoint;
    HelpStrings: TStringList;
    function MyHelp(Command: Word; Data: Longint; var CallHelp: Boolean) : Boolean;
    function ShowPopup(StrID: Integer; Position: TPoint): HWND;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

Const
 HH_DISPLAY_TEXT_POPUP = $000E;
 HH_CLOSE_ALL = $0012;
Type
 tagHH_POPUP = packed record
  cbStruct:      Integer;
  hinst:         HINST;
  idString:      Cardinal;
  pszText:       PChar;
  pt:            TPoint;
  clrForeground: TColorRef;
  clrBackground: TColorRef;
  rcMargins:     TRect;
  pszFont:       PChar;
 end;
 THHPopup = tagHH_POPUP;
function HtmlHelp(hwndCaller: HWND; pszFile: PChar; uCommand: UInt; dwData: DWord): HWND; stdcall; external 'hhctrl.ocx' name 'HtmlHelpA';

procedure TForm1.FormCreate(Sender: TObject);
begin
 Application.OnHelp := MyHelp;
 HelpStrings := TStringList.Create;
 HelpStrings.Add('');
 BorderIcons := BorderIcons+[biHelp]-[biMinimize,biMaximize];

 CheckBox1.HelpContext := HelpStrings.Add('Checkbox1 Hilfe');
 CheckBox2.HelpContext := HelpStrings.Add('Checkbox2 Hilfe');
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
 HtmlHelp(0, nil, HH_CLOSE_ALL, 0);
 HelpStrings.Free;
end;

function TForm1.ShowPopup(StrID: Integer; Position: TPoint): HWND;
var
 hhPopup: THHPopup;
begin
 Result := 0;
 if (StrID >= 1) and (StrID <= HelpStrings.Count-1) then
 begin
  with hhPopup do
  begin
   cbStruct := sizeof(hhpopup);
   hinst := 0;
   idString := 0;
   pszText := PChar(HelpStrings[StrID]);
   pszFont := 'Tahoma, 10, , ';
   pt := Position;
   clrForeground := TColorRef(-1);
   clrBackground := TColorRef(-1);
   rcMargins := Rect(-1,-1,-1,-1);
  end;
  Result := HtmlHelp(Handle, nil, HH_DISPLAY_TEXT_POPUP, DWord(@HHPopup));
 end;
end;

function TForm1.MyHelp(Command: Word; Data: Longint; var CallHelp: Boolean) : Boolean;
begin
 CallHelp := false;
 case Command of
  HELP_SETPOPUP_POS: HelpPos := SmallPointToPoint(TSmallPoint(Data));
  HELP_CONTEXTPOPUP: ShowPopup(Data, HelpPos);
  else
   CallHelp := true;
 end;
 Result := true;
end;

end.
HBriele Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80



BeitragVerfasst: Mo 18.04.05 09:22 
Zitat:
Vielleicht hilft dir auch das (2 Checkboxes in der Form, FormCreate und FormDestroy). Sofern du nicht mehrere Forms hast sollte das reichen.



Eine solche Funktion hatte ich bisher vergebens gesucht.

Sie funktioniert nur wenn BorderIcons := BorderIcons+[biHelp]-[biMinimize,biMaximize]
also [biMinimize,biMaximize false sind. Aus diesem Grund wollte ich das ganze selber programmieren.
Kennt jemand eine Möglichkeit die Funktion z.B. aus einem Menuitem auf zurufen ?

Außerdem währe dann noch schön, wenn es eine Möglichkeit gäbe, z.B. eine Zeile in
Fett darzustellen, geht das irgend wie mit HelpStrings.Add('abc’)?

Gruß

HB
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mo 18.04.05 12:40 
user profile iconHBriele hat folgendes geschrieben:
Sie funktioniert nur wenn BorderIcons := BorderIcons+[biHelp]-[biMinimize,biMaximize]
also [biMinimize,biMaximize false sind. Aus diesem Grund wollte ich das ganze selber programmieren.
Kennt jemand eine Möglichkeit die Funktion z.B. aus einem Menuitem auf zurufen ?
ausblenden Delphi-Quelltext
1:
 DefWindowProc(Handle, WM_SYSCOMMAND, SC_CONTEXTHELP, 0);					


user profile iconHBriele hat folgendes geschrieben:
Außerdem währe dann noch schön, wenn es eine Möglichkeit gäbe, z.B. eine Zeile in
Fett darzustellen, geht das irgend wie mit HelpStrings.Add('abc')?
So wie es oben implementiert ist, ist das nicht möglich. Auf Zeile 80 kannst du die Schriftart ändern, aber nur für das gesamte Fensterchen.

Hoffentlich findest du es trotzdem brauchbar.
Gruss
HBriele Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80



BeitragVerfasst: Mo 18.04.05 14:08 
ausblenden Delphi-Quelltext
1:
 DefWindowProc(Handle, WM_SYSCOMMAND, SC_CONTEXTHELP, 0);					


Danke,
der Aufruf funktioniert, jedoch kein popup!

Gruß
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mo 18.04.05 14:51 
Ich dachte, du wolltest statt des BorderIcons einen entsprechenden Eintrag als MenuItem. "Hilfe" oder sowas. Man muss dann natürlich noch auf das Control klicken, damit man die Hilfe zum entsprechenden Control erhält.

Wenn du einfach so ein Popup-Fensterchen willst, kannst du manuell ShowPopup aufrufen. Messagenummer+Position angeben. Du kannst die Funktion ShowPopup auch so umbauen, dass du statt Messagenummer die Message selbst als String übergibst. Sollte ja nicht allzu schwer sein.
HBriele Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80



BeitragVerfasst: Mo 18.04.05 15:09 
user profile icondelfiphan hat folgendes geschrieben:
Ich dachte, du wolltest statt des BorderIcons einen entsprechenden Eintrag als MenuItem. "Hilfe" oder sowas. Man muss dann natürlich noch auf das Control klicken, damit man die Hilfe zum entsprechenden Control erhält.



Ja genau das wollte ich!

Das Fragezeichen erscheint auch bei dem Aufruf !
Nur wenn ich mit dem Fragezeichen auf ein Control klicke passiert eben nichts.
Aktiviere ich jedoch BorderIcons := BorderIcons+[biHelp]-[biMinimize,biMaximize]
Dann geht’s.
Ich wollte lediglich einen Aufruf wie eventuell DefWindowProc(Handle, WM_SYSCOMMAND, SC_CONTEXTHELP, 0)
Jedoch für die gleiche Funktion und das Funktioniert nicht.

Gruß
HB
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mo 18.04.05 15:27 
Wenn du bei BorderIcons das biHelp dazu tust, funktioniert's; obwohl es nicht angezeigt wird.
HBriele Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80



BeitragVerfasst: Mo 18.04.05 15:51 
user profile icondelfiphan hat folgendes geschrieben:
Wenn du bei BorderIcons das biHelp dazu tust, funktioniert's; obwohl es nicht angezeigt wird.


Danke nochmals,
Funktioniert!!!

Gruß
HB
:D