accessing an object from a pop up window in parent window - textbox

i have a pop up window in which there is a grid on rowselecting i have an object that is created that contains all the row elements. I want to assign these values to text boxes in the parent window can anybody please help me with this.
Regards
-Vishu

I don't understand exactly your question. because I don't know what language you are using. But, if you want using an object on popup window in parent window, you can set modifier of object in popup window is "public" and that object must be global variable. and you can use that object in parent window
example:
popupWindow{
public object A;
}
parentWindow{
popupWindow pWin = new popupWindow();
// here, you can use object A in parent window
pWin.A = ....
}
I hope it will help you.

Related

Why some properties are hidden from Object Inspector when more than one item is selected?

I've noticed that some properties disappear from the Object Inspector when selecting more than one item.
Why does this happen and how to control this behavior when creating a component?
Example:
Add 2 buttons (TButton) to a form and select one of them.
In the Object Inspector you can see all TButton's published properties (Note that there's also the Constraints property).
Add the other button to the current selection (Click while pressing Shift key).
As you can see, some properties have been hidden from Object Inspector (Note that the Constraints is no more visible).
Whether a property is displayed when multiple objects are selected is controlled by the property editor configured for that property. Property editors (descended from TPropertyEditor in DesignEditors.pas) have a GetAttributes method that returns a set of attributes that apply to the editor. If the set includes paMultiSelect, then the property will be displayed.
Given that the property value is displayed as the constraint values, rather than just (TSizeConstraints), I conclude that that property is not using the generic TClassProperty editor. That editor sets paMultiSelect, but based on your pictures, the property editor to TSizeConstraints doesn't. It was probably an oversight.
You could try registering your own property editor. Find the property editor currently registered for TSizeConstraints (by searching the source code for TSizeConstraints, for instance) and, in a design-time package, declare a new class descended from that one. Override GetAttributes to return the value you need. Finally, follow examples elsewhere in the code to call RegisterPropertyEditor.

vaadin 7 - move data between sub windows

I have the main UI class with a button that shows a subwindow when clicked. That subwindow has a textField and a button. When you press the subwindow's button, another sub window opens. You could call it the sub-sub window. This sub-sub window has a textfield and a button that will close this sub-sub window. I would like to update the textfield in the subwindow when i close this sub-sub window with the textfield value on the sub-sub window. is there a way to do this without creating everything on the main UI Class? I would like to create 2 classes for these sub windows and would like to pass the data back. I got it to work by putting everything on the main UI class but i thought there would be a better way.
TIA,
Thomas Kim
You can either bind all your components which acces shared data to same model, using Vaadin Data Binding or you can use Events to propagate value changes from subwindows to whichever component may be concerned.
Consider using Model View Presenter pattern to structure you view layer. There is a nice article to explain basics of MVP and its implementation in Vaadin.
https://vaadin.com/web/magi/home/-/blogs/model-view-presenter-pattern-with-vaadin
This approach will not only solve your problem, but also lead to better separated and maintable presentation layer.

Delphi: What is type of window appears after you click a ComboBox

There is a window appear after you click that triangle icon of ComboBox. This I know it's not just a panel like object because for example in the following picture it' out of main form.
What is its type and how can I create something like this?
It is a standard ListBox control that the ComboBox creates internally (its HWND is accessible via the CB_GETCOMBOBOXINFO message). It is implemented as a free-floating window (so it can appear outside the ComboBox's parent window), except when the Style property is set to csSimple, in which case the ListBox resides as a child within the ComboBox's client area instead.

grid binding to a listbox selecteditem runtime

I am a beginner, so please bear with me.
Let's say we have a listbox and a grid that contains textblocks on a window. But these are instanced from separate xaml files, and added to two different stackpanels in the window.
How can I bind the grid datasource to the listbox's selected item in runtime?
I guess what I need to do is to do this following xaml in runtime:
Grid DataContext="{Binding ElementName=lstContacts, Path=SelectedItem}"
Thanks.
You could handle the Window's Loaded event, and in your handler: traverse your Window's children using VisualTreeHelper to find your ListBox based on its name, then set your Grid's DataContext.
Here is a question that discusses, and provides a method for, finding children in such a manner.

How do I set my MainForm to be hidden when my program starts?

I am using the Borland c++ builder. I have an application where I want the main form to be hidden until a button is pressed on a different form. i have set the Visible value on the mainform to false, but it still shows up when i run the program. anyone know what to do?
Have a look at the TApplication ShowMainForm property.
Here is an example based on the instructions in online help.
Set the main form Visible property to false.
On the menu select Project -> View Source to display the main project file.
Add the following code after the call to Application->CreateForm and before the call to Application->Run.
Application->ShowMainForm = false;
You should end up with something like this.
try
{
Application->Initialize();
Application->MainFormOnTaskBar = true;
Application->CreateForm(__classid(TMainForm), &MainForm);
// extra code to hide main form
Application->ShowMainForm = false;
Application->Run();
}
There is a demo that comes with C++Builder that does this It can be found in demos\cpp\apps\twoforms
"First" is the form with the button that shows "Second"
The button's OnClick event handler creates the new form with new, then calls ShowModal()
You can use just Show() if it isn't meant to be a modal form.

Resources