Button Bar dissapears

Button Bar dissapears

Postby Ollie » Thu May 24, 2007 9:25 am

When my program does some functions like envoke an email message, when I return to my program, one of my toolbars has dissappeared.

If I minimise and maximise the program it reappears. Where is my problem?
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Antonio Linares » Thu May 24, 2007 12:22 pm

Ollie,

Are you using a MDI window ? is it a toolbar or a buttonbar ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Ollie » Thu May 24, 2007 12:42 pm

MDICHILD
Buttonbar
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Antonio Linares » Thu May 24, 2007 12:45 pm

Ollie,

Could you take a screenshot and upload it to www.imageshack.us and copy here the URL to review it ? thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Ollie » Thu May 24, 2007 1:23 pm

done.

I send a mail using TMAIL

Then when the program returns, buttonbar is gone.

http://img474.imageshack.us/my.php?imag ... hotrg8.jpg
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Antonio Linares » Thu May 24, 2007 4:06 pm

Ollie,

How are you placing the controls on the MdiChild ? Are you using a dialog on top of it ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Ollie » Thu May 24, 2007 4:11 pm

Yes I am.
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Antonio Linares » Thu May 24, 2007 4:21 pm

Ollie,

When you create the buttonbar, does it belong to the mdichild or to the dialog ? ( CLAUSE "OF ..." )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Ollie » Thu May 24, 2007 5:15 pm

Code: Select all  Expand view
//Main application window:
DEFINE WINDOW Win_Main FROM 0, 0 TO 600, 800 PIXEL TITLE 'SubsPro' MDI ICON oIcon MENU mainmenu() //ICON FILENAME "..\RESOURCE\SUBSPRO.BMP" //BACKCOLOR aBackcolor ON RELEASE quitprog()

//Button Bar at top:   
DEFINE BUTTONBAR oMain_Toolbar OF Win_Main SIZE 70, 50 3D //  Microsoft Standard: 24,26 3D bitmaps to be 18pix high by 19pix wide
   DEFINE BUTTON of oMain_Toolbar PROMPT "Subscribers" TOP ACTION DBMAIN() TOOLTIP "Current / Active Subscribers" RESOURCE "LED_GREEN"
   DEFINE BUTTON of oMain_Toolbar PROMPT "Prospective" TOP ACTION DBPROS() TOOLTIP "Prospective Subscribers" RESOURCE "LED_YELLOW"
   DEFINE BUTTON of oMain_Toolbar PROMPT "Free"  TOP ACTION DBFREE() TOOLTIP "Voucher/Free Copies" RESOURCE "LED_RED"
   //  DEFINE BUTTON of oMain_Toolbar PROMPT "Report"  TOP ACTION makertf() RESOURCE "LETTER" //report2()  GROUP //puts a little space before this button
   //  DEFINE BUTTON of oMain_Toolbar PROMPT "Open DBFs"  TOP ACTION opendbfs() RESOURCE "tools"
   DEFINE BUTTON of oMain_Toolbar PROMPT "Exit"  TOP ACTION quitprog() TOOLTIP "Exit" RESOURCE "exit"
   
//MDICHILD
DEFINE WINDOW Win_Dbmain TITLE "Subscribers Database" MDICHILD ICON oIcon //NOMINIMIZE NOMAXIMIZE //VSCROLL HSCROLL

//Button bar of MDICHILD
DEFINE BUTTONBAR oButton_Bar OF Win_Dbmain SIZE 40, 40 3D


Is this what you need to know?
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Antonio Linares » Thu May 24, 2007 5:18 pm

Ollie,

The buttonbar should belong to the dialog:

//MDICHILD
DEFINE WINDOW Win_Dbmain TITLE "Subscribers Database" MDICHILD ICON oIcon //NOMINIMIZE NOMAXIMIZE //VSCROLL HSCROLL

... create the dialog oDlg ...

//Button bar
DEFINE BUTTONBAR oButton_Bar OF oDlg SIZE 40, 40 3D
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Ollie » Thu May 24, 2007 5:54 pm

I get : System Error: Cannot create a top-level child window.

Lets recap:
//Application's main window - Win_main
DEFINE WINDOW Win_Main FROM 0, 0 TO 600, 800 PIXEL TITLE 'SubsPro' MDI ICON oIcon MENU mainmenu() ON RELEASE quitprog()

