How to use spinner in multiple components - css

I have multiple components.i created spinner on clicking button it's working fine but how to use spinner multiple components like drop down and radio button only one html code to be use another components in angular.I don't want to use plugins.
Thank you

You should created a shared Spinner Component and placed inside shared folder. Using Subject you can emit an event say 'show/hide' from your source component. Listen for events in Spinner component and display/hide the spinner.

Related

Show a QT UI in another one

I have a project including 3 UI files: win_main.ui, win_table.ui and win_table2.ui.
I want to show one of them inside of win_main.ui, and with a button, change them.
I mean, there is a Box containing win_table.ui, and when I clicked the button, the box will change to win_table2.ui.
Example
I tried using QWidget, QQuickWidget, but they didn't worked.
Is it possible ? If yes, how ?
Try using a QTabWidget. You can flip between tables using tabs.
If there is a specific reason why you wouldn't want win_table2.ui showing before a button is pressed, you can disable that tab programmatically until it is ready. You can also flip between which tab is currently showing using code as well.

Is there a way to show tooltip on disabled QWidget

I have a Qt form, where I have a button and menu. For various reasons I can disable certain elements, e.g button or some actions in the menu.
Is there a way I could show a tooltip or when the mouse is hovered over the disabled button or menu item with an explanation as to why it is disabled?
I am using Qt 4.8.
Thanks!
You can set the tooltip dynamically based on the state of the QWidget or by simply toggling both at the same time. Upon disabling/enabling the widget from somewhere just call QWidget::setToolTip(...) with the QString you want the tooltip to display when hovering with the mouse over the given widget. For example if you have a public slot called toggleButton(bool toggleFlag) which toggles the enable-setting of a button you can do:
void MyWidget::toggleButton(bool toggleFlag) {
this->ui->myButton->setEnabled(toggleFlag);
this->ui->myButton->setToolTip(toggleFlag ? QString("Enabled wohoo!") : QString("Disabled because I like it"));
}
You can of course do also change the tooltip by calling QWidget::isEnabled() and act upon its return value. Since you haven't given any code I can only assume how you toggle your button(s) so that's all I can give you for now.
UPDATE: It was pointed in the comments that tooltips don't work with disabled widgets due not receiving mouse events. Both statements are not true (note that I have used the same tooltip message since due to lack of minimal working example I didn't want to write a whole new project from scratch and used an existing one of mine instead):
Hovering a disabled button triggers the tooltip
Hovering an enabled button triggers the tooltip

Unity3D: How to programmatically test new UI features

I have an app built in Unity which uses the new canvas features including buttons and inputfields.
I'm wondering how I could implement automated testing by programmatically entering characters into the input fields and clicking buttons.
In the case of the button the UI.Button component doesnt seem to have a click method you can call.
Is there a way of registering mouse clicks at the buttons location? Or some other way of achieving this?
Ok, This is how you click a button programmatically
MyButton.onClick.Invoke();
and for the inputfields you can just set their text fields like so..
MyInput.text = "flooopybloopybloo";

keydown event reusable code - how can I write it once and use anywhere in my flex application

I am new to flex framework.
I have created an application using flex framework 4.1 which is having various components that are shown to the end user in the form of a popup window using <mx:TitleWindow>.
This titlewindow is closed either on the click of the close button (displayed in it's titlebar) or by pressing the "escape key" on the keyboard.
I coded a functionality wherein I close the current TitleWindow whenever an 'escape' button is pressed.
Here is what I did.
On the keydown event of TitleWindow I called this function
private function detectescapekeypress(event:KeyboardEvent):void
{
if(event.charCode == Keyboard.ESCAPE)
PopUpManager.removePopUp(this);
}
But this function does not work when I define it in the main home screen of my application and call it using parentApplication.detectescapekeypress(event) on the keydown event of TitleWindow
I had to repeat this code for every TitleWindow that I have used in the project.
How can I write the above functionality only once and reuse it amongst various TitleWindow and other components so that the code for the same is not repeated across various components?
Note: Every TitleWindow that I am using has different code, scripts and layout in it.
Thanks
Why don't u just extend the TitleWindow component and add that functionality to your new custom component? Then use it everywhere instead of the original TitleWindow.
I assume u're using at least SDK 4.1
Create a new mxml file called for example CustomTitleWindow.mxml and paste the following
http://www.copypastecode.com/68211/
Then change all your title windows to CustomTitleWindow.
P.S. Note that in order for the key event to be dispatched, the component must have focus.
blz

Flex: How can I Load data, then create required components?

I have a flex application that has three tabs. Each of these tabs has a component that loads a ‘form’ that has a dropdown combo box. These combo boxes depend on external data in order to populate correctly. Currently the first tab is being created and the data that should be populated in the combo box is not in there. The combo box for the second tab is populated with the required data.
What I’d like to do is create an event that is dispatched after the data is loaded. When this event happens I’d like to then create these tabs, or the components of the tabs. Is there a way to wait for the data to be loaded before the application creates the components?
You could create the components in actionscript.
this code will create a ComboBox:
var newBox = new ComboBox();
newBox.dataProvider = aDataProvider;
// You could alternativley use (v/h)box.addChild(newBox)
// to add it as a child of a specific element
Application.application.addChild(newBox);
You can use that sort of technique to create the components in actionscript, you will still need to set all the properties that are usually set in mxml, but they all have the same names.

Resources