Refresh vars in Office2007-Bar from MDI-Child ? => solved

Refresh vars in Office2007-Bar from MDI-Child ? => solved

Postby ukoenig » Fri Feb 01, 2008 6:51 pm

Hello from Germany
I'm still busy with the DB-Tool i want to put in the forum
1 promlem is left :
I don't get the var in the Office2007-Bar updated,
when i change the var in the MDI-Child


Added Information : 02.02.2008

RECEIVE Values from a Outlook2003-Child
in a Office2007-ButtonBar
---------------------------------------------------------
GET = oGet:Value(), oGet:Refresh()
SAY = oSay:Varget(), oSay:Refresh()
RADIO = oRadio:nOption, oRadio:Refresh()
CHECKBOX = oCheck:Varget(), oCheck::Refresh()

SEND new Values from Office2007-ButtonBar
to a Outlook2003-Child
-----------------------------------------------------
RADIO = aScope:nOption(2), aScope:Refresh()
for .T.
CHECK = oCheck:Check(), oCheck:Refresh()
for .F.
CHECK = oCheck:UnCheck(), oCheck:Refresh()
GET = oGet:VarPut("NewValue"), oGet:Refresh()
SAY = oSay:VarPut("NewValue"), oSay:Refresh()


The changes for the problem :

// This Var has to be changed
//--------------------------------------
REDEFINE GET oEXPORT VAR cEXPORT ID 170 OF aCtrl[nPage] ;
PICTURE "!!!!!!!!!!!!!!!!!!!!" UPDATE
// -------------------------------------

aCtrl[nPage]:bStart:= ;
{|| B_Bar4(oDlg,oBrw5,aCtrl,nPage,cFile1,oExport) } // !!!!

// ----------------------------------------

FUNCTION B_Bar4(oDlg,oBrw5,aCtrl,nPage,cFile1,oExport) // !!!!

// The changed cEXPORT in the Child
// -----------------------------------------
DEFINE BUTTON oBtn1 OF oBar4 ;
ACTION ( aCtrl[nPage]:Update ), ; // Child Update
EXP_DBF(oEXPORT:Value(),cFile1), ; // the changed Var
DBSELECTAREA(1), DBGOTOP(), ;
oBrw5:Refresh(), ;
oBrw5:SetFocus() ) ;
RESOURCE "Question" PROMPT "DBF" + CRLF + "Exportieren"




// The old code

//------------ Quick- Browse Outlook2003 ---------------------------

FUNCTION PROG_4(oDlg,aCtrl,nPage,aCors)

LOCAL oFile1, oBrw5
LOCAL oFilter, oSUCH, aSCOPE, oINDKEY
LOCAL oOemAnsi, lClrFlag :=.f.
LOCAL nSCOPE := 1
LOCAL cFilter := SPACE( 70 )
LOCAL cFELD := "", l_INDEX := .F.
LOCAL lOemAnsi := .T., cOemAnsi := ""
LOCAL cFile1 := GET_DBF2()
LOCAL DBFTYP := CabDbf (cFile1)
LOCAL cEXPORT := "EXPORT.DBF "
// ----------------------------------------
// update ok in MDI-Child but not in the Office-Bar

DBSELECTAREA(1)
USE &cFile1
DBGOTOP()

// oDlg = oOutlook2003 Main-Dialog
// --------------------------------------------
// aCtrl[nPage] = Selected Button of oOutlook2003
// --------------------------------------------

DEFINE DIALOG aCtrl[nPage] RESOURCE "BROWSER_1" OF oDlg PIXEL

oBrw5 := TXBrowse():New( aCtrl[nPage] )

oBrw5:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw5:nColDividerStyle := LINESTYLE_BLACK
oBrw5:nRowDividerStyle := LINESTYLE_BLACK
oBrw5:lColDividerComplete := .t.
oBrw5:nHeaderLines := 1
oBrw5:nDataLines := 1
oBrw5:lAllowColSwapping := .t.
oBrw5:lOemToAnsi := lOemAnsi
oBrw5:SetRDD()
.........
.........
oBrw5:CreateFromResource( 110 )

// This Var has to be changed
//--------------------------------------
REDEFINE GET oEXPORT VAR cEXPORT ID 170 OF aCtrl[nPage] ;
PICTURE "!!!!!!!!!!!!!!!!!!!!" UPDATE
// -------------------------------------

// Connection of Office2007-Bar to the MDI-Child
//------------------------------------------------------
aCtrl[nPage]:bStart:= ;
{|| B_Bar4(oDlg,oBrw5,aCtrl,nPage,cFile1,cExport) }

ACTIVATE DIALOG aCtrl[nPage] NOWAIT ;
ON INIT ( aCtrl[nPage]:Move( aCORS [1] + 15, aCORS [2] + 200, ;
aCtrl[nPage]:nWidth, aCtrl[nPage]:nHeight, .f. ) )

RETURN( NIL )

// ----------------------------------------

FUNCTION B_Bar4(oDlg,oBrw5,aCtrl,nPage,cFile1,cExport)

LOCAL oBar4, oBtn1

// I want a Export of => cFile1 To => cEXPORT

DEFINE BUTTONBAR oBar4 SIZE 65, 95 _3D 2007 ;
OF aCtrl[nPage] RIGHT

// Updates cEXPORT in the Child but not here
// ---------------------------------------------------
DEFINE BUTTON oBtn1 OF oBar4 ;
ACTION ( aCtrl[nPage]:Update ), ;
EXP_DBF(cEXPORT,cFile1), ;
DBSELECTAREA(1), DBGOTOP(), ;
oBrw5:Refresh(), ;
oBrw5:SetFocus() ) ;
RESOURCE "Question" PROMPT "DBF" + CRLF + "Exportieren"

RETURN( NIL )

Is it possible, to get a refresh of oBar4 ?

Regards
U. König :lol:
Last edited by ukoenig on Sun Feb 03, 2008 12:26 pm, edited 4 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby James Bott » Fri Feb 01, 2008 8:33 pm

I don't quite undestand what you are trying to do but if you wish to update the GET you are going to have to do oExport:varPus( cVar ) where cVar is the new value. Then you may need to refresh the GET; oExport:refresh().

If you want to do this each time a record is changed than you will have to call these either using oBrw:bChange or in oBrw:bSkip.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Update a Var in Office2007-Bar from MDI-Child fixed !!!

Postby ukoenig » Fri Feb 01, 2008 9:00 pm

As a sample i had to do :

In the Outlook2003-Child => oExport VAR cEXPORT

To show the Var in the Office2007-Buttonbar
oExport:Value() // the changed value from the child
------------------

I just want to export the database
to the new destination when i change the contents of < cExport >.
With a Click on a Office-Bar-Button, i want a refresh of the
< cExport >-field and then start the export of the database with
the new destination ( not the default-value )

The problem i have in the moment :
The Office-Bar shows the default-value with
MsgAlert( cExport ) and doesn't change after the Child-Refresh()

Thank you.
U. könig :lol:
Last edited by ukoenig on Fri Feb 01, 2008 10:33 pm, edited 1 time 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby James Bott » Fri Feb 01, 2008 9:04 pm

>oExport:varPush( cVar )

It should be oExport:varPut( cVar ).

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 55 guests