BUG in sample/statbar sample or wxStatusBar BUG + more ( wxMSW 2.6.2 )

BUG in sample/statbar sample or wxStatusBar BUG + more ( wxMSW 2.6.2 )

Post by undergrave » Sun, 19 Mar 2006 04:19:45


ello,

I have a bug to report ( at least in the samples ).
I use wxMSW 2.6.2. Compilers used to generate this bug are: borland &
gcc. It is probably happening with cl.exe too but for the moment I'm
having some troubles so I cannot compile with cl.exe ( from visual c++
express ).

Steps:
A)
1. Go to the samples/statbar
2. Compile the sample and run the executable
3. Go to the "Status Bar" menu in the menu bar and select Toggle (
Result: The statusbar will disapear )
4. Do the same as in Step 3 ( The results is BAD: The statusbar apears
but it's size is *huge* )

B)
1. Go to the samples/statbar
2. Compile the sample and run the executable
3. Go to the "Status Bar" menu in the menu bar and select Recreate (
Result: The old style statusbar will disapear and a new one will apear )
4. Do the same as in Step 3 ( The results is BAD: The old style
statusbar apears again but it's size is *huge* ... again )

I saw this kind of bug also in one of my application generated with
wxdevcpp ( see comments ):

CDCondFrm::CDCondFrm( wxWindow *parent, wxWindowID id, const wxString
&title, const wxPoint &position, const wxSize& size, long style )
: wxFrame( parent, id, title, position, size, style)
{
CreateGUIControls();
}

void MyFrm::CreateGUIControls(void)
{
//Do not add custom Code here
//wx-devcpp designer will remove them.
//Add the custom code before or after the Blocks
////GUI Items Creation Start

WxStatusBar1 = new wxStatusBar(this, ID_WXSTATUSBAR1);
WxStatusBar1->SetFieldsCount(4);
WxStatusBar1->SetStatusText(wxT(""),0);
WxStatusBar1->SetStatusText(wxT(""),1);
WxStatusBar1->SetStatusText(wxT(""),2);
WxStatusBar1->SetStatusText(wxT(""),3);
int WxStatusBar1_Widths[4];
WxStatusBar1_Widths[0] = -3;
WxStatusBar1_Widths[1] = -1;
WxStatusBar1_Widths[2] = -1;
WxStatusBar1_Widths[3] = -1;
WxStatusBar1->SetStatusWidths(4,WxStatusBar1_Widths);

WxMenuBar1 = new wxMenuBar();
wxMenu *ID_MNU_FILE_1001_Mnu_Obj = new wxMenu(0);
WxMenuBar1->Append(ID_MNU_FILE_1001_Mnu_Obj, wxT("File"));

ID_MNU_FILE_1001_Mnu_Obj->Append(ID_MNU_NEWNETWORK_CTRL_N_1005,
wxT("New\tCtrl-N"), wxT(""), wxITEM_NORMAL);

ID_MNU_FILE_1001_Mnu_Obj->Append(ID_MNU_OPEN_CTRL_O_1006,
wxT("Open\tCtrl-O"), wxT(""), wxITEM_NORMAL);

ID_MNU_FILE_1001_Mnu_Obj->Append(ID_MNU_SAVE_CTRL_S_1025,
wxT("Save\tCtrl-S"), wxT(""), wxITEM_NORMAL);

this->SetMenuBar(WxMenuBar1); // LINE A

this->SetStatusBar(WxStatusBar1); // LINE B

this->SetSize(8,8,763,558);
this->SetTitle(wxT("Project"));
this->Center();
this->SetIcon(wxNullIcon);

////GUI Items Creation End
}

*** If you will run this it will have a big status bar. (BUG)
*** If you swap lines ( line A and line B ) calling this way
SetStatusBar __before__ SetMenuBar everything will be fine.

I don't know for the moment where this bug comes from but it is
happening on wxMSW 2.6.2 ( and maybe not only 2.6.2 for MSW ).
I'm waiting for a confirmation.

And one more question ( maybe offtopic ): Is it *mandatory* to call
wxFrame::SetStatusBar in order to have a frame with a status bar ?

Any ideas ? Vadim ?

Thanks,

Iulian

PS: Sorry if this mail is too long.

---------------------------------------------------------------------
To unsubscribe, e-mail: XXXX@XXXXX.CO
 
 
 

BUG in sample/statbar sample or wxStatusBar BUG + more ( wxMSW 2.6.2 )

Post by undergrave » Sun, 19 Mar 2006 05:43:59

he Bug is also confirmed with visual c++ express compiler and latest
platform sdk.

A note: compiled version of wxwidgets with msvc7.1 compiler cannot be
used with the msvc8 compiler ( visual c++ express ), pretty normal but I
think it's ok to mention that.

Also some warnings apeared in the new version of the microsoft compiler
regarding some deprecated functions like localtime or strcat ( wanted
_strcat ) ... For example:

..\..\include\wx/datetime.h(1063) : warning C4996: 'localtime' was
declared deprecated
C:\Program Files\Microsoft Visual Studio
8\vc\include\time.inl(114) : see declaration of 'localtime'
Message: 'This function or variable may be unsafe. Consider
using localtime_s instead. To disable deprecation,
use_CRT_SECURE_NO_DEPRECATE. See online help for details.'

Any ideeas regarding this bug ?

Iulian-Nicu Serbanoiu wrote:


---------------------------------------------------------------------
To unsubscribe, e-mail: XXXX@XXXXX.COM
For additional commands, e-mail: XXXX@XXXXX.COM