on 05-03-2016 11:37 PM
In my MIDI application, my sheets are all main windows and the TitleBar checkbox is grayed out. Anything I put in the title area does not show during run time. I can set the title to display through the code but there must be something I missed somewhere along the way as all of my sheets are like this. The value ":0" displays where the title should be.
Seems like a simple thing but very annoying.
Jim
Thanks for the ideas. I've tried them all but nothing seems to work. All windows are inherited from the ancestor. One of the descendants works, all others show the dread ":0" where the title should be. No where in the code that I can find (did a search through the source), any place where I reference the title. I do see the string variable title declared.
If I run the windows in Run/Preview, I do see the title in the Window, but not at execution. I guess that means some executable code is the culprit. Is it possible it is coming from a defective menu? (all menus working though).
Easy workaround is to set the title in the Open event. It just makes me nervous that something is lurking to come out and bite me later.
Here's a final thought, could it be coming from the database? I may have declared a column in the database with the name of "title"???
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If it runs OK in preview mode then no ancestor script is running. This means that when its opened under application control, then ancestor scripts are active.
FWIW: if you do *not* declare a local variable like "title" or X for example but code something like x++ it will compile & work. However, the PB compiler has actually coded it internally as this THIS.X++
BTW: When did this weird behaviour start ... Recent code change, application of an EBF, PB migration, etc?
Try searching for the string ".title =" in all your code (excluding the apostrophes). Somewhere in the code the title is being modified for sure. You can do this by right clicking on the target in the library painter an selecting Search... from the popup menu. This will search in all the objects of your target.
Also, I'm not sure about this but maybe a bad built menu is preventing the window from regenerating.
HI Chris,
My view is "Nothing is temporary; everything is permanent, until it changes"
Coined the first time a quick and dirty app refused to go away dispite objections from me like "...was never meant...."
So, in my humble opinion, the genapp framework, whilst overly convoluted for it's size can be used to get a "temporary" solution across the line to perhaps replace a set of spreadsheets or a MS-Access thing a superuser has composed.
Bbut ut regardless of framework, we should never hand over anything in a state of unmaintainabilty.
POwer to the builder.
LArs
PS typing this reply on the
morning commuter train on me iPhone, I may have accidentally thumbed the Alert Moderator link. If so: Sorry! Didn't mean to
Bingo. Thanks Lars (and to all others who responded). It is a genapp and not sure why but they choose to ignore the title and make their own out of the tag and an instance count.
I still get the ":0" at the end of the title because there are 0 instances (count) of this class of object. Not sure why. Either its not working or I should just remove the count?
Thanks again
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for not being clear. I am running 12.6 on Windows 10.
In addition to the window title always displaying ":0", I noticed that my ancestor window has an instance variable declared called il_itemnum. On the ancestor, all is well. On any window that inherits from the ancestor, I get a field listed on the bottom of the general tab of the window painter that is "il_itemnum", and is a spin control which is set to zero, but can be changed. Is this right? Can't find any documentation on it and I don't know why it shows up.
Also, just tried to open a previously happy and well working window (grid), and got a message that "Open of Window xxxxxx failed. It has been migrated to current version format, but must also be successfully regenerated". Of course, it won't regenerate - so probably is not recoverable. Lots of columns on the grid data window. Not sure if that is why. I have always been on 12.6.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi James;
FWIW: I am using PB 12.2, 12.5.1 & 12.6 (build 4088) all on W10 as well with no issues. Note: my PC's are all AMD based processors.
The fact that you see other instance variables informs me that you are looking at a window & controls that are inherited from other ancestors. I wonder if there is ancestor code that is driving the weird text appearing in your Window Title?
Regards ... Chris
Ancestor instance variables showing on descendants property sheet is not a new feature. I suspect it is much overlooked too, not the least because they often live below the horizon so to speak. I have found it useful on custom controls, but other developers might be searching in vane for a script line setting it.
Yes, that must be it. On the ancestor there must be some code that adds the item number to the title. Something like this:
this.title = this.title + ':' + string(this.il_itemnum)
Or maybe it uses another instance variable where the original title is stored:
this.title = this.is_original_title + ':' + string(this.il_itemnum)
Check the code at the ancestor window to see if this is the case.
By the way, the behavior of the general tab of the window painter is correct. When you add an instance variable to an ancestor it will appear as a modifiable property in the general tab of the inherited window so you can set its initial value that'll be used when an instance of the window is created. Or it can be left as is and set through code at run time.
Hi James;
It sounds like your having an issue with the IDE as that is not the normal Window Painter's behaviour for a Main type of Window. I don't have any PB versions < 12.1 any more to test with but I have never seen that behavior before either, in previous versions of PB - even way back to PB 4.0/5.0.
Your Window painter should look like this for any main type of Window class ...
At run time, the MDI sheet should appear as follows (from the above) ...
FWIW: I would look through your PB code for any PowerScript that modifies the Window Title. Try a search on ".title".
HTH
regards ... Chris
PS: PB 10 is long obsolete. You should think about upgrading (food for thought).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Somewhat confused ...
James stated 'my sheets are all main windows and the TitleBar checkbox is grayed out.'
Chris responds 'that is not the normal Window Painter's behaviour for a Main type of Window'
To prove the point, Chris provides a screenshot of a main window in the window painter ... with the TitleBar checkbox grayed out (disabled). Which is exactly what James reported seeing, and tends to support the point that it *IS* normal behaviour. Am I missing something?
Hi Nathan;
The window painter is correct as all Main Window types must have a title bar. Thus, the TB property in the properties pane being greyed out and the Title property being enabled is saying that you can not over-ride this standard in the Window painter.
BTW ... if you want a Control Menu to be present then you must have a title bar to draw this upon. Thus, another reason the Title Bar property is ON and disabled in the painter.
This all looks OK to me PB IDE wise or, maybe I'm just used to this since since first using PB starting with version 0.89 (alpha - Nov 1989).
HTH
Regards ... Chris
Hi James,
I believe the greyed out/disabled check box is how it's supposed to be. Certainly, that's how it is for all my windows of type Main! using PB 10.5, and it's how it always has been for as long as I can remember.
From PB help for the TitleBar property -
If the window type is a main or MDI frame window with or without MicroHelp, the TitleBar property is always enabled.
So the checkbox forces this property to be enabled and doesn't allow change. Is your disabled TitleBar checkbox checked?
The Title property not taking effect is harder to explain. I'd look for things like code in ancestor windows setting the title, maybe search your pbls for ':0' to see if that text is being set anywhere.
Good luck,
Nathan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Changing the type to say Child! then back to Main! might tidy up the checkboxes etc. Perhaps try the ancestor sheet first
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.