Premise Custom Buttons in Minibrowser

  • Thread starter Thread starter chucklyons
  • Start date Start date
Motorola Premise
C

chucklyons

Guest
Has anybody gotten custom button images to work in the minibrowser? I have largely built my AB UI using Custom buttons; the one line test is okay, but I'd like to keep the same look and feel as I have with the AB -

any ideas?
 
So I'm working on it...not being a skilled code warrior, I need too figure out how to put

Code:
if macro.IsOfExplicitType("sys://Schema/Modules/AutomationBrowser/ControlPanelManager/Classes/ThemedCustomPanelButton") then
set themedButtonObj = sys.GetObject("sys://Schema/Modules/AutomationBrowser/ControlPanelManager/Templates/WebPreferenceFolder/CustomPanel/ThemedCustomPanelButton")
Output = Output & RenderCSS(themedButtonObj)
else
Output = Output & RenderCSS(macro)
end if
Output = Output & """>"

or some variation from 'Modules/AB/ObjectGrid/RenderMacros' into the minibrowser code.

It took me a while to find out how AB renders the buttons....but now I have a portion of the custom buttons displaying in the minibrowser. I'll have to work out the html aspects to get them to display properly..it may be how I used the location properties for the custom buttons..I then have to add the 'firemacro' to the 'on-click' action...then I'll be close.

yeah, right!
 
Well, chuck the hack has gotten custom buttons working in the minibrowser...but I've run into a couple of headscratchers... 1) The custom buttons display in the minibrowser, but then the custom buttons 'disappear' in the AB...and I didn't touch any code in the AB...What I have figured out is I'm having a relative vs absolute problem between AB Custom Button backgroundimage and minibrowser img src....2) my implementation has separate buttons for 'on' and 'off'...and I'm having a bit of a problem keeping them in sync...

Other than that, ;) it seems to be working okay....
 
My goal was to use custom buttons in both AB and minibrowser. The primary reason is my custom buttons give me status on the face. Minibrowser didn't give me the ability to just hit the button, then have it happen. Instead, you 'drill' into the action (e.g. light on, light off)

Well, this is what I did - I still have some issues that I'm working away at..but in the meantime...

in minibrowser->globalscripts, I added this...

Code:
		for each oMacro in oMacros
			' Render the custom panel button 
					if not sysevent.ClientSession.UIAdvanced then
				if iCellCount mod iColumns = 0 then sHTML = sHTML & (vbcrlf & "<TR>" & vbcrlf)
							
				sHTML = sHTML & (sButton & "<TD>" & "<A href=""" & omacro.objectid & "?d??mbfiremacro""><img class= ""imagebutton"" width=90 height=45 src="""  &  omacro.displayname & """>" & "</TD>" & sButtonEnd)
				end if

I changed all of the home objects navigation to hidden...
I havent been able to figure out, yet, an elegant way to handle the difference between absolute and relative links; which means I can't use backgroundimage: url(etc....)
So what I did is this:
Code:
home.Family_Room.FamilyRoomUserFolder.FamilyRoom.Downstairs.DisplayName = "\plugins\defaultimages\text\downstairs.gif"
home.Family_Room.FamilyRoomUserFolder.FamilyRoom.Downstairs.BackgroundImage = "url(/plugins/defaultimages/text/downstairs.gif)"

For each home object, for any property change, it changes the display name for the object, which is then used to render the correct image for the state. I use two images, one for on; one for off (I was using display name to overlay fonts onto the images...I like this way better)

I commented out the
Code:
			sName = oMacro.Description
			sMacroName = ""
			if Len(sName) >= 15 then
				sMacroName = Left(sName, 15)
			else
				sMacroName = sName
			end if
		'sHTML = sHTML & (sMacroName & "</A>")
in globalscripts - as I just like the image; not the text...

hackware? Yes! At its finest. The two images show custom buttons in the minibrowser...I still need to figure out how to refresh the page when the status changes on the object...maybe tomorrow!
Formatting, still to come...but I'm thrilled...

If anybody has an elegant way of handling the absolute/relative link issue, please fire away!
If you're new to forum, use at your own risk. If you're not new to the forum, you already know....
:)
 

Attachments

  • minibowsercustom.png
    minibowsercustom.png
    53.5 KB · Views: 13
  • minibowsercustom2.gif
    minibowsercustom2.gif
    20.8 KB · Views: 13
Back
Top