Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / Can we set wxWizard window size?

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Can we set wxWizard window size?
#3131
Posted by: mooncake 2003-12-27 19:40:31
Can we set the window size for height and weight?

I had searched the documentation, no related function...

Thank you.
Meow~
Message2. Re: Can we set wxWizard window size?
#3132
Posted by: upCASE 2003-12-27 22:55:54
Hi!
You'll have to use wxWizard::SetPageSize. I'd recommend to calculate the minimal size for all pages, meaning the size of the biggest page and then set it. A function for is could be

void Wizard::ComputeAndSetSize(wxWizardPage* startPagePtr)
{
    wxSize size = startPagePtr->GetBestSize();
    for(wxWizardPage* pPtr = startPagePtr->GetNext(); pPtr; pPtr = pPtr->GetNext())
    {
        wxSize tmpSize = pPtr->GetBestSize();
        if(tmpSize.GetHeight() > size.GetHeight())
            size.SetHeight(tmpSize.GetHeight());
        if(tmpSize.GetWidth() > size.GetWidth())
            size.SetWidth(tmpSize.GetWidth());
    }
    SetPageSize(size);
}

where Wizard is a class derived from wxWizard.

upcase
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: Can we set wxWizard window size?
#3133
Posted by: mooncake 2003-12-27 23:13:24
Hi,
   Still have nothing effective... @@"  Still same weight and height.
   I had set like this:

   size.SetHeight(300);
   size.SetWidth(200);
   wizard->SetPageSize(size);
   But the size still no change... @@"

Thank you.
Meow~
Message4. Re: Can we set wxWizard window size?
#3135
Posted by: upCASE 2003-12-29 22:01:56
Hi!
Problem is that you can't set that size like that (I guess). Because each page has a different size you have to set it to the maximum of all possible minimal sizes for the pages.
So I'd recommend the following:
In the constructor of the wizard add all pages to the wizard. Use a function like the one I posted and pass it a pointer to the first page. Let the function calculate the minimal size.
I think that you can't change the size once the wizard is created, because the wizard itself is not resizable.

upcase
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-4-19  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0