Archive for the ‘Gadget’ Category

Gadget

Posted: 2017-01-17 in Gadget

Q:
in a standard section, I’ve iserted a simple VFP Gadget, with 2 label and 2 textbox.
When I load the page, the gadget is correctly populated.
When I skip records of section, how I can refresh the gadget object?
A:
A custom gadget should have a refresh method which is called when required.
It’s a method in the gadget object.
Declare public variables and assign the objects. These public variables should be in a namespace if you edited the custom gadget through the UI.
a page with 2 section:

in the seconds section I’ve inserted a VFP Gadget:
on the “Custom filename”: gadget2.prg

Code:
//
// Lianja custom recital gadget "gadget2"
//
namespace martinelli_articoli 
        public des_web, testo_web
       
define class gadget2 as gadget
        proc init()
                // place your section "init" code here
        endproc

        proc add()
                // place your section "add" code here
        endproc

        proc delete()
                // place your "delete" code here
        endproc

        proc first()
                // place your goto "top" here
        endproc

        proc previous()
                // place your move "previous" code here
        endproc

        proc next()
                // place your move "next" code here
        endproc

        proc last()
                // place your goto "bottom" code here
        endproc

        proc watch()
                // place your "watch" code here
        endproc

        proc refresh()
                // place your "refresh" code here
                des_web.text = Q_RemoveHTMLTag(ARTICOLI.DES_WEB)
                testo_web.text = Q_RemoveHTMLTag(ARTICOLI.TESTO_WEB)           
        endproc
enddefine

proc gadget2 
        gadget2 = createobject("gadget2")

        gadget2.addobject("lbl_desweb", "Label")
        lbl_desweb.caption = "Descrizione WEB"

        gadget2.addobject("des_web", "Textbox") 
        des_web.text = Q_RemoveHTMLTag(ARTICOLI.DES_WEB)
       
        gadget2.addobject("lbl_testoweb", "Label")
        lbl_testoweb.caption = "Testo WEB"
        gadget2.addobject("testo_web", "Textbox") 
        testo_web.text = Q_RemoveHTMLTag(ARTICOLI.TESTO_WEB)
                 
        // 
return gadget2

The grid gadget example
grid Gadget Example Lianja – https://youtu.be/a0v3GYwO3h8


Q:
Actionbar. How to hide it in the grid gadget?


A:
.actionbar =.f.



 

Gadget

Posted: 2015-11-07 in Gadget

Q: 
Which delegate of the Custom section should I put the AddObject() method?
A:
There is no delegate involved in creating a custom gadget. Hover the mouse over the gadget header and click the keyboard icon. You will then be in the script editor for that custom gadget. That is where you create your custom gadget UI.