Search Unity

eDriven Q&A

Discussion in 'Assets and Asset Store' started by dkozar, Aug 22, 2012.

  1. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Yes, there is the IncludeInLayout attribute, which must be turned OFF for other components to fill the remaining space.
     
  2. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Seriously thinking of releasing a beta (preview) version of eDriven.Gui v1.12 Free edition.

    (as you already know, I'm not yet finished with v1.12)

    The beta version would be buggy and not usable for production purposes, but at least you could give it a try and draw my attention to possible bugs too (v1.11 Free would remain available for download too).

    The reasoning behind this is as follows:

    The release cycle on the Asset Store is now around 2 weeks (and growing, because of too many assets in the store and too few people), meaning if I upload the new version now, it will most likely be tested by the Asset Store guys in a 2 weeks period, and then available for download.

    During this 2 weeks, if I solve a bug, I cannot re-upload the new version until the previous one is online, or I have to wait another 2 weeks to see this newest version online. :(

    However, the release cycle of a Free edition doesn't depend on the Asset Store, so I could upload a new version each day (well, in theory). :)

    What do you think? Vote on it! :)
     
    Last edited: Jun 17, 2013
  3. ScrappyRMH

    ScrappyRMH

    Joined:
    Apr 11, 2011
    Posts:
    48
    Tempting but I doubt i could test it. I'm using eDriven GUI for a production project that is on a tight schedule so I don't have time to maintain a separate code base. It's frustrating that the asset store has such a long delay because I would love to update to the new build to at eliminate the bugs in the Lists and ComboBoxes.
     
  4. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Yeah, with those I got too much into details, even made "scroll into view" method to show the selected item.

    btw didn't mention it, but although currently not fully working, the changes made with beta would be valid with the v1.12.
     
  5. lylenical

    lylenical

    Joined:
    Apr 28, 2013
    Posts:
    8
    the strange problem are still there

    do you have skype, i think it will be good for describing the problem

    when i loadlevel i use OnDestroy to remove the childs. but how to remove the audio. when i loadlevel a lot , there will be an exception

    Exception: Default mapper not defined
    eDriven.Audio.AudioPlayerMapper.GetDefault ()
    OptionsToolbar.Hide () (at Assets/eDriven/Demo/_shared/Code/Scripts/OptionsToolbar.cs:165)
    OptionsToolbar.OnDestroy () (at Assets/eDriven/Demo/_shared/Code/Scripts/OptionsToolbar.cs:139)
     

    Attached Files:

    Last edited: Jun 18, 2013
  6. lylenical

    lylenical

    Joined:
    Apr 28, 2013
    Posts:
    8
    is there an api to reset everything?
     
  7. lylenical

    lylenical

    Joined:
    Apr 28, 2013
    Posts:
    8
  8. ScrappyRMH

    ScrappyRMH

    Joined:
    Apr 11, 2011
    Posts:
    48
    I understand and would love to work with it but have have to post frequent updates of my app for the client and couldn't have the watermarks on there. Looking forward to the bug fixes and enhancements.
     
  9. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Hi,

    you should not destroy any eDriven.Gui component on your own (except the poped-up components).

    The problem you reported doesn't normally appear (check out the LoadLevel demo - nothing should persist on scene change).

    You should not use OnDestroy or similar - this is because eDriven.Gui uses Unity components (MonoBehaviours) as adapters only - by removing the adapters you don't remove the actual components: you must call the adapter methods for cleanup (adapter.RemoveAllChildren()).

    Please read the manual to learn how the API works.
     
  10. jaybennett

    jaybennett

    Joined:
    Jul 10, 2012
    Posts:
    165
    ....
     
    Last edited: Jun 24, 2013
  11. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Last edited: Jun 26, 2013
  12. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    I didn't test it on mobiles yet. But it was said in this thread that the FPS drop in mobiles is massive comparing to NGUI.

    If this is true, do you have any plans to make it run better?
     
  13. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440

    I was a big champion of eDriven until I moved on. I don't even bother about eDriven anymore since I apologized about the issue to the NGUI vendor and deleted all my posts on eDriven thread.


    For US$250 you should start looking seriously at NGUI or ScaleForm or Neosis or CoherentUI. At least, they make a decent effort to make their product work with Mobile long before Unity3D made their iOS and Android versions free.


    BTW, we are going forward with Chinese, Russian, French, German, Portuguese translation of the GUI with no loss of speed nor quality concerns.
     
  14. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Hi,

    Yes, the FPS is bad for mobile since it's built upon a subset of UnityGUI. But these two frameworks cover quite a different genres. I often recommend a framework like NGUI or EZGUI for 3D rendering.

    eDriven.Gui uses the latest official version of Unity's GUI. When the "New new GUI" is released, I'll sure check it out and see if there's a possibility to wrap around it and make a second renderer. Yes, I'd love to have a faster low-level system to work with, for you guys having a better performance.

    As for the 3D plans: nothing official, but did some initial tests with a 3D GUI renderer (just a proof of concept) and it works (using Unity Basic, draw to texture not used). eDriven input is decoupled from actual components, so it would work the same using the raycast/ray in 3D, as with a mouse in 2D. But there are other priorities to work on before event thinking about it.
     
    Last edited: Jun 27, 2013
  15. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Sorry to hear that. You seem to be very passionate about everything you're doing (and saying).

    I have nothing against the critique, so no need to delete any comments regarding this system *ever*.

    As I already said, there are many genres of GUI systems/usages and a single system couldn't cover it all. So, you guys are free to choose anything from the available GUI frameworks.
     
  16. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440

    This is basic 2D screen GUI, not even 3D screens. The benefits of your GUI system are void. Anyone who buys your product will eventually have to abandon it due to performance issues like what you said.


    This seems to be eDriven issues because the same GUI using Unity3D is faster performance. Your competitors do not suffer from the dramatic slowdown on Mobile, like what your product has.


    If you gave a source-code option, it would be very easy to find out and assist you on the slowness errors. Your competitors gave a source-code option, so it was easy to profile, find and spot errors. They even made effort to fix errors on Android and on iOS by themselves.




    I do not know what they did, but they emulated the Edit, ComboBox, ListView, GridView controls quite well.

     
  17. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Luckily, all these claims could be easily checked with this web player demo or trying out the Free Edition.

    Also, I've had only 2 refunds in a year, people seem to like it.
     
  18. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440

    With non-existent terrain, no NPC, no enemies, no character controller on the scene, of course it is very fast.


    Anyway, I will post mine and with eDriven vs. ScaleForm vs. NGUI and others.
     
  19. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    Before we start, let us agree on two things:


    1) This is a professional discussion about your product, this is based on facts and peer review, using the latest version of your product, NGUI latest and ScaleForm latest.


    2) This is not a mud slinging nor insulting fight between two people. I believe you are grown-up enough to fix bugs in your own product, not go down into race, religion and any low-blow insults and try to resolve issues.


    Can we agree upon this and be civil and respectful?
    In the next few days I'll get the older projects and migrate it to the latest assets to compare FPS and DrawCalls issue. I hope you would fix them since buying something that causes huge FPS drop is not normal.
     
  20. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Well, why don't you test all the frameworks within the same testing conditions?

    Here's what you said about the UnityGUI:

    You never mentioned the heavy 3D scene. Seems like you're biased, and when you're biased you're very passionate about it. :)
     
  21. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440

    I archived the older project. The older project contains codes specific to your eDriven project. I guess it's time it to upgrade it. There are serious issues with your product that other products have do not have the same problems.
     
  22. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    "civil and respectfull"?

    It could be easily checked that I've never used any harsh word on anyone or any product on the forum. Even avoiding making comparisons, as well as not hiding anything about eDriven.

    Actually I've given multiple recommendations on competitive systems when seeing them better fitting than eDriven.

    So, I'm not interested in pro-wrestling, neither pro-trolling. And yes, we can bot agree that if this crosses the "respectful" line and becomes the thread hijacking, I will for sure consult the forum admin (for the 1st time).
     
  23. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Just found an old eDriven recommendation.

    $eskimojoe_on_edriven.png
     
  24. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    I used to recommend your product since everything else was not so good. You used to have that data loss bug (which you later fixed, but I lost work) and serious FPS issues.


    Your competitors catching up and fixing errors in their products, I moved on.
     
  25. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Introducing eDriven.Gui 1.12 features with a short video.



    Note: this version has not yet been released (the current Asset Store version is 1.11).

    Hoping more tutorials will follow soon (as soon as I finish the 1.12 version).

    Cheers!
     
  26. ScrappyRMH

    ScrappyRMH

    Joined:
    Apr 11, 2011
    Posts:
    48
    Looks great! Can't wait for this to be released. Looks like it will make development go a lot faster since i don't have to rely on moving and renaming components to get the order I want. Also hoping it resolves the issues with lists incorrectly disabling items.
     
  27. eventropy

    eventropy

    Joined:
    Oct 4, 2012
    Posts:
    255
    Hey dkozar
    New version looks great from the video, looking forward to its release!

    Couple of questions:
    1) Is it possible to create an Image with a tileable background? As far as I can tell there is just a Texture property.
    2) Can you talk a bit about when it is appropriate to use the designer and when it is appropriate to write your GUI entirely in code? It seems like you mostly have to go either one way or the other.
     
    Last edited: Jul 1, 2013
  28. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Thanks! :)
    That was the whole idea. :)

    Other systems seem to rely on game object naming for getting them in order.

    I wanted to do it properly - without compromises - so I had to implement my own order information handling and persisting (since Unity itself doesn't mind the ordering information). I had to as well come up with some user interface that will accomplish this. I hope you like the new order panel - it was completely my idea, never seen anything like it (this type of multi-list interface) yet.

    Now, imagine this used for rearranging DataGrid column renderers in the future.. ;)
     
    Last edited: Jul 1, 2013
  29. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Thanks! :)

    As long as you don't generate it on the fly (an expensive process), not possible with UnityGUI (eDriven.Gui is currently build on top of it).

    Not at all. You should always tend to make components that could be easily adapter for a designer. That is a good practice.

    I mean, you should always develop your components the way some other person might use it (both ways - code or designer).

    I'm planning to make a video on developing custom components, where I would explain writing the Adapter class and Editor class (which are needed to display the component in the Toolbox, and which enables the component to be dropped onto the stage and dance with other components). :)

    However, if you are building something in-house and high performance - then you just might go the C# way. I have to admit that until recently I was a big fan of a code-only approach - never knew that I would be able to make a designer system that is so performance friendly. So today I'm thinking in terms of building components for other people, which is pretty easy because there are only 2 tiny classes needed so the components are available for other users (even beginners) to work with.

    These 2 systems are pretty connected - C# gives the power and flexibility. In 1.12 you will also be able to change your component code on-the-fly (while running) and the application will recompile reload with new components as nothing happened. :)
     
  30. eventropy

    eventropy

    Joined:
    Oct 4, 2012
    Posts:
    255
    I see. I will have to wait for the custom component video then. Then again, if version 1.12 allows changing gui code on the fly and seeing the results immediately during runtime then I think the code-only approach would be enough for me.

    Are you sure? The following code achieves that using Unity GUI:

    Code (csharp):
    1.  
    2.  
    3. public class Test : MonoBehaviour
    4. {
    5.     public Texture backgroundTexture;
    6.  
    7.     void OnGUI()
    8.     {
    9.         var screenBounds = new Rect(0, 0, Screen.width, Screen.height);
    10.         backgroundTexture.wrapMode = TextureWrapMode.Repeat;
    11.         GUI.DrawTextureWithTexCoords(screenBounds, backgroundTexture, new Rect(0, 0, screenBounds.width / backgroundTexture.width, screenBounds.height / backgroundTexture.height));
    12.     }
    13. }
    14.  
    15.  
    Thanks for the help
     
  31. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Cool, I should check it ASAP! I had problems with it before, maybe they are now fixed (perhaps it doesn't work with the "GUI" mode of the texture exporter).
     
  32. eventropy

    eventropy

    Joined:
    Oct 4, 2012
    Posts:
    255
    Hey Danko
    Another question: I'm unable to get mouse wheel events to trigger in the following code. Any idea why?

    Code (csharp):
    1.  
    2.  
    3. public class Test : Gui
    4. {
    5.     protected override void OnInitialize()
    6.     {
    7.         base.OnInitialize();
    8.  
    9.         Stage.PercentWidth = 100;
    10.         Stage.PercentHeight = 100;
    11.     }
    12.  
    13.     protected override void CreateChildren()
    14.     {
    15.         base.CreateChildren();
    16.  
    17.         var box = new Box
    18.         {
    19.             PercentWidth = 100,
    20.                          PercentHeight = 100,
    21.         };
    22.         box.BackgroundColor = Color.cyan;
    23.         box.SetStyle("showBackground", true);
    24.         box.FocusEnabled = true;
    25.         box.KeyDown += OnKeyDown;
    26.         box.MouseWheel += OnMouseWheel;
    27.  
    28.         AddChild(box);
    29.     }
    30.  
    31.     void OnKeyDown(Event evt)
    32.     {
    33.         Debug.Log("Pressed a key");
    34.     }
    35.  
    36.     void OnMouseWheel(Event evt)
    37.     {
    38.         // This never fires:
    39.         Debug.Log("Detected mouse wheel");
    40.     }
    41. }
    42.  
    43.  
     
  33. jrahhali

    jrahhali

    Joined:
    Jun 3, 2013
    Posts:
    11
    Hi dkozar,

    I have an HBox container. I've set it to use a StyleMapper that I've defined a custom GUISkin for.

    In the GUISkin I've set the following:

    Normal : black background
    Active: red background
    Focus : red background

    I have set the FocusEnabled property on the HBox to true.

    Here is my problem. When I click the HBox, it turns red. When I MouseOut of the HBox, it turns back to black. It should stay red, since it is both active and focused. Is there a property that I am missing somewhere?

    edit: Also, is there any way to set the color of a label's Text in code?
     
    Last edited: Jul 4, 2013
  34. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Hi,

    sorry for the late response (internet problems).

    Containers have disabled mouse interaction by default (MouseEnabled = false). This is because the clicking on (transparent) container shouldn't stop the mouse event from propagating to components behind it.

    You just have to set:

    Code (csharp):
    1. myContainer.MouseEnabled = true;
    I see you've set FocusEnabled set to true, which is good. Just as a note for other users: you must set this to true if you want the component to dispatch keyboard events (keyboard events are being dispatched from the component in focus).
     
  35. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    You've found a bug! :)

    Just looked at the code and it seems I'm not using the focus and mouse-down information properly for containers (also for some of the components).

    I fixed it, so from the next eDriven.Gui version it will work as expected (using all the 8 states of your GUIStyle).

    Yes. If you want to change component colors programatically, do it with tinting. Each component has a Color property, which is basically a tint.

    It also has ContentColor and BackgroundColor.

    Make your text color white (GUIStyle.normal.textColor) and the label will have the exact color you've set using the Color property.
     
  36. jrahhali

    jrahhali

    Joined:
    Jun 3, 2013
    Posts:
    11
    Thanks for the last reply.

    Have another question for you. Can you give an example of how to set the style of scroll bars? I have an HBox that I'm trying to use custom scroll bar textures with.

    Played around with a ContainerStyleMapper, HorizontalScrollbarStyleName property and VerticalScrollbarStyleName, but to no avail.
     
  37. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    The container uses the scrollbar styles defined in the skin. So set those in the skin you are using in container, using the UnityGUI styling rules.
     
  38. jrahhali

    jrahhali

    Joined:
    Jun 3, 2013
    Posts:
    11
    I have three questions related to the SetStyle() method:

    Code (csharp):
    1.  
    2. public void SetStyle(
    3.     string styleName,
    4.     Object style
    5. )\
    I did I search through all the demos, and I came up with these styleNames:

    • "showBackground"
    • "labelStyle"
    • "showEffect"
    • "addedEffect"
    • "imageStyle"
    • "cursor"
    • "buttonStyle"
    • "showOverlay"
    • "backgroundStyle"
    • "labelStyle"
    • "removedEffect"


    Is there a list of all styleNames somewhere and their associated object?

    Is a ProgrammaticStyle equivalent to a StyleMapper hooked up to a GUISkin?

    When would I use, say, "labelStyle" (etc.) vs. "backgroundStyle"?

    Thanks in advance.
     
    Last edited: Jul 8, 2013
  39. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Hi,

    StyleMapper is nothing but a sequence of commands for setting styles.

    For instance, for a button you could do this:

    Code (csharp):
    1. button.SetStyle("overlayStyle", yourOverlayStyle);
    2. button.SetStyle("showOverlay", true);
    3. button.SetStyle("buttonStyle", yourButtonStyle);
    However, for being able to do the same thing from the editor, there are style mappers.

    Style mapper has the corresponding property name, with the difference that the first letter is capitalized. So the ButtonStyleMapper has properties:

    Code (csharp):
    1. OverlayStyle (GUIStyle)
    2. ShowOverlay (boolean)
    3. ButtonStyle (GUIStyle)
    Now, since the value type for each value is different and SetStyle method is used for supplying pretty much everything (GUIStyle, GUISkin, boolean, tween, another style mapper name...), the second argument of SetStyle is typed to object. This is why you could set anything from code, but it won't necessary work - so you should know what's the expected value type.

    Yes, I should really make a list of all the available styles.

    Basically, the styles are being inherited - for example, the basic component has the 1) overlay style and 2) disabled overlay style. So has the button, plus - it adds its own stuff there.

    Containers introduce background styles (the style used for rendering the container background).

    You could set the OveralSkin for all the style definitions within a single mapper, or you could customize skin per style definition (BackgroundStyle->Skin etc.)

    As for the ProgrammaticStyle: this is my internal texture builder system for creating a default ("hardcoded") component graphics. These are never being run for components having the graphics defined using the style mapper; this is just a fallback - so component never break because of the non-existing GUISkin/GUIStyle.

    It's basically a class used for configuring GUIStyle (it's textures). It is used this way (this is a button example):

    Code (csharp):
    1. GUIStyle style = new GUIStyle();
    2. style.name = "ButtonStyle"; // optional
    3. style.font = FontMapper.GetDefault().Font;
    4.  
    5. ProgramaticStyle ps = new ProgramaticStyle
    6. {
    7.     Font = FontMapper.GetDefault().Font,
    8.     Style = style, // referencing the GUIStyle to work with
    9.     Alignment = TextAnchor.MiddleCenter,
    10.     Padding = new RectOffset(6, 6, 3, 3)
    11. };
    12.  
    13. const int w = (Weight + 1) * 2;
    14.  
    15. ps.Border = new RectOffset(Weight + 1, Weight + 1, Weight + 1, Weight + 1);
    16.  
    17. ps.NormalTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
    18. ps.NormalGraphics = new Rect(w, w,
    19.                              new Fill(RgbColor.FromHex(0xC0C0C0).ToColor()),
    20.                              new Stroke(RgbColor.FromHex(0x404040).ToColor(), Weight)
    21. );
    22. ps.HoverTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
    23. ps.HoverGraphics = new Rect(w, w,
    24.                             new Fill(new Color(1f, 1f, 1f, 1f)),
    25.                             new Stroke(Color.grey, Weight)
    26. );
    27. ps.ActiveTextColor = new Color(0.1f, 0.1f, 0.1f, 1);
    28. ps.ActiveGraphics = new Rect(w, w,
    29.                              new Fill(RgbColor.FromHex(0x808080).ToColor()),
    30.                              new Stroke(RgbColor.FromHex(0xD3D3D3).ToColor(), Weight)
    31. );
    32.  
    33. ps.OnNormalTextColor = Color.white;
    34. ps.OnNormalGraphics = new Rect(w, w,
    35.                                new Fill(RgbColor.FromHex(0x808080).ToColor()),
    36.                                new Stroke(RgbColor.FromHex(0xD3D3D3).ToColor(), Weight)
    37. );
    38.  
    39. ps.Validate(); // this command applies the graphics to a style
    Note the usings:

    Code (csharp):
    1. using eDriven.Gui.Mappers;
    2. using eDriven.Gui.Components;
    3. using eDriven.Gui.Graphics.Base;
    4. using eDriven.Gui.Util;
    5. using UnityEngine;
    6. using Rect=eDriven.Gui.Graphics.Rect;
    So, the Rect class used here is not the Unity Rect class. This is an eDriven class used for drawing a Rect into a texture. There are also other graphical classes in the eDriven.Gui.Graphics package (like Ellipse) that you could draw with.

    Tip: what I do is I use singletons for each programmatic generated style. So I have a ButtonStyle singleton, which is then being referenced by all the buttons (not having the style defined via the style mapper) - this ensures the style is generated only once during the application lifetime.
     
  40. jrahhali

    jrahhali

    Joined:
    Jun 3, 2013
    Posts:
    11
    I've tried the original code, verbatim, that eventropy posted with the MouseEnabled = true (like you suggested), but MouseWheel events are still not firing. Anything else that you can think of that might be the problem?

    By the way, thanks for the very informative reply on the SetStyle() method. Much appreciated.
     
  41. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    It could be because there is the StopMouseWheelPropagation set to true somewhere on the ancestor (container).

    Additionally, you can subscribe directly to MouseEventDispatcher:

    Code (csharp):
    1. MouseEventDispatcher.Instance.AddEventListener(MouseEvent.MOUSE_WHEEL, OnMouseWheel);
    In your handler you can Debug.Log the e.Target so you can actually see what's actually been mouse-wheeled.

    Your handler will fire before the handler added to the component, because what MouseEventDispatcher does is it first dispatches the event putting itself as a target, allowing you to cancel the event, so it won't be dispatched from the component.

    It serves as a central place for event cancellation in the application.

    One more thing. The event could be catched even sooner, subscribing to SystemEventDispatcher:

    Code (csharp):
    1. SystemEventDispatcher.Instance.AddEventListener(MouseEvent.MOUSE_WHEEL, OnMouseWheel);
    Note that this is the 'raw' event, containing only the global (screen) coordinates. If you want the local (component) coordinates, you should subscribe to MouseEventDispatcher or the component itself.

    So, this is the event flow:

    SystemEventDispatcher (dispatches the event with global position)
    |
    |
    MouseEventDispatcher (adds the local position; if event canceled in the handler, the process stops here)
    |
    |
    component
     
  42. vincgoh

    vincgoh

    Joined:
    Jan 8, 2013
    Posts:
    5
    Hi,

    I am trying the free version 1.11. Going through the FormDemo2, if I increased the item text in the dropdown for combo3, the horizontal scrollbar appear. But I can not scroll horizontally. Is this a bug?

    Code (csharp):
    1.  
    2.         ComboBox cb3 = new ComboBox
    3.         {
    4.             Width = 300,
    5.             //PercentWidth = 100,
    6.         MaxWidth = 300,
    7.             MaxPopupHeight = 200,
    8.            
    9.             DataProvider = new List<object>
    10.                                                  {
    11.                                                      new ListItem("Back", "Back"),
    12.                                                      new ListItem("Bounce", "Bounce"),
    13.                                                      new ListItem("Circ", "Circ"),
    14.                                                      new ListItem("Cubic", "Cubic"),
    15.                                                      new ListItem("Elastic", "Elastic"),
    16.                                                      new ListItem("Expo", "Expo"),
    17.                                                      new ListItem("Linear", "Linear"),
    18.                                                      new ListItem("Quad", "Quad"),
    19.                                                      new ListItem("Quart", "Quart Quart Quart Quart Quart Quart Quart Quart Quart Quart Quart Quart Quart"),
    20.                                                      new ListItem("Quint", "Quint"),
    21.                                                      new ListItem("Sine", "Sine")
    22.                                                  }
    23.         };
    24.         form.AddField("combo3", "Combo 3:", cb3);
    25.  
     
  43. jrahhali

    jrahhali

    Joined:
    Jun 3, 2013
    Posts:
    11
    Actually, setting
    Code (csharp):
    1. StopMouseWheelPropagation = true
    allowed the MouseWheel event to fire, and setting
    Code (csharp):
    1. StopMouseWheelPropagation = false
    prevented the event from firing. False seemed to be the default. Logically, it seems like the true/false values should be the other way around.

    In any case, MouseWheel events are firing with StopMouseWheelPropagation set to true. Thanks dkozar.
     
  44. eventropy

    eventropy

    Joined:
    Oct 4, 2012
    Posts:
    255
    Hi Danko
    I'm trying to create a control that resizes to match it's parent size, but does not resize to match the size of its children components. But it seems that if I set the width and height using PercentWidth and PercentHeight then it always expands to fit child content. See example below:
    Code (csharp):
    1.  
    2.     public class MiscEdrivenGui : Gui
    3.     {
    4.         protected override void CreateChildren()
    5.         {
    6.             base.CreateChildren();
    7.  
    8.             var mainBox = new Box
    9.             {
    10.                 LayoutDescriptor = eDriven.Gui.Layout.LayoutDescriptor.Absolute,
    11.                 BackgroundColor = Color.yellow,
    12.                 Width = 800,
    13.                 Height = 800,
    14.             };
    15.             mainBox.SetStyle("showBackground", true);
    16.  
    17.             var subBox = new Box
    18.             {
    19.                 LayoutDescriptor = eDriven.Gui.Layout.LayoutDescriptor.Absolute,
    20.                 BackgroundColor = Color.red,
    21.  
    22.                 // This doesn't work
    23.                 //PercentWidth = 100,
    24.                 //PercentHeight = 100,
    25.  
    26.                 // Whereas this does:
    27.                 Width = 800,
    28.                 Height = 800,
    29.             };
    30.             subBox.SetStyle("showBackground", true);
    31.             PopulateBox(subBox);
    32.  
    33.             mainBox.AddChild(subBox);
    34.             AddChild(mainBox);
    35.         }
    36.  
    37.         void PopulateBox(Box main)
    38.         {
    39.             var lbl = new Label
    40.             {
    41.                 Text = "THIS IS THE BOTTOM LEFT CORNER!",
    42.                 Bottom = 0,
    43.                 Left = 0,
    44.             };
    45.             main.AddChild(lbl);
    46.  
    47.             var largeChild = new Box
    48.             {
    49.                 Width = 1024,
    50.                 Height = 1024,
    51.             };
    52.  
    53.             main.AddChild(largeChild);
    54.         }
    55.     }
    56.  
     
  45. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    For the percentages to work, you must have a BoxLayout (horizontal, vertical) set on your parent.

    AbsoluteLayout respects only the fixed coordinates (X, Y) as well as constrains (Left, Right...).
     
  46. Fabre

    Fabre

    Joined:
    Mar 4, 2013
    Posts:
    7
    Hi, I've bought the eDrivenGui, however I have problems to update the data, just like images in imageAdapters, comboBox itens and ListItens. Cuold you send an exemple updating data by the correct way?
     
  47. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Hi and welcome!

    I believe your questions are related to designer.

    In designer, you need to use the ComponentInstantiated handler in the attached script to get a reference to the component (not adapter but the real component).

    When you got the reference, you can alter the component properties like the Texture of the image or DataProvider of a combo box.

    Additionally, for a combo or a list control, you might attach data provider components from the menu.

    Please examine the eDriven manual for more details.
     
  48. jrahhali

    jrahhali

    Joined:
    Jun 3, 2013
    Posts:
    11
    Hi dkozar,

    I was just wondering what the difference between a child and content child is? Functions such as AddChild() vs AddContentChild()?
     
  49. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    With eDriven, containers can have children, but inside of the separate child groups. These are actually sub-containers.

    For instance, a Panel has 2 child groups:
    1) ContentGroup
    2) Tools

    Dialog has 3 child groups:
    1) ContentGroup
    2) Tools
    3) ButtonGroup

    All the mentioned groups are created at the construction time (so not lazily!) and are available at the configuration time:

    Code (csharp):
    1. Panel p = new Panel();
    2. p.ContentGroup.AddChild(button);
    ContentX methods are just the convenience thing for handling children inside the ContentGroup.

    So, these 2 actions are the same:
    1) panel.ContentGroup.AddChild(button);
    2) panel.AddContentChild(button);

    Note: the basic Container also has ContentX methods but they map to normal Child manipulation methods:

    container.ContentChildren is the same as container.Children
     
    Last edited: Jul 13, 2013
  50. jaybennett

    jaybennett

    Joined:
    Jul 10, 2012
    Posts:
    165
    Hey Danko,

    I'm having an issue with the List class. Here is the code:

    Code (csharp):
    1.  
    2.  
    3.         // the property i set
    4.         private bool hotspotListChanged;
    5.         private List<object> hotspotList; // this is a list of ListItems
    6.         public List<object> HotspotList
    7.         {
    8.             get
    9.             {
    10.                 return hotspotList;
    11.             }
    12.             set
    13.             {
    14.                 hotspotListChanged = true;
    15.                 hotspotList = value;
    16.                 Debug.Log("FocusPatientPanel HotspotList Changed");
    17.                 InvalidateProperties();
    18.             }
    19.         }
    20.  
    21.         List hotspotBox; // this is my display list
    22.  
    23.         protected override void CreateChildren()
    24.         {
    25.             /// ....
    26.  
    27.             hotspotBox = new List()
    28.             {
    29.             };
    30.         }
    31.  
    32.         protected override void CommitProperties()
    33.         {
    34.             base.CommitProperties();
    35.  
    36.             if (hotspotListChanged)
    37.             {
    38.                 hotspotListChanged = false;
    39.                 hotspotBox.DataProvider = hotspotList;
    40.                 hotspotBox.RequireSelection = true;
    41.                 hotspotBox.SelectedIndex = 1;  // also tried 0              
    42.             }
    43.         }  
    44.  
    My issue is that the first item in the list cannot be selected by mouse. I can select it only if I select the second item and then use the keyboard to go UP + ENTER.

    I tried with and without requireselection // selectionindex. With those lines, I will automatically select the first item. But after I click the second item, I can't click the first item again.

    I tried mouseEnabled = true without any luck.

    This happens only to the first item in the list, no matter how long the list is.

    Any ideas what might be happening?

    EDIT: Also, occassionally this list will become very small (like 50x50) even though I set minwidth and minheight.
     
    Last edited: Jul 15, 2013