Hello,I met one issue when resize my window by onsize().
Outlook of my windows like that:
---------------------------------------
win1 |
---------------------------------------
win4 | win5 | win2 |
----------------------| |
win6 | win7 |---------------
---------------------- win3 |
win8 | win9 | |
----------------------------------------
In totally, I have 9 window, I used createstatic and createwindow to create successfully.
But when I use onsize() to define each window size, it cannot work.
CRect rect;
GetClientRect(&rect);
int rectWidth = rect.Width();
int rectHeight = rect.Height();
int rectAccountTopHeight = rectHeight / 9;
int rectAccountBottomHeight = rectHeight / 9;
int rectOrderLeftWidth = rectWidth / 10 * 7;
int rectOrderRightWidth = rectWidth / 10 * 3;
int rectOrderBuySellTopHeight = rectAccountBottomHeight / 2;
int rectOrderBuySellBottomHeight = rectAccountBottomHeight / 2;
int rectMarketTopHeight, rectMarketMidHeight, rectMarketBottomHeight;
rectMarketTopHeight = rectMarketMidHeight = rectMarketBottomHeight = rectAccountBottomHeight / 3;
int rectMarketDetailLeftWidth = rectOrderLeftWidth / 10 * 7;
int rectMarketDetailRightWidth = rectOrderLeftWidth / 10 * 3;
int rectNoTradeLeftWidth = rectOrderLeftWidth / 2;
int rectNoTradeRightWidth = rectOrderLeftWidth / 2;
int rectPositionLeftWidth = rectOrderLeftWidth / 2;
int rectPositionRightWidth = rectOrderLeftWidth / 2;
if (isSplitterwin1)
{
m_splitterwin1.SetRowInfo(0, rectAccountTopHeight, 100);
m_splitterwin1.SetRowInfo(1, rectAccountBottomHeight, 100);
m_splitterwin1.RecalcLayout();
}
if (isSplitterwin2)
{
m_splitterwin2.SetColumnInfo(0, rectOrderLeftWidth, 50);
m_splitterwin2.SetColumnInfo(1, rectOrderRightWidth, 50);
m_splitterwin2.RecalcLayout();
}
if (isSplitterOrderBuySell)
{
m_splitterOrderBuySell.SetRowInfo(0, rectOrderBuySellTopHeight, 50);
m_splitterOrderBuySell.SetRowInfo(0, rectOrderBuySellBottomHeight, 50);
m_splitterOrderBuySell.RecalcLayout();
}
if (isSplitterMarket)
{
m_splitterMarket.SetRowInfo(0, rectMarketTopHeight, 50);
m_splitterMarket.SetRowInfo(1, rectMarketMidHeight, 50);
m_splitterMarket.SetRowInfo(2, rectMarketBottomHeight, 50);
m_splitterMarket.RecalcLayout();
}
if (isSplitterMarketDetail)
{
m_splitterMarketDetail.SetColumnInfo(0, rectMarketDetailLeftWidth, 10);
m_splitterMarketDetail.SetColumnInfo(1, rectMarketDetailRightWidth, 50);
m_splitterMarketDetail.RecalcLayout();
}<small></small>
if (isSplitterNoTrade)
{
m_splitterNoTrade.SetColumnInfo(0, rectNoTradeLeftWidth, 50);
m_splitterNoTrade.SetColumnInfo(1, rectNoTradeRightWidth, 50);
m_splitterNoTrade.RecalcLayout();
}
if (isSplitterPosition)
{
m_splitterPosition.SetColumnInfo(0, rectPositionLeftWidth, 50);
m_splitterPosition.SetColumnInfo(1, rectPositionRightWidth, 50);
m_splitterPosition.RecalcLayout();
}
After build and execute, on the top of window, win1/2/4/5 will be hidden, only show win8, win9, win3.
Any idea to fix it? How to use setRowInfo and SetColumnInfo? Thanks!