Hello,
I have a little problem :
With one Button in the office-bar (Main-window), i want to know the position inside a folder of a child.
To define a PUBLIC-var at start, doesn't help
Is it possible to use just 1 Button to start a action in relation
of the folder-position ?
Regards
Uwe
Possible, to send a value from mdi-child to main-window ?
Possible, to send a value from mdi-child to main-window ?
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Message from Child to Main-Window
Hello James,
The problem is, i want to start a action in the main-window.
In the main window, i define a var < nPROGPOS = 1 >.
In the Child, the var gets the value from the folder :
ON CHANGE Optionget( nOption, nOldoption)
nPROGPOS := nOption
A Test in the Child => nPROGPOS has the value from the folder-pos.
Inside the child, everything is ok.
But when i press the button in the Main-Window
nPROGPOS is allways 1.
I need the nOption-value in the office-bar.
When it is impossible to do it this way, i have to create a button
in each folder for the needed action.
It seems, nPROGPOS in the Main-window is different to the one
in the Child.
I checked : Public, static, private, by reference
No chance at all.
Regards
Uwe
The problem is, i want to start a action in the main-window.
In the main window, i define a var < nPROGPOS = 1 >.
In the Child, the var gets the value from the folder :
ON CHANGE Optionget( nOption, nOldoption)
nPROGPOS := nOption
A Test in the Child => nPROGPOS has the value from the folder-pos.
Inside the child, everything is ok.
But when i press the button in the Main-Window
nPROGPOS is allways 1.
I need the nOption-value in the office-bar.
When it is impossible to do it this way, i have to create a button
in each folder for the needed action.
It seems, nPROGPOS in the Main-window is different to the one
in the Child.
I checked : Public, static, private, by reference
No chance at all.
Regards
Uwe
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Uwe,
Use a static inside a function. You can set it in the child window and retreive it from anywhere.
James
Use a static inside a function. You can set it in the child window and retreive it from anywhere.
James
Code: Select all
function setOption(nNewOption)
local nReply
static nOldOption:=1
nReply:= nOldOption
if nNewOption != nil
nOldOption:= nNewOption
endif
return nReply
Message from MDI-Folder to Main-Window
Hello James,
I added the Function to the program and it works fine now.
Thank you very much.
Uwe [/code]
I added the Function to the program and it works fine now.
Thank you very much.
Code: Select all
STATIC nOption
FUNCTION MAIN()
LOCAL oWnd, oBar, oBtn1, oBtn2
DEFINE WINDOW oWnd TITLE "Test" MDI MENU TMenu():New()
DEFINE BUTTONBAR oBar 3DLOOK OF oWnd BUTTONSIZE 70,80 2007 RIGHT
// Folder
DEFINE BUTTON oBtn1 OF oBar ;
ACTION ( BRW_DESIGN(oWnd) ) ;
RESOURCE "notes_5" PROMPT "Visual" + CRLF + "Tools"
// Action-Button for Folder-Tabs
// ---------------------------------------
DEFINE BUTTON oBtn2 OF oBar ;
ACTION ( SHOW_POS( setOption(nOption) ) ; // Get the Folder-Tab-Position
RESOURCE "magic_5" PROMPT "Show " + CRLF + "Design"
ACTIVATE WINDOW oWnd MAXIMIZED
// --------------------------------
FUNCTION BRW_DESIGN(oWnd)
LOCAL oDlg1, oFld, oProg
DEFINE DIALOG oDlg1 RESOURCE "BRWDESIGN" OF oWnd
REDEFINE FOLDER oFld ID 300 OF oDlg1 FONT oProgFont ;
PROMPTS " &Colors ", " &Lines & Grids ", " &Fonts & Bitmaps ", " &Dialog-Titles ", ;
" &Windows & Dialog "," &Gif-Test" ;
DIALOGS "Browse1", "Browse2", "Browse3", "Browse4", "Browse5", "Browse6" ;
ON CHANGE( MsgAlert( oFld:nOption ) ) // activ Option
ACTIVATE DIALOG oDlg1 CENTERED NOWAIT
RETURN( NIL )
// ------------------------------
FUNCTION SetOption(nNewOption)
local nReply
static nOldOption:=1
nReply:= nOldOption
IF nNewOption != nil
nOldOption:= nNewOption
ENDIF
RETURN nReply
// -------------------------------
FUNCTION SHOW_POS(nPosition)
// Options in Relation to Folder-Tabs
// ---------------------------------------------
MsgAlert( "Folder-Pos : " + str(nPosition), "Position" )
RETURN( NIL )
Last edited by ukoenig on Mon Apr 28, 2008 8:24 am, edited 3 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact: