The "SignInForm" UIID doesn't appear to be picked up. Note: If you
comment out that line, it works fine.
setUIID("SignInForm");
So double check and make sure that you are working with the same theme file
- and that the SignInForm UIID is registered in that theme file.
Steve
On Thu, Mar 22, 2018 at 9:40 PM, Thomas <[email protected]> wrote:
> I am using the new GUI builder to create a Login Form. In the GUI builder
> preview, everything looks fine and correctly reflect the constraint and
> components properties I defined in the GUI builder. But when launching the
> similator, my layout is a complete mess and even show components that are
> not even part of this form (like the "SIGN IN" button that is actually a
> buton part of the previously displayed form. See picture below).
> Here is the code of my login form:
>
>
> public class Login extends com.codename1.ui.Form {
>
> public Login() {
> this(com.codename1.ui.util.Resources.getGlobalResources());
> }
>
> public Login(com.codename1.ui.util.Resources resourceObjectInstance) {
> initGuiBuilderComponents(resourceObjectInstance);
> }
>
> //-- DON'T EDIT BELOW THIS LINE!!!
> private com.codename1.ui.TextField gui_Email = new
> com.codename1.ui.TextField();
> private com.codename1.ui.TextField gui_Password = new
> com.codename1.ui.TextField();
> private com.codename1.ui.Button gui_LoginButton = new
> com.codename1.ui.Button();
>
>
> // <editor-fold defaultstate="collapsed" desc="Generated Code">
>
> private void initGuiBuilderComponents(com.codename1.ui.util.Resources
> resourceObjectInstance) {
> setLayout(new com.codename1.ui.layouts.LayeredLayout());
> setInlineStylesTheme(resourceObjectInstance);
> setScrollableY(false);
> setUIID("SignInForm");
> setInlineStylesTheme(resourceObjectInstance);
> setInlineAllStyles("alignment:center;");
> setTitle("Sign In");
> setName("Login");
> addComponent(gui_Email);
> addComponent(gui_Password);
> addComponent(gui_LoginButton);
> gui_Email.setHint("Email");
> gui_Email.setUIID("SignInEmail");
> gui_Email.setInlineStylesTheme(resourceObjectInstance);
> gui_Email.setName("Email");
> gui_Email.setRows(1);
> ((com.codename1.ui.layouts.LayeredLayout)gui_Email.
> getParent().getLayout()).setInsets(gui_Email, "5.0mm 5.0mm auto 5.0mm").
> setReferenceComponents(gui_Email, "-1 -1 -1
> -1").setReferencePositions(gui_Email,
> "0.0 0.0 0.0 0.0");
> gui_Password.setHint("Password");
> gui_Password.setUIID("SignInPassword");
> gui_Password.setInlineStylesTheme(resourceObjectInstance);
> gui_Password.setName("Password");
> gui_Password.setRows(1);
> ((com.codename1.ui.layouts.LayeredLayout)gui_Password.
> getParent().getLayout()).setInsets(gui_Password, "5.0mm 0.0mm auto
> 0.0mm").setReferenceComponents(gui_Password, "0 0 -1 0
> ").setReferencePositions(gui_Password, "1.0 0.0 0.0 0.0");
> gui_LoginButton.setText("Login");
> gui_LoginButton.setInlineStylesTheme(
> resourceObjectInstance);
> gui_LoginButton.setName("LoginButton");
> ((com.codename1.ui.layouts.LayeredLayout)gui_LoginButton.
> getParent().getLayout()).setInsets(gui_LoginButton, "10.0mm 5.0mm auto
> 5.0mm").setReferenceComponents(gui_LoginButton, "1 -1 -1
> -1").setReferencePositions(gui_LoginButton, "1.0 0.0 0.0 0.0");
> }// </editor-fold>
>
> //-- DON'T EDIT ABOVE THIS LINE!!!
> }
>
> And here is what I obtain in the simulator:
>
>
> <https://lh3.googleusercontent.com/-jPYYnGDTY1c/WrR_AC2z-iI/AAAAAAAAABU/SCYjF9wOVKENsS9EVpX331zuBBSrG-NBgCLcBGAs/s1600/cn1_simulator_issue1.png>
>
> And when I take a screenshot of the simulator, the display change and here
> is what I obtain:
>
>
> <https://lh3.googleusercontent.com/-lkx3iNdFy1Q/WrR_1lqO0-I/AAAAAAAAABc/pxhNZYZbRt0vHzl0060R4lexRmV9k_yogCLcBGAs/s1600/cn1_simulator_issue2.png>
>
> (Still not the correct result as the background is black rather than white
> but at least the layout seems ok. Too bad I have to take a screenshot for
> the simulator to reflect the layout of my code though...)
>
> What can be the orgin of this issue and how can I fix it? (as, as it is,
> the simulator is just unusable for me now...).
> Maybe I am not correctly navigating from my previous Form from this one (I
> am new to CN1 and had difficulties finding a tutorial showing navigation
> examples. The only "how to" CN1 video on navigation is based on the old GUI
> builder and do not show any code for navigating from one Form to another)?
> Here is how I open this new Form from an onpress action event on a previous
> Form button:
>
> public void onSignInButtonActionEvent(com.codename1.ui.events.ActionEvent
> ev) {
> Form loginf = new Login();
> loginf.show();
> }
>
>
> I tested in Eclipse and Netbeans but the result is the same with both
> plugins. And I a made a clean/rebuild of my project with no effect. Also
> updated my java JDK from JDK 8_181 to JDK 10 but did not change anything.
> I am on Windows 10 OS.
>
> --
> You received this message because you are subscribed to the Google Groups
> "CodenameOne Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> Visit this group at https://groups.google.com/
> group/codenameone-discussions.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/codenameone-discussions/69caa71a-411b-4f59-86d1-
> a191acd29a82%40googlegroups.com
> <https://groups.google.com/d/msgid/codenameone-discussions/69caa71a-411b-4f59-86d1-a191acd29a82%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Steve Hannah
Software Developer
Codename One
http://www.codenameone.com
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/CAGOYrKVKbT0jifJ3RRQ%2BfaZHLa2zEB_AZ4AO2MQZiaqeJCcStg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.