Welcome, Guest
Python Scripts for ComicRack

TOPIC: Stuff 0.9.124 will be able to do

Stuff 0.9.124 will be able to do 7 years 5 months ago #7676

  • cYo
  • cYo's Avatar
  • Offline
  • Moderator
  • Posts: 3476
  • Thank you received: 675
  • Karma: 181
#
# A simple script to add a new comic info html panel
#
# the script should return some renderable html code (can include external references)
#
#@Name [Code Sample] Dummy Comic Info HTML
#@Hook ComicInfoHtml
#@Enabled false
#@Description A simple script to show how html info panels are done
def DummyHtmlInfoPanel(books):
    s = ''
    for b in books:
        s += '<br>' + b.Caption
    return s  

#
# A simple script to add a new comic info ui panel
#
# the script is only called once and should return a Windows Forms Control
# the control must implement the method ShowInfo(books)
#

# this is our UI control
# note the ShowInfo implementation
class UIControl(Control):
    def __init__(self):
        self.lb = ListBox()
        self.lb.Dock = DockStyle.Fill
        self.lb.IntegralHeight = False
        self.Controls.Add(self.lb)   
        
    def ShowInfo(self, books):
        print 'Calling...' + str(len(books))
        self.lb.Items.Clear()
        for b in books:
            print 'Adding ' + b.Caption
            self.lb.Items.Add(b.Caption)

#@Name [Code Sample] Dummy Comic Info UI
#@Hook ComicInfoUI
#@Enabled false
#@Description A simple script to show how ui info panels are done
def DummyUIInfoPanel():
    return UIControl()

Setting in Scripts:



Html Info Panel below browser:



UI Info Panel below browser:

Last Edit: 7 years 5 months ago by cYo.
The administrator has disabled public write access.

Re:Stuff 0.9.124 will be able to do 7 years 5 months ago #7711

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
Uuuum, I am sure we will find something funny to put this to a use... any suggestion in the meantime, cYo?
The administrator has disabled public write access.

Re:Stuff 0.9.124 will be able to do 7 years 5 months ago #7714

  • cYo
  • cYo's Avatar
  • Offline
  • Moderator
  • Posts: 3476
  • Thank you received: 675
  • Karma: 181
I thought the power of this is more obvious :)

It allows you to integrate your own gui into ComicRack. I think this was also a request when I asked what new features developers would like to have in the scripting engine.

Just for starters:
* Displaying web pages that fit to the currently selected items (ComicVine, wiki, ...)
* some extended editors that are not dialog based
Last Edit: 7 years 5 months ago by cYo.
The administrator has disabled public write access.

Re:Stuff 0.9.124 will be able to do 7 years 5 months ago #7715

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 232
Though I understood only a few things in the first post, I feel we are in for a major change .. and a good one for that !! :-)
Now Playing: The ComicRack Manual (Online)

See my new comics & gadgets on: Tumblr!
Last Edit: 7 years 5 months ago by 600WPMPO.
The administrator has disabled public write access.

Re:Stuff 0.9.124 will be able to do 7 years 5 months ago #7716

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
Yep, and I am sure we use this to have a "tab" to show all the comic info instead of having to crtl+i , as I had requested somewhere!

Thanks cYo!
The administrator has disabled public write access.
Time to create page: 0.222 seconds

Who's Online

We have 226 guests and 6 members online