Losing format on the road to Pan X

I’ve been converting databases from Pan 6 with reasonable success, but something big is being lost in translation. The fonts pretty much all revert to System fonts, rather than the ones I carefully chose in Pan 6, and they revert to a standard font size that is usually different than what I had. I can fix these up, painstakingly, one at a time,unless there is a better way. But what I can’t figure out is how to get the colors back on my buttons. They are all generic now, all white. I can see in the Appearance pane that the original color is still showing, but the button remains white no matter what I do in that pane. Resizing a button doesn’t seem to do anything either. I’m also getting nowhere trying to change a button’s style, or to get one to act like a Popup Menu Button object. The documentation apparently leaves out some critical information that I’m missing.

I have the same problem with buttons - both old and new. And I can’t resize them - only the weird blue background changes size.

michael

Any object can have associated procedures that fire when you click on it. So you can make anything at all into a button and it can look however you want.
How about that?

Not sure what you’re saying Bill - how do I colour or resize a button?

m

When it comes to user interface widgets like buttons, Panorama X is absolutely not as flexible as Panorama 6. This is 100% intentional, and will not change. I discussed this in several of the videos, including the Buttons video and also the introductory video.

Over the past three decades probably the most common complaint about Panorama has been about its non-standard user interface. Past versions of Panorama have used custom home-grown code to draw items like buttons. That made possible a lot of flexibility, but it also meant that this items did not match standard system items, especially as Apple updated the look and feel of these items. So many potential users take one look at Panorama and say “yuck, that looks like a relic from 80’s.” Another sale lost.

There is only one way to reliably make perfect user interface items that exactly match Apple’s – and that is to actually use Apple’s code. So that is what Panorama X does. ALL user interface elements in Panorama X are implemented using standard Apple code. This means that the user interface always exactly matches the precise look and feel of the system. If you look at a Panorama X database on 10.9 Mavericks, then look at the same database in 10.10 or later, you’ll see that the look and feel changes automatically to reflect the newer system. This isn’t because Panorama is emulating these changes, it is because Panorama is actually using Apple’s code. If Apple changes the look and feel again in 10.13, 10.14 or beyond, Panorama databases will instantly reflect those changes, because the look and feel code is in the OS, not in Panorama.

The flip side is that Apple’s code isn’t nearly as flexible. Apple has certain ideas about how user interface should look, and that’s the way their code works. For example, Apple has decided that there is an exact correct height for push buttons, and that buttons should be a certain color and font. In the past, Panorama would let you make all kinds of wild user interface choices, but no longer. Panorama uses Apple’s code and you can only create a user interface that matches Apple conventions. (The last statement isn’t entirely true – you can create fully custom buttons and other items using your own custom artwork, but not with standard buttons.)

As a separate point, if you want to make the same change to a bunch of objects, you can select all of them and make the change once. All selected objects will be changed. This is a big improvement over Panorama 6.

Also, the graphic editor in Panorama X is now completely programmable. Anything that can be done manually in the graphic editor can also be done in a program. So if you need to make the same type of change over and over again, you can write a program to do it. Obviously this is way more than I can describe in a post, which is why there is a 3 hour video about this topic (#22).

Jim’s reply says one side of it clearly and thoroughly. If you want a standard Apple button you’ll have a standard Apple button as defined by the OS. But if you want to roll your own, Panorama makes it easy.
Bill

In Panorama X almost any form object can be used as a button. The down side is that there is no built in indication that the simulated button has been clicked (no brief flash displayed when engaged). I have thrown together a little demo file to show how to simulate this clicking action on a few sample buttons using various form objects. The trick is to briefly change the object fill color in the triggered procedure before running the following procedure code. I have used a scheme like this in the code:

changeobject   "theButton","color",htmlrgb("FFFFFF")
showpage 
showpage
changeobject   "theButton","color",htmlrgb("80CCFF")
showpage
// actual working code follows...```

I have added this code to both the form object as well as the text label on top of the form object but if you make the text label the same size as the form object underneath it you only need to have the triggering code in the text label's procedure panel. Note the use of the double `showpage` statements that nake the brief flash a little more noticable.

You can get this zipped demo file at [Button Demo](http://www.unseensoft.com/Button%20Demo.pandb.zip).

This is very useful, Gary. But I’m having trouble because my TextLabelObject, being topmost so it can be seen, obscures the rectangle button object so that I have to click outside the edges of my label in order to get the button to fire. Your example buttons don’t seem to have this problem. What’s the trick?

If you check the procedure pane in the properties panel for both the Text Label Object and the object underneath it you will see the exact same procedure text entered for each. I tried to make this evident in the description for each example. This makes the same code run whether you click the TLO or the graphic object underneath it.

I guess I saw that but it didn’t register the first time. The ability to treat just about anything as a button is new to my thinking. Thanks.

Not that I don’t think any of you could figure this out, but I put together a little procedure that will carry out Gary’s flashing button method without having to put all of that code into the procedure panes of every button.

 Procedure PushMe

 local ObjName, ObjColor
 ObjName = parameter(1)
 ObjColor = parameter(2)

 object ObjName
 changeobject ObjName,"color",htmlrgb("FFFFFF")     //briefly turns it white
 showpage
 showpage
 changeobject ObjName,"color",htmlrgb(ObjColor)      //back to original color
 showpage

When you construct your button with a colored rectangle (or whatever) and a label object, name the rectangle object and note the htmlrgb( value of its color. In the procedure panes of the rectangle and the label, just put this code:

 call PushMe,"_object name_","_6 character color string_"

Follow this line with whatever code you want the button to execute, or another “call” statement.

In the Button Demo file, the top button uses “a Image Display object with a gradiant fill.” I can not figure out how to create a gradient fill in Pan X; or was the fill imported?

You can create your own gradient fill Image Display Objects in Panorama X using special formulas. I have made a little file that allows you to do this fairly easily called “Gradient Workshop”. Click on this hyperlink and you will get the zipped file. Here is a screen shot of this file:

Wow! This is an impressive tool. I was looking for a “page layout” or “drawing program” tool to do the job. I need to expand my concept of formulas beyond data manipulation. Thanks Gary. Very nice.

Thanks Tom. You might note that this file has only the .Initialize procedure to declare and set the variables. All the actual working code is in the Procedure panes of the various objects themselves. I made this when I was totally enamored with this new ability in Panorama X and kind of went overboard with it. If I was to redo it today I would probably follow a more traditional implementation instead.

By the way, the ability to display a gradient with the Image Display tool is described in the Image Display video.

Gary

In the ShowVariables command in the .Init procedure of your Gradient Workshop, preband is spelled prebband.

m

Thanks, sticky keyboard I guess. Oh well, it was only in the showvariables area.

Now I’m wondering why no error message is generated for showvariables and a non-existent variable. I just tried it in Panorama 6 and no error was generated there either. Seems to me as though an error should be generated for this.