//Buttonbar of Win_main
DEFINE BUTTONBAR oMain_Toolbar OF Win_Main SIZE 70, 50 3D

//One of the buttons creates a MDI Child window: Win_Dbmain
DEFINE WINDOW Win_Dbmain TITLE "Subscribers Database" MDICHILD ICON oIcon

//I define its button bar
DEFINE BUTTONBAR oButton_Bar OF Win_Dbmain SIZE 40, 40 3D

//I then define the Dlg - Dlg_Dbmain (it has folders/Tabs)
DEFINE DIALOG Dlg_Dbmain RESOURCE "DBMAIN" OF Win_Dbmain ICON oIcon
*****
//These dlgs and windows are activated as follows (so that they behave "as one"

ACTIVATE DIALOG Dlg_Dbmain NOWAIT ; // It has to be NonModal
ON INIT ( Dlg_Dbmain:Move( 0, 0 ) ) ;
VALID ( Win_Dbmain:End(), .T. )

ACTIVATE WINDOW Win_Dbmain MAXIMIZED ;
ON RESIZE ( WNDSETSIZE( Dlg_Dbmain, WNDHEIGHT( Win_Dbmain ), WNDWIDTH( Win_Dbmain ) ) ) ;
VALID ( IF( save_MAIN_data(), ( close_tables(), Win_Dbmain := NIL, .T. ), .F. ) )


If I remove the line:
DEFINE BUTTONBAR oButton_Bar OF Win_Dbmain SIZE 40, 40 3D
and move it to the line ***** above
DEFINE BUTTONBAR oButton_Bar OF Dlg_Dbmain SIZE 40, 40 3D
I get : System Error: Cannot create a top-level child window.

I have a better screen shot with annotations that explains it nicely:

http://img120.imageshack.us/my.php?imag ... hotsr5.jpg
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Antonio Linares » Thu May 24, 2007 8:19 pm

Ollie,

Do it this way:
Code: Select all  Expand view
ACTIVATE DIALOG Dlg_Dbmain NOWAIT ; // It has to be NonModal
ON INIT ( Dlg_Dbmain:Move( 0, 0 ), BuildButtonBar( Dlg_Dbmain ) ) ;
VALID ( Win_Dbmain:End(), .T. )

ACTIVATE WINDOW Win_Dbmain MAXIMIZED ;
ON RESIZE ( WNDSETSIZE( Dlg_Dbmain, WNDHEIGHT( Win_Dbmain ), WNDWIDTH( Win_Dbmain ) ) ) ;
VALID ( IF( save_MAIN_data(), ( close_tables(), Win_Dbmain := NIL, .T. ), .F. ) )

...

function BuildButtonBar( oDlg )

   local oButton_Bar

   DEFINE BUTTONBAR oButton_Bar OF oDlg SIZE 40, 40 3D

   ... add the buttons here

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Ollie » Thu May 24, 2007 9:10 pm

Excellent !!

Thank you.
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Ollie » Tue Jun 26, 2007 1:11 pm

I have noticed a new glitch in the code above. (repeated here for convenience)
Code: Select all  Expand view
ACTIVATE DIALOG Dlg_Dbmain NOWAIT ; // It has to be NonModal
ON INIT ( Dlg_Dbmain:Move( 0, 0 ), BuildButtonBar( Dlg_Dbmain ) ) ;
VALID ( Win_Dbmain:End(), .T. )

ACTIVATE WINDOW Win_Dbmain MAXIMIZED ;
ON RESIZE ( WNDSETSIZE( Dlg_Dbmain, WNDHEIGHT( Win_Dbmain ), WNDWIDTH( Win_Dbmain ) ) ) ;
VALID ( IF( save_MAIN_data(), ( close_tables(), Win_Dbmain := NIL, .T. ), .F. ) )


When the Window (a child) is closed (with the 'X' or with win_dbmain:END() ) there are no problems.

When the user presses ESC - it seems to close the Dlg_DBMAIN first, which then ENDs the Win_DBMAIN. This works as long as no data is changed, otherwise an error occurs. Something like : Error description: Error BASE/1004 Class: 'NIL' has no exported method: END

Please tell me what needs to be ENDed or made :=NIL for this to be resolved. (or is that not the problem)
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 41 guests