Change window title for ActivePivot Live - activepivot

I want to change the window title for ActivePivot Live, so that users having multiple Live instances open, can better find the right one.
I've tried calling Window.setTitle from my GinBootstrappers.afterApplicationLoaded method, but that seems to only show for a second or less, before being changed back to "ActivePivot Live"

Found my own answer.
GinBootstrapper.APPLICATION_NAME is public and not final,
so in my Bootstrapper, I can simply add this line to the constructor:
APPLICATION_NAME = "My Application Name";

The window title is set by the application and it is not possible to change it.

Related

Kentico 9: Auto Add Binding in Custom Module

I have created a custom module (actually I have created a handful in recent years, and this same obstacle frustrates me every time) following the Kentico documentation:
https://docs.kentico.com/display/K9/Creating+custom+modules
The problem I end up with every time, is in developing the User Interface for Parent/Child classes. I create a Vertical Tab node, and beneath it I add an edit tab and a Binding tab for the child class. This all works, and I can add and remove bindings at will, but what I can't do is ADD a new child class and bind it.
Using the Standard Edit Binding template, I am able to bind EXISTING Job Titles to the selected Category, but I cannot CREATE a new one from that page:
To solve this, I created a custom Edit Binding template, and added a New Child Class Header Action that points to a New / Edit Object child:
Which gives me a button that I can use to add a new child class (Job Title):
This approach works per se, in that I can click the New Job Title button and create a new item on the subsequent page:
But no binding is created to link the child object (Job Title) to the selected parent object (Category), An even bigger problem is that once I click Save, I am presented with the following:
The new object DOES SAVE, but the post-save navigation is somehow failing. The event log offers little in the way of diagnostics:
So I thought to create a completely custom interface to accomplish my needs here, according to the Kentico documentation:
https://docs.kentico.com/display/K9/Manually+creating+the+interface+for+custom+modules
So I change the Element Content of the New Job Title page to a custom page that I created to post a DataForm for the new object:
Taking care to assign the proper Object Types on the Properties Tab:
The intent was to programmatically create the binding upon save and also handle the correct navigation to avoid the ambiguous parameter error above, but when this page loads, the UIContext.ObjectID and UIContext.ParentObjectID are both 0:
So I cannot create the binding programmatically. I was able however to solve the error that I received by manually assigning the redirect. The experience is still lacking even with this hack, since it returns to the listing page, but the user still has to click "Add Items" to assign the binding after successfully creating it with the custom page I built.
This cannot be the proper way to do this, so any help with getting me on the right track would be greatly appreciated.
In order for the EditedObject to have a value you have to either decorate the page with the EditedObjectAtribute e.g. like this:
[EditedObject("<custom.objecttype>", "<objectid>", ...)]
or set the object yourself:
int objectId = QueryHelper.GetInteger("objectid", 0);
EditedObject = SomeInfoProvider.GetSomeInfo(objectId);
In your case, I'd recommend exploring what query parameters are available on the page and using them to fetch appropriate object(s). Also, make sure "JobCategoryId" is passed to the "New Job Title" dialog so that you can create the binding.
Btw - kudos for well asked question!

How to set content of text control in screencode

I just can't believe how hard this is.
I would like to edit the content of a Control with Type text. I'm working with lightswitch visual studio 2012. I would like to change this in the screencode (so programmatic).
I gave the control the name: "Message".
Right now, I'm trying this.FindControl("Message")., but there doesn't seem to be any property I can call to set the content. Nether can I cast the control to the correct Type text. Even Text doesn't seem to be a valid className.
Any Help on how to set the content of this control?
EDIT: Should I shoot the ControlAvailable event and try to modify content there?
You're on the right track with this.FindControl("Message"). The way to set a property on it once you have found it is as follows:
this.FindControl("Message").SetProperty("propertyToSet", [new value])
Actually, trying to set the value of a control on a screen is the wrong way to do it.
In LightSwitch, every control is bound to a property (usually an entity's property, but might also be a screen property), so setting the value of that property will update the control.
So if you have a detail screen that is bound to an entity (let's call it ClientProperty), & you have a TextBox control (let's call it MessageControl) bound to ClientProperty's Message property, all your code needs to do to change the value is:
Me.ClientProperty.Message = "This is a message"
If instead, you had a TextBox control (again, let's call it MessageControl) that's bound to a screen property (called Message), your code is as simple as:
Me.Message = "This is another message"
It seems "hard" the way you're trying to do it because it's not meant to be done that way.

hardcoded string “Button”, should use #string resource

I am new in Android app development and using Java language.
My problem is every time I make a TextView or Button there is a triangle with the exclamation mark below them.
and when I click it I saw a message saying:
hardcoded string “Button”, should use #string resource
I have two activities, in my main activity there is a Button that when you click it you will go in second activity.
But when I go to my main.java to make a code for the button. There's always the above shown error. I think the eclipse can't find the id of my button and same for my TextView they have same error message.
Here is the code I made:
Button b = FindViewById(R.id.button1);
I also add:
Button b = (Button) FindViewById(R.id.button1);
I am using the latest eclipse classic and ADT august issue. The platform is Android 4.1 API 16.
You shouldn't hardcode the "text" on the widgets use the strings resources ie., strings in the strings.xml to set the text. Declare the "text" you want to display as a string in strings.xml and access it using #string/your_string_name in the layout file.
Notice the id of the button, which is rounded in red. You have to use this id when you want to call it in a method, for an example
Button b = (Button) FindViewById(R.id.button1);
Furthermore, check whether your graphical layout matches with the image I have provided.
Just try your code again with these changes.
Your main.java would look like this.
I am a newbie too, but I believe I got this. So basically what's happening here, java wants you to put your hardcodes in string.xml. so that when accessing it, you will use the given methods below before:
.
But this is how it should be.
Let's start by string.xml
Then come back to your activity_main.xml

How to add additional page to be printed in Visual C++ 6

I have a picture that is getting printed in my MFC application. I'd like to add another page with another picture, so that 2 pages will be printed.
I know this is very poor description but the application is so big I can hardly know what's where.
First, locate your view-class. This will usually be something like CMyAppView - where MyApp is the project name. Inside this view class all printing stuff is handled.
You will most likely find overrides for OnPrint and OnFilePrint. In this methods you can adjust printer settings and page layout. And they will internally call OnDraw for your view. So, in OnPrint you add another page with EndPage and StartPage, and in OnDraw you really decide what you print.
If your printout should be different to your view on screen, you may have to store additional information on what to print when inside your class.
The EndPage and StartPage functions in the CDC class might be worth looking into.
Posibly you need to locate the print function and what data is printed.

Core data dirty flag not being set

I have a core data document based cocoa app that is working well except for one slightly odd problem.
For some reason, if I make a change to any of my fields the menu/window don't seem to recognize it - ie. the red close button doesn't get the black 'dirty' indicator and the File/Save menu item isn't enabled. However, if I attempt to close the application (via command-Q), I do get the popup asking me if I want to save my changes.
It seems that the document's dirty flag is being set, but the window/menu items aren't reacting to it. I am curious as to where I might look to see why this might be the case. I suspect that it may have something to do with my window not knowing about my ManagedObjectContext...
The only slightly atypical behaviour is that my document's makeWindowControllers method has been overridden and I am adding my window controllers using a call to my document's [self addWindowController:xxx] method. My window controllers subclass from NSWindowController so I had to add my own instance variable to each window controller to hold the ManagedObjectContext, but I suspect that this isn't getting passed to the window/menu. Not sure what the normal pattern is here...
Anyway, any thoughts would be much appreciated. Thanks
From the description it sounds like your UI elements are not actually bound to the document itself. If so, then the UI elements are not observing the document and are not reacting to changes in the document. Check the bindings.
Thanks in part to TechZen, and also re-reading my own question (in particular, where I said "I suspect that it may have something to do with my window not knowing about my ManagedObjectContext") I started to look at the bindings for my WindowController subclass.
As it turned out, I hadn't bound the window outlet for the File's Owner to my actual NSWindow. As soon as I did that, the black dirty dot and the window's menus started behaving correctly.

Resources