Autor Beitrag
Stefan-W
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Mo 28.02.05 18:25 
Hi

Ich hab ein Problem mit meiner PopupMenu-Komponente.
Ich hab bei einer Reihe von Imagen und einem Panel ein PopupMenü eingestellt. (direckt unter "PopupMenu" im Objektinspecktor) Jedoch wenn ich dann bei meinem Programm auf die gewünschten Komponenten rechtsklicke erscheint das PopupMenü nur kurz und verschwindet anschliessend wieder. Woran kann das liegen und wie kann ich den Fehler beheben?
Vielen dank schon mal für eure Mühen.

Tschau
Chilla111
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Mo 28.02.05 20:21 
poste doch mal deinen quelltext thx

dann können dir ich udn die ganzen anderen heir bestimtm weiter helfen
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Mo 28.02.05 21:19 
Was willstn da haben?
das sind ca 610 Zeilen Code
und eigendlich ist das ja alles mit dem Objektinspecktor eingestellt...

Ich hab das PopupMenü schon mal neu erstellt und der Fehler ist immer noch KA worans liegt

Hier mal ein Ausschnitt ausm Code
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:
Unit MouseMain;

Interface

Uses
    Windows,
    Messages,
    SysUtils,
    Variants,
    Classes,
    Graphics,
    Controls,
    Forms,
    Dialogs,
    ExtCtrls,
    ExePfad,
    ShellAPI,
    StdCtrls,
    IniFiles,
    Menus,
    OneInstance;

Type
    TF_Main = Class(TForm)
        ExePfad: TExePfad;
        P_Main: TPanel;
        I_IconCach: TImage;
        I_Button_1: TImage;
        I_Button_2: TImage;
        I_Button_3: TImage;
        I_Button_4: TImage;
        I_Button_5: TImage;
        I_Button_6: TImage;
        I_Button_7: TImage;
        I_Button_8: TImage;
        I_Button_9: TImage;
        I_Button_10: TImage;
        I_Button_11: TImage;
        I_Button_12: TImage;
        I_Button_13: TImage;
        I_Button_14: TImage;
        I_Button_15: TImage;
        I_Button_16: TImage;
        I_Button_17: TImage;
        I_Button_18: TImage;
        I_Button_19: TImage;
        I_Button_20: TImage;
        I_Button_21: TImage;
        I_Button_22: TImage;
        I_Button_23: TImage;
        I_Button_24: TImage;
        I_Button_25: TImage;
        I_Button_26: TImage;
        I_Button_27: TImage;
        I_Button_28: TImage;
        I_Button_29: TImage;
        I_Button_30: TImage;
        P_Titel: TPanel;
        OneInstance: TOneInstance;
        T_ShowApp: TTimer;
        PM_Option: TPopupMenu;
        EinstellungenAendern: TMenuItem;
        Procedure ShowApplication(Sender: TObject);
        Procedure Starten(Sender: TObject);
        Procedure Beenden(Sender: TObject);
        Procedure ProgrammLaden(Sender: TObject);
        Procedure RegDatLoadAndStart(Position: Integer);
        Procedure FormKeyDown(Sender: TObject; Var Key: Word; Shift: TShiftState);
        Procedure CursorPosSet;
        Procedure Schatten(Sender: TObject);
        Procedure EinstellungenAendernClick(Sender: TObject);
        Procedure T_ShowAppTimer(Sender: TObject);
    Private
        { Private-Deklarationen }
    Public
        { Public-Deklarationen }
    End;

Var
    F_Main: TF_Main;
    Menue: String;
    CursorPosition, HintergrundFarbe, ZeilenAnzahl: Integer;

Implementation

{$R *.dfm}
{$R Icon_Res.res}

{...}

Procedure TF_Main.EinstellungenAendernClick(Sender: TObject);                   // Optionsmenü aufrufen
Begin
    ShellExecute(Application.Handle, 'open', PChar(ExePfad.Arbeitsverzeichnis + 'Optionen.exe'), PChar(Menue), Nil, SW_SHOW);
    Close;
End;

{...}

End.

mehr ist nicht drin was damit zu tun hat der Rest ist im Objektinspecktor eingestellt.

Und zwar bei P_Main, I_IconCach, I_Button_** ist bei PopupMenu das PM_Option eingestellt.
mehr ist doch da eigendlich nicht...

Tschau

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Chilla111
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Mo 28.02.05 21:31 
ja sorry hast du beim button bei onclick popupmenu einegstllt oder wie wolltest du es machen???

wann soll den das menu erscheinen
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Mo 28.02.05 21:37 
ich hab es meines Wissens so eingestellt, dass es erscheind wenn man auf eine oben genannten Komponenten (dem P_Main und alle darinn enthaltenen) rechtsklickt, was auch geht nur leider verschwindet das PopupMenü kurz nach erscheinen wieder...
Chilla111
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Mo 28.02.05 21:48 
bleibt es wenn du es gedrückt hälst?
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Mo 28.02.05 21:51 
erscheint erst beim loslassen
Chilla111
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Mo 28.02.05 21:54 
also du hast in der main form unter events > dann unter popupmenu dein menu eingestllt und es funktioniert nicht???

nach meinen kenntnisse kann man dies net nicht evrstelen also so wie oben bleibt es dnan auf
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Mo 28.02.05 21:58 
ich weis das es im normal fall was es ja eigendlich auch ist aufbleiben muss macht es aber nicht
Chilla111
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Mo 28.02.05 22:01 
hm vermute das vielleicht irgend ein weiters menu das event abbricht oder so wäre meine einzige erklärung hat denn keine ne bessere?
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Mo 28.02.05 22:07 
ist aber kein anderes da...
kann ich also nur versuchen Neuzustarten das Menü vorher löschen und überall raus nehmen und später wieder einbauen...
Chilla111
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Mo 28.02.05 22:09 
schick mir doch mal das prog gezippt alos prjekt etc an meine e-mail big-eric@gmx.de
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Mo 28.02.05 22:34 
Hoffe du kannst was damit anfangen. :D

(und trotz das das ein Freeware Projekt ist, behandele den Code bitte sorgsam ich will nicht dass der Code auch gleich free ist, dh du kannst ihn verwenden aber bitte nicht gleich kompeilieren und online stellen da das eigenlich mein Projekt ist und das auch nicht in 1 stunde geschrieben wurden :wink: Danke) :D

Tschau
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Mi 02.03.05 16:22 
Gut danke!!! ich hab den Fehler gefunden... der Timer den ich hab setzt das Programm in den Vordergrund und das jede Sekunde. nun hab ich vergessen den nach dem 1. mal zu deaktivieren sodass diser das Programm in den Vordergrund gesetzt hat und das PopupMenü dan Fokus verlor (und verschwand)...

Also nochmal Danke für die Hilfe...
Tschau