- m_windowId = id == -1 ? NewControlId() : id;
-
- FrameForm=FrmNewForm(m_windowId,title,0,0,160,160,false,0,NULL,0,NULL,0);
- if(FrameForm==0)
+ SetId( id == wxID_ANY ? NewControlId() : id );
+
+ WinConstraintsType constraints;
+ memset(&constraints, 0, sizeof(WinConstraintsType));
+ // position
+ constraints.x_pos = ( pos.x == wxDefaultCoord ) ? winUndefConstraint : pos.x;
+ constraints.y_pos = ( pos.y == wxDefaultCoord ) ? winUndefConstraint : pos.y;
+ // size
+ constraints.x_min = winUndefConstraint;
+ constraints.x_max = winMaxConstraint;
+ constraints.x_pref = ( size.x == wxDefaultCoord ) ? winUndefConstraint : size.x;
+ constraints.y_min = winUndefConstraint;
+ constraints.y_max = winMaxConstraint;
+ constraints.y_pref = ( size.y == wxDefaultCoord ) ? winUndefConstraint : size.y;
+
+ FrameForm = FrmNewFormWithConstraints(
+ GetId(),
+ title.c_str(),
+ winFlagBackBuffer,
+ &constraints,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ 0
+ );
+
+ if(FrameForm==NULL)