Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: form as dialog panel?

  1. #1
    Senior Member
    Join Date
    Oct 2012
    Posts
    125

    Question form as dialog panel?

    I would need something like inputbox (), but a little more complex. The panel can created by using a form, some containers, a built-in grid (browsing), command buttons, check boxes.
    But doevents() exits immediately, setfocus() is not enough. The Lianja.showDialogPanel() - as I see it - can only be used to display a Lianja Page.
    is there any way to use the Lianja Form as a dialog panel?
    or how to make Lianja Page from a simple form to use for Lianja.showDialgPanel()?

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,966
    you can use these commands.

    read events
    ...
    clear events

    lianja.showdialogpanel() can use “functionName()” that returns a “container”.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,010
    Hi strato,

    Check out the Dialog Panel page https://www.lianja.com/doc/index.php/Dialog_Panels and then search for Visual Component on that page, and click that link.

    So:

    1) create a canvas section to fulfill your needs. It doesn't have to be in this app -- it can be in an app where you store all your Visual Components for the current project.

    2) save it as a Visual Component

    3) use it as the source of your dialog panel.

    You can use that same visual component anywhere in your project. You can even set properties (surfaced as the docs show) in the given instance.

    It's a brilliant solution to a very common issue in software development: how to make a component usable anywhere in your application as needed).

    hth,

    Hank
    Last edited by HankFay; 2020-09-22 at 10:42.

  4. #4
    Senior Member
    Join Date
    Oct 2012
    Posts
    125
    thanks a lot Barry!
    I read it in the documentation: READ EVENS command itself is not currently supported. (https://www.lianja.com/doc/index.php/CLEAR_EVENTS) ... but it really works!!
    You wrote: a function that returns a "container" ... a form in this context is a "container", if I understand well

  5. #5
    Senior Member
    Join Date
    Oct 2012
    Posts
    125

    You are great Hank!!!
    Super solution, thank you!

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,966
    READ EVENTS is now supported. I’ve corrected the doc.

    You can add a visual component as Hank suggests or build a custom component using the UI framework classes. You don’t need a form when embedding inside a Dialog panel, just embed a container that contains your custom UI.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  7. #7
    Senior Member
    Join Date
    Oct 2012
    Posts
    125

    Lightbulb thanks Barry!


  8. #8
    Senior Member
    Join Date
    Oct 2012
    Posts
    125

    What do I do wrong?

    I need further help to create the dialog panel
    1. I can't link the necessary events to the appropriate function (I commented in the sample program which works, which doesn't)
    2. There are some sample programs. In _form.prg the main window and grid object are global variables, so the event handler works. In _form2.prg the event handler would work with the "own" object (referenced by "this." object) the address of grid object would be passed in a property, but it doesn't work (the members of the passed object are not available)
    3. "this." reference would be important for the container solution (_container.prg and _container2). But this doesn't work at all, members of own object (this.) are not available in the event handler.
    What do I do wrong?
    Attached Files Attached Files

  9. #9
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,966
    Show me how you are calling the dialogpanel.

    ”this” always points to the object in any event.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  10. #10
    Senior Member
    Join Date
    Oct 2012
    Posts
    125
    define class mykeres as container
    mygrid = .null.
    add object browin as container with anchor=1024+2048,layout=2,height=440,width=240
    add object getwin as container with anchor=512+1024,layout=1,top=440,height=30,width=2 40

    function talal
    local patt, fld, cRec
    private my_grid
    my_grid = this.mygrid
    fld = my_grid.column(1).controlsource // !!
    patt = this.getwin.bevitel.value // !!
    cRec = recno()
    locate for atc(m.patt,&fld)=1
    if !found()
    go m.cRec
    else
    my_grid.goto(recno())
    endif
    enddefine

    ....
    main program

    my_window = createobject("form")
    kerwin = kerespanel(my_alias)
    my_window.addobject(kerwin)
    read events

    .....
    function kerespanel
    parameter p1

    my_panel = createobject("mykeres")
    my_win = my_panel.getwin
    my_win.addobject("bevitel","textbox")
    my_input = my_win.bevitel
    my_input.bindevents(my_input,"valid",my_panel,"tal al")
    my_browin = my_panel.browin
    my_grid = my_browin.browse("browse fields contactname, companyname, customerid noedit nomodify","customers")
    my_panel.mygrid = my_grid

    return my_panel
    Last edited by strato; 2020-09-23 at 17:22.

Page 1 of 3 123 LastLast

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us