Share My Creation b4j myMenuEditor

Discussion in 'B4J Share Your Creations' started by Knoppi, Aug 28, 2017.

  1. Knoppi

    Knoppi Active Member Licensed User

    b4j myMenuEditor

    inspired by derez menu-designer
    https://www.b4x.com/android/forum/threads/menu-designer.56853/

    This is my Version of a Menu Editor

    myMenuEditor_1.05.073.png

    + Load Menus in Json-Format
    + Save Menus in Json-Format
    + Recent Files
    + full movable Menu-Items
    + (up, down) (left, right)
    + seperator ("-")
    + Select and view of Images
    + 'Copy Icons to DirAssets' Function
    + Checked with State
    + Enabled with State
    + Menu-Items Insert and Delete
    + 'Copy Menu to Clipboard' Function
    + Shortcuts:
    CONTROL+ENTER = Item Append
    CONTROL+NUMPAD2 = Item Down
    CONTROL+NUMPAD4 = Item Left
    CONTROL+NUMPAD6 = Item Right
    CONTROL+NUMPAD8 = Item Up

    Knowing Bugs:
    • Only Json Files with Long '{Text:"File")' Map-Variant
      The short one (simple string) "File" crashed the App.
    • please insert "-" (Separator) at last
    in the Future:
    + Code Generator for Menu-Events
    + Test Menu

    New Version 5.087
    • I Change the Design of GUI a little bit (fixed problems with the internal Events)
    • Delete the Autofill Option (for the moment)
     

    Attached Files:

    Last edited: Mar 11, 2018
    Cableguy, ThRuST, Mashiane and 10 others like this.
  2. Knoppi

    Knoppi Active Member Licensed User

    New Version 1.05.081 (in Post #1)

    Remove a bug with the 'Copy Icons to DirAssets' Function
    Add 'Show Json-Menu'

    Please test the app, and post if there is any error

    i will share the code when the app is error free
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    It looks very nice and useful.
     
  4. Knoppi

    Knoppi Active Member Licensed User

    New Version 1.05.082 (in Post #1)

    Now you can import menus with the 'File Insert' Function.

    It's possible to save separate menus for 'File', 'Edit', 'View', 'Help', etc and put it together in your choice.
     
  5. DMW

    DMW Member Licensed User

    Thank You very much for this tool! It will save time for me.
     
  6. Mashiane

    Mashiane Expert Licensed User

    Add a button to add a separator as a menu item. #just a thought.
     
  7. Knoppi

    Knoppi Active Member Licensed User

    You can add a seperator, just only type - in the Text Field and press 'Append' after that you can move it to the position of your choice.
     
    Mashiane likes this.
  8. ThRuST

    ThRuST Well-Known Member Licensed User

    Is v105 082 compatible with Java 901? A simple menu generated this error. Dunno about everybody else. Please comment.

    Code:
    [
        {
    "Text":"Test","Tag":"MyTest1","EventName":"TestSub","Image":"Icon_Notebook.png"}
    ]
    Error log
     
  9. Knoppi

    Knoppi Active Member Licensed User

    is this a main level menu?
    if so, then it is not possible to specify a picture,
    the app does not recognize this at the moment.

    please try
     
    ThRuST likes this.
  10. ThRuST

    ThRuST Well-Known Member Licensed User

    Thanks I will try your editor again since it seems very good. I just added a simple menu just to try it and that's when the error occured, sorry I am new to the JSON script so I problably made a simple misstake, but you should display a Fx.MsgBox(MainForm, "Notification message", Title") after checking if "Image" exists as the main menu level to avoid such confusion. I tried out Derez menu designer and it seems really good too and I got it to work after reading the Menubar tutorial by Erel.
     
  11. Knoppi

    Knoppi Active Member Licensed User

    i will fixed it in the next version (end of january) with some other bugs
     
    ThRuST likes this.
  12. ThRuST

    ThRuST Well-Known Member Licensed User

    Awesome, looking forward to try the new version, and a Happy New Year 2018
     
  13. PatrikCavina

    PatrikCavina Member Licensed User

    I added other icons in icons folder and i added them to menu items, now when i click "Copy Icons To Dir Asserts..." program crashes.
    So i remove all icons i've added, but problem persist.
    I think the possibility to add other icons would be interesting.
    Anyways very useful tool.
     
  14. Knoppi

    Knoppi Active Member Licensed User

    I am writing the program partly new.

    You Add the icons to C:\Users\YOURNAME\AppData\Roaming\MyMenuEditor\Icons ?
    I will check this next week.
     
    Last edited: Mar 10, 2018
  15. PatrikCavina

    PatrikCavina Member Licensed User

    Exactly.
    To be more specific: the crash happens when I add a new icon to a child element and try to use the "Copy Icons to Dir Asserts" function.
    After first crash, if i add item with icon and i try to use "Copy Icons ...", i receive this error:
    Code:
    java.lang.IllegalArgumentException: Folder parameter must be a valid folder
            at com.sun.glass.ui.CommonDialogs.convertFolder(CommonDialogs.java:
    238)
            at com.sun.glass.ui.CommonDialogs.showFolderChooser(CommonDialogs.java:
    226)
            at com.sun.javafx.tk.quantum.QuantumToolkit.showDirectoryChooser(QuantumToolkit.java:
    1534)
            at javafx.stage.DirectoryChooser.showDialog(
    DirectoryChooser.java:103)
            at anywheresoftware.b4j.objects.DirectoryChooserWrapper.Show(DirectoryChooserWrapper.java:
    43)
            at ths.mymenueditor.main._getfolderfromdirchooser(main.java:
    1090)
            at ths.mymenueditor.main._mnumain_action(main.java:
    1563)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
    62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
    43)
            at java.lang.reflect.Method.invoke(Method.java:
    498)
            at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    90)
            at anywheresoftware.b4a.BA$
    1.run(BA.java:215)
            at com.sun.javafx.application.PlatformImpl.lambda$
    null$172(PlatformImpl.java:295)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sun.javafx.application.PlatformImpl.lambda$runLater$
    173(PlatformImpl.java:294)
            at com.sun.glass.ui.InvokeLaterDispatcher$
    Future.run(InvokeLaterDispatcher.java:95)
            at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
            at com.sun.glass.ui.win.WinApplication.lambda$
    null$147(WinApplication.java:177)
            at java.lang.Thread.run(
    Thread.java:748)
     
  16. Knoppi

    Knoppi Active Member Licensed User

    I can not reproduce the error.
    please post
    1. Name of the directory (DirAssert)
    2. Name of your Icon directory
     
  17. PatrikCavina

    PatrikCavina Member Licensed User

    I think i understand the problem.
    Isn't an icon problems but the problem is in Settings.map in parameter LastImageDir.
    if folder of LastImageDir not exist when i click "Copy Icons To Dir Asserts..." program try to open the folder and it crashed.
    And this explains the error:
    java.lang.IllegalArgumentException: Folder parameter must be a valid folder
     
  18. Knoppi

    Knoppi Active Member Licensed User

    It looks like that it is a problem with DirectoryChooser and InitialDirectory
    The Funktion "Copy Icons To Dir Asserts..." Create a not existing Folder.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice