FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Button Bar dissapears
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Button Bar dissapears
Posted: Thu May 24, 2007 09: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)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Button Bar dissapears
Posted: 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
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Button Bar dissapears
Posted: 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)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Button Bar dissapears
Posted: 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
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Button Bar dissapears
Posted: Thu May 24, 2007 01: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)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Button Bar dissapears
Posted: Thu May 24, 2007 04: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
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Button Bar dissapears
Posted: Thu May 24, 2007 04: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)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Button Bar dissapears
Posted: Thu May 24, 2007 04: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
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Button Bar dissapears
Posted: Thu May 24, 2007 05:15 PM
//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)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Button Bar dissapears
Posted: Thu May 24, 2007 05: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
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Button Bar dissapears
Posted: Thu May 24, 2007 05: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)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Button Bar dissapears
Posted: Thu May 24, 2007 08:19 PM
Ollie,

Do it this way:
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
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Button Bar dissapears
Posted: Thu May 24, 2007 09: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)
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Button Bar dissapears
Posted: Tue Jun 26, 2007 01:11 PM
I have noticed a new glitch in the code above. (repeated here for convenience)
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)

Continue the discussion