Forum | | | | Manfred Barei | Hi,
there for the Window Menu something like How Settext around the Menuetext To Change
Greeting |
| | | Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 | | 01/13/11 ▲ |
| |
| | | helps you SetMenuItemInfo [...] ? |
| | | | |
| | Rolf Koch | or to hardship a Proc write. Kompl. Menu delete and new Values (z.B. Parameter Passing in Proc) new create. so would I it make. |
| | | | |
| | Detlef Jagolski | or so?
Declare appexit%
Declare Button1&
Declare Menu#, hSubMenu&
$H WINDOWS.PH
$H MESSAGES.PH
Proc CreateMainMenu
Pop "Beispiel"
AppendMenu 1,"Text1"
ENDPROC
Set("TrueColor", 1)
Window Style $003F
Window Title "DesignForm"
Window %maxX + 5,114 - 498,415
Cls ~GetSysColor(15)
UseFont "MS Sans Serif",13,0,0,0,0
SetDialogFont 1
CreateMainMenu
Button1&=Create("Button",%hwnd,"Menü ändern",93,65,75,25)
SetWindowPos %hwnd = 207,114 - 498,415;0
WhileNot appexit%
WaitInput
If %key = 2
appexit% = 1
ElseIf MenuItem(1)
'Menu Text1
ElseIf Clicked(Button1&)
Dim Menu#,255
hSubMenu& = ~GetSubMenu(&hMenu,0)
String Menu#,0="Ich be the new Text"
~ModifyMenu(hSubMenu&,0,~MF_BYPOSITION | ~MF_STRING,1,Menu#)
Dispose Menu#
ElseIf %key = 4
' Fenstergröße
ElseIf %key = 5
' Help
EndIf
Wend
|
| | | XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 01/14/11 ▲ |
| |
| | Manfred Barei | Hello Detlef,
so have I the already hinbekommen, however would like I the Hauptmenueintrag (supreme plain) too Change (this is that I not yet hinbekomme), for further Vorshläge be I open.
have it so made, How Rolf it suggested has, however ought to it still too another Possibility give, others programs get the still too there.
this is Maybe one suggestion for XProfan13 (SetText too for the Menu), Roland is this eventuel umsetzbar?
Greeting |
| | | Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 | | 01/14/11 ▲ |
| |
| | Rolf Koch | Dürfte still no trouble his:
means only &hmenu indicate. |
| | | | |
| | Rolf Koch | alas forget, so it too directly updated thereafter another:
|
| | | | |
| | Detlef Jagolski | | | | XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 01/14/11 ▲ |
| |
| | Manfred Barei | Hello Detlef,
can you once more help, get it simply not there. whom hMenu entry can I now Change, however I get with the the hSubMenu entry simply not there, see code.
Declare appexit%
Declare Button1&,Button2&
Declare Menu#,hMenu&,hSubMenu&
Dim Menu#,255
$H WINDOWS.PH
$H MESSAGES.PH
Proc CreateMainMenu
Pop "Hauptmenü1"
AppendMenu 1,"Text1"
Pop "Hauptmenü2"
AppendMenu 2,"Text2"
ENDPROC
Proc ChangeMenu
Parameters m%,nr%,Text$
' m%, with 0 is the hMenu meant, with 1 the hSubMenu
' nr%, The position the hMenu or. d MenuItem
' Text$ contains whom new Text
hMenu& = ~GetMenu(&hMenu,0)
hSubMenu& = ~GetSubMenu(&hMenu,0)
String Menu#,0=Text$
Case m%=0 : ~ModifyMenu(&hMenu,nr%,~MF_BYPOSITION | ~MF_STRING,1,Menu#)
Case m%=1 : ~ModifyMenu(hSubMenu&,nr%,~MF_BYPOSITION | ~MF_STRING,1,Menu#)
~DrawMenuBar(%hwnd)
ENDPROC
Set("TrueColor", 1)
Window Style $003F
Window Title "DesignForm"
Window %maxX + 5,114 - 498,415
Cls ~GetSysColor(15)
UseFont "MS Sans Serif",13,0,0,0,0
SetDialogFont 1
CreateMainMenu
Button1&=Create("Button",%hwnd,"hMenü ändern",93,65,100,25)
Button2&=Create("Button",%hwnd,"subMenü ändern",93,100,100,25)
SetWindowPos %hwnd = 207,114 - 498,415;0
WhileNot appexit%
Waitinput
If %key = 2
appexit% = 1
Dispose Menu#
ElseIf MenuItem(1)
'Menu Text1
ElseIf Clicked(Button1&)
ChangeMenu 0,0,"Hauptmenü OK"
ElseIf Clicked(Button2&)
ChangeMenu 1,1,"Test2 OK"
ElseIf %key = 4
' Fenstergröße
ElseIf %key = 5
' Help
EndIf
Wend
Greeting |
| | | Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 | | 01/21/11 ▲ |
| |
| | Detlef Jagolski | Hello Manfred,
so ought to it weg.
GetMenu has only one Parameter and must %hwnd his in unserem drop, &hMenu is the lever of Menu the Mainwindow.therefore need we hMenu& = ~GetMenu(%hwnd) not, having with you too no function.
Declare appexit%
Declare Button1&,Button2&
Declare Menu#,hMenu&,hSubMenu&
Dim Menu#,255
$H WINDOWS.PH
$H MESSAGES.PH
Proc CreateMainMenu
Pop "Hauptmenü1"
AppendMenu 1,"Text1"
Pop "Hauptmenü2"
AppendMenu 2,"Text2"
ENDPROC
Proc ChangeMenu
Parameters m%,nr%,Pos%,Text$
' m%, with 0 is the hMenu meant, with 1 the hSubMenu
' nr%, The position the hMenu or. d MenuItem
' Pos% gives The position on for the hSubMenu on
' Text$ contains whom new Text
hSubMenu& = ~GetSubMenu(&hMenu,Pos%)
String Menu#,0=Text$
Case m%=0 : ~ModifyMenu(&hMenu,nr%,~MF_BYPOSITION | ~MF_STRING,1,Menu#)
Case m%=1 : ~ModifyMenu(hSubMenu&,nr%,~MF_BYPOSITION | ~MF_STRING,1,Menu#)
~DrawMenuBar(%hwnd)
ENDPROC
Set("TrueColor", 1)
Window Style $003F
Window Title "DesignForm"
Window %maxX + 5,114 - 498,415
Cls ~GetSysColor(15)
UseFont "MS Sans Serif",13,0,0,0,0
SetDialogFont 1
CreateMainMenu
Button1&=Create("Button",%hwnd,"hMenü ändern",93,65,100,25)
Button2&=Create("Button",%hwnd,"subMenü ändern",93,100,100,25)
SetWindowPos %hwnd = 207,114 - 498,415;0
WhileNot appexit%
Waitinput
If %key = 2
appexit% = 1
Dispose Menu#
ElseIf MenuItem(1)
'Menu Text1
ElseIf Clicked(Button1&)
ChangeMenu 0,0,-1,"Hauptmenü OK"
ElseIf Clicked(Button2&)
ChangeMenu 1,0,0,"Test2 OK"
ElseIf %key = 4
' Fenstergröße
ElseIf %key = 5
' Help
EndIf
Wend
|
| | | XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 01/22/11 ▲ |
| |
| | Manfred Barei | Hello Detlef,
DAAAAAAAANNNNNKKKEE, now funtz it How I it need. Related to the second Parameter with ~GetSubMenu true that I always wrong made have, has the kanze reading in the network nothing genützt.
over again thanks for Help too all others.
Greeting from the Heath |
| | | Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 | | 01/22/11 ▲ |
| |
| | Detlef Jagolski | Detlef Jagolski (22.01.11)
Hello Manfred, so ought to it weg. GetMenu has only one Parameter and must %hwnd his in unserem drop, &hMenu is the lever of Menu the Mainwindow.therefore need we hMenu& = ~GetMenu(%hwnd) not, having with you too no function. Declare appexit%
Declare Button1&,Button2&
Declare Menu#,hMenu&,hSubMenu&
Dim Menu#,255
$H WINDOWS.PH
$H MESSAGES.PH
Proc CreateMainMenu
Pop "Hauptmenü1"
AppendMenu 1,"Text1"
Pop "Hauptmenü2"
AppendMenu 2,"Text2"
ENDPROC
Proc ChangeMenu
Parameters m%,nr%,Pos%,Text$
' m%, with 0 is the hMenu meant, with 1 the hSubMenu
' nr%, The position the hMenu or. d MenuItem
' Pos% gives The position on for the hSubMenu
' Text$ contains whom new Text
hSubMenu& = ~GetSubMenu(&hMenu,Pos%)
String Menu#,0=Text$
Case m%=0 : ~ModifyMenu(&hMenu,nr%,~MF_BYPOSITION | ~MF_STRING,1,Menu#)
Case m%=1 : ~ModifyMenu(hSubMenu&,nr%,~MF_BYPOSITION | ~MF_STRING,1,Menu#)
~DrawMenuBar(%hwnd)
ENDPROC
Set("TrueColor", 1)
Window Style $003F
Window Title "DesignForm"
Window %maxX + 5,114 - 498,415
Cls ~GetSysColor(15)
UseFont "MS Sans Serif",13,0,0,0,0
SetDialogFont 1
CreateMainMenu
Button1&=Create("Button",%hwnd,"hMenü ändern",93,65,100,25)
Button2&=Create("Button",%hwnd,"subMenü ändern",93,100,100,25)
SetWindowPos %hwnd = 207,114 - 498,415;0
WhileNot appexit%
Waitinput
If %key = 2
appexit% = 1
Dispose Menu#
ElseIf MenuItem(1)
'Menu Text1
ElseIf Clicked(Button1&)
ChangeMenu 0,0,-1,"Hauptmenü OK"
ElseIf Clicked(Button2&)
ChangeMenu 1,0,0,"Test2 OK"
ElseIf %key = 4
' Fenstergröße
ElseIf %key = 5
' Help
EndIf
Wend
|
| | | XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 01/22/11 ▲ |
| |
|
AnswerTopic-Options | 19.541 Views |
Themeninformationenthis Topic has 4 subscriber: |