Hi,
Some comments about your code:
- In a zbox all the elements inside it contribute to the layout natural
size, even the hidden ones.
- SHRINK is an attribute of the dialog. It is useless to set it on every
element inside the dialog. But it will affect everyone inside the dialog.
Shrink will be effective only for containers. For regular elements the
current size will be set for a smaller value only if EXPAND is set.
Best,
Scuri
On Tue, Jun 30, 2015 at 8:17 PM, Eric Wing <[email protected]> wrote:
> On 6/30/15, Antonio Scuri <[email protected]> wrote:
> > It depends on the layout.
> >
> > This usually occurs when you set the SIZE or RASTERSIZE to get an
> initial
> > size for the dialog. The trick is right after showing the dialog, set
> > USERSIZE to NULL. This will remove that limitation.
> >
> > If it is not your case, then I need more details to figure out whats
> > going on.
> >
> > Best,
> > Scuri
> >
>
>
> So I don't think I was using any of those properties. II think that
> means 'natural size' is the default? I tried setting USERSIZE to NULL
> after the Show, but it didn't seem to help.
>
> I'm still new at this, so maybe it would be easier to show you an
> excerpt of my code.
>
> One extra thing I'm doing just in case it matters. I create multiple
> 'views' and put them in a zbox. I'm trying to do something like of
> like a wizard. Each step progresses to the next view within the same
> window (dialog) when the user clicks the correct button.
>
>
>
>
>
> // Creates two large image buttons in the center with labels
> underneath each button
> // returns a hbox or vbox
> Ihandle* NewOrOpenView_Create(
> Ihandle* image_new,
> Ihandle* image_open,
> Icallback on_new_project_callback,
> Icallback on_open_project_callback,
> void* user_data
> )
> {
> Ihandle* main_dialog = NULL;
> Ihandle* image_button_new = NULL;
> Ihandle* image_button_open = NULL;
> Ihandle* label_new = NULL;
> Ihandle* label_open = NULL;
> Ihandle* hbox_for_centered_ui = NULL;
> Ihandle* vbox_for_centered_ui = NULL;
> Ihandle* hbox_for_buttons = NULL;
> Ihandle* hbox_for_labels = NULL;
> Ihandle* vbox_for_new_button_and_label = NULL;
> Ihandle* vbox_for_open_button_and_label = NULL;
>
>
> image_button_new = IupButton(NULL, "newProjectButtonAction");
> image_button_open = IupButton(NULL, "openProjectButtonAction");
>
> IupSetAttributeHandle(image_button_new, "IMAGE", image_new);
> IupSetAttributeHandle(image_button_open, "IMAGE", image_open);
>
> label_new = IupLabel(GenProj_GetLocalizedString("New Project",
> "New Project"));
> label_open = IupLabel(GenProj_GetLocalizedString("Open Project",
> "Open Project"));
>
> IupSetAttribute(label_new, "EXPAND", "HORIZONTAL");
> IupSetAttribute(label_open, "EXPAND", "HORIZONTAL");
> IupSetAttribute(label_new, "SHRINK", "HORIZONTAL");
> IupSetAttribute(label_open, "SHRINK", "HORIZONTAL");
> IupSetAttribute(image_button_new, "EXPAND", "YES");
> IupSetAttribute(image_button_open, "EXPAND", "YES");
> IupSetAttribute(image_button_new, "SHRINK", "YES");
> IupSetAttribute(image_button_open, "SHRINK", "YES");
>
> IupSetAttribute(image_button_new, "ALIGNMENT", "ACENTER:ACENTER");
> IupSetAttribute(image_button_open, "ALIGNMENT", "ACENTER:ACENTER");
> IupSetAttribute(label_new, "ALIGNMENT", "ACENTER:ACENTER");
> IupSetAttribute(label_open, "ALIGNMENT", "ACENTER:ACENTER");
> IupSetAttribute(label_new, "FONTSIZE", "40");
> IupSetAttribute(label_open, "FONTSIZE", "40");
>
>
> vbox_for_new_button_and_label = IupVbox(
> image_button_new,
> label_new,
> NULL
> );
>
> vbox_for_open_button_and_label = IupVbox(
> image_button_open,
> label_open,
> NULL
> );
>
> IupSetAttribute(vbox_for_new_button_and_label, "ALIGNMENT",
> "ACENTER:ACENTER");
> IupSetAttribute(vbox_for_open_button_and_label, "ALIGNMENT",
> "ACENTER:ACENTER");
> IupSetAttribute(vbox_for_new_button_and_label, "SHRINK", "YES");
> IupSetAttribute(vbox_for_open_button_and_label, "SHRINK", "YES");
>
> hbox_for_buttons = IupHbox(
> vbox_for_new_button_and_label,
> vbox_for_open_button_and_label,
> NULL
> );
> IupSetAttribute(hbox_for_buttons, "ALIGNMENT", "ACENTER:ACENTER");
>
> IupSetAttribute(hbox_for_buttons, "MARGIN", "10x10");
> IupSetAttribute(hbox_for_buttons, "SHRINK", "YES");
>
>
>
> IupSetCallback(image_button_new, "ACTION",
> on_new_project_callback);
> IupSetCallback(image_button_open, "ACTION",
> on_open_project_callback);
>
> IupSetAttribute(image_button_new, "MY_USER_DATA", (const
> char*)user_data);
> IupSetAttribute(image_button_open, "MY_USER_DATA", (const
> char*)user_data);
>
> return hbox_for_buttons;
>
> }
>
> // returns a zbox with all the views for the wizard
> Ihandle* GenProj_CreateWizardDialog(
> struct SharedResources* shared_resources,
> Icallback on_new_project_callback,
> Icallback on_open_project_callback,
> Icallback on_next_from_open_project,
> Icallback on_previous_from_open_project,
> Icallback on_previous_from_generation_view,
> void* user_data
> )
> {
>
> Ihandle* main_dialog = NULL;
> Ihandle* zbox_view = NULL;
>
> Ihandle* new_or_open_view = NULL;
> Ihandle* open_existing_view = NULL;
> Ihandle* generation_view = NULL;
> struct WizardControllerState* wizard_state = (struct
> WizardControllerState*)user_data;
>
>
>
> new_or_open_view = NewOrOpenView_Create(
> shared_resources->handleImageNew,
> shared_resources->handleImageOpen,
> on_new_project_callback,
> on_open_project_callback,
> user_data
> );
> open_existing_view = OpenExistingProjectView_Create(
> shared_resources,
> NULL,
> on_next_from_open_project,
> on_previous_from_open_project,
> user_data
> );
> generation_view = GenerationView_Create(
> shared_resources,
> on_previous_from_generation_view,
> user_data
> );
>
> IupSetHandle("newOrOpenView", new_or_open_view);
> IupSetHandle("openExistingView", open_existing_view);
> IupSetHandle("generationView", generation_view);
>
>
> zbox_view = IupZbox(
> new_or_open_view,
> open_existing_view,
> generation_view,
> NULL
> );
>
> IupSetAttribute(zbox_view, "VALUE", "newOrOpenView");
>
> wizard_state->zBoxView = zbox_view;
>
> main_dialog = IupDialog(zbox_view);
>
> IupSetAttribute(main_dialog, "SHRINK", "YES");
> IupSetAttribute(zbox_view, "SHRINK", "YES");
>
>
>
> return main_dialog;
> }
>
> // returns the window (dialog) with the wizard
> void GenProjController_CreateWizard(struct SharedResources*
> shared_resources)
> {
> struct WizardControllerState* wizard_state =
> WizardControllerState_Create();
>
> Ihandle* wizard_window = GenProj_CreateWizardDialog(
> shared_resources,
> &OnNewProjectCallback,
> &OnOpenProjectCallback,
> &OnNextFromOpenProject,
> &OnPreviousFromOpenProject,
> &OnPreviousFromGenerationView,
> wizard_state
> );
>
> IupShowXY(wizard_window, IUP_CENTER, IUP_CENTER);
>
> }
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Iup-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
>
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users