Action Sheet Dialog actions color - dialog

How to change action dialog actions button to red/destructive color in iOS and Android as well?
Is it supported with the current implementation of Nativescript?
I read that iOS supports destructive buttons color in the action sheet but I can't seem to find anything about its implementation on nativescript.

Use nativescript-fancyalert plugin for change action dialog action button color.

Related

Is there a way to create something likea draggable menu in wearable device in Android?

I was wondering if it is possible to create something like a menu that I can drag either by the side or from above on a wearable device. But I don't want it to affect the activity I have. You know like on a smart phone and you drag down the menu with some settings like brightness, rotation, etc...
To elaborate, I have a timer with a progress bar, but my activity would be overcrowded if I added any other stuff. So I want something to drag from the top of the screen to check on something, then drag again to return to my view that has the timer and progress bar. I basically have an activity where I make some selections, I wanted my selections to appear in that draggable menu thing to check to see my selections displayed there.
There are two drawer components for the type of behavior that you describe. Which one is better depends on the specifics of your implementation. The documentation for Navigation Drawer and Action Drawer can be found here.

Expanding button to autosuggestbox in UWP

I am trying to configure a button within my UWP app to expand in to an AutoSuggestBox on click. This behavior is mentioned in this post:
https://msdn.microsoft.com/en-us/windows/uwp/controls-and-patterns/search#Implementation
I tried utilizing a flyout on the button click, but it doesn't give me the desired effect. Is there an existing control that can do this or will I need to roll my own XAML of an existing control?
The behavior you see in the blogpost can be easily achieved by having an autosuggestbox hidden behind the button, then after on button click fading out the button and resizing the autosuggestbox to the desired width.
There's no way to "expand" a control into a different one, but you can make it look like that happens :)

How to skin MFC main menu

I got a menu in an existing MFC application that has a standard MFC main menu.
But I would like to change its background colour so that it appears to more seamlessly belong to the rest of the application.
First picture: An MFC main menu. The application is skinned blue, as seen in the toolbar, but the menu is still standard grey background colour.
Second Picture: Spotify's menu, skinned to fit into the rest of the
colors.
I have not found any examples on anything similar. Could you please point me towards how to achieve this?
Approaches I thought of:
Subclassing CMenu to my own SkinnedMenu, but it is not created by our code but by a GetMenu() call in a mainframe class deriving from CFrameWnd. The only thing I can find here is its method signature, defined in afxwin.h so then how could I make use my own subclassed menu?
Removing the entire menu and add my own custom menu buttons, in a row, making it look like a menu. Maybe this is what spotify have done, as they have also removed the Windows window frame.
Editing the existing CMenu in some way, but the only customization I am able to find right now is modifying its MENUINFO. For example if I set info.hbrBack = skin.GetSysColorBrush(COLOR_MENU) the only colour that changes is the background of the dropdown, not the main menu itself.
Other :)

How to make a custom dialog in InstallShield?

I'm trying to understand InstallShield (2009)/InstallScript on the fly, because I'm modifying someone else's installation script.
One of the dialogs during the installation procedure previously had one textbox on it, asking for a SQL Server instance, assuming a certain database name. Now I've just completed an enhancement enabling you to choose any database name, not just the default, and I need to add a field to this dialog so the user can input the chosen DB name. Monkey see, monkey do, just make a new control and duplicate and adapt whatever functionality the form had for the first textbox - easy enough, right?
Umm... problem here. It seems that the "SdShowDlgEdit1" form is a generic thing that gets shipped with InstallShield, and is used all over, wherever you have a dialog that needs one textbox. Change that form, and it changes everywhere that it's called... so now I have a spurious 2nd textbox appearing all over my installation wherever there was a single text box before.
Oops. Undo changes, and change the reference to "SdShowDlgEdit2", which is - you guessed it - InstallShield's standard form for dialogs needing 2 textboxes. Now that would be great.... excepting that the previous developer got there before me and added a "browse" button to that form for a place where he needed the 2nd text box to contain a folder path. I don't want that "browse" button, and I can't delete it.
So I think, why don't I create a custom form of my own, and not get under anyone else's toes? So I clone the form, rename the new instance to "EnterDbDetails", delete the "Browse" button and make the form look just right.
Then I go back into the InstallScript to redirect to "EnterDbDetails" and discover that the EzDefineDialog function requires me to pass in the "Resource ID" of the form. Now what was it again... 12018... great... fill in all necessary details, compile, build, and give it a whirl. Looks lovely, all the right default values are filled into the two text boxes - but hey! Why is the browse button there? And why is the text on the labels not what I set?
Back to InstallScript, check the Resource ID - turns out that the original "SdShowDlgEdit2" also has a Resource ID of 12018. Well, that explains that nicely. Silly that InstallShield allows you to have two forms with the same ID, but whatever... So let's go back to my "EnterDbDetails" form and change the ID...
... but the Resource Identifier property is read-only! WTF?
So now I can't use any of the standard forms, and I can't use a custom form because it won't let me change the resource ID.
I am stumped. Can anyone please explain how you are supposed to do something like this, which really ought to be the simplest thing in the world?
Creating New Custom Dialogs in InstallScript and InstallScript MSI Projects
Quote from the site (2015 edition) :
To create a custom dialog, you need to perform the following general steps:
Use the New Dialog Wizard to add a new custom dialog to your project. For more information, see Using the New Dialog Wizard to Add a New Custom Dialog to an InstallScript or InstallScript MSI Project.
Add controls to the dialog. For more information, see Adding a Control to a Dialog in an InstallScript or InstallScript MSI Project.
Create a script function that loads the dialog into memory, displays it on the screen, handles the end user’s interaction with the dialog’s controls, and closes the dialog when the user is finished with it. For more information, see Using InstallScript to Implement Custom Dialogs.
To create a new dialog:
Open the Dialogs view. The Dialogs view is located in the User Interface section of the View List.
Right-click the All Dialogs explorer and then click New Dialog. The Dialog Wizard opens. Click Next to dismiss the Welcome panel.
In the Dialog Template panel, click Interior Wizard Panel, and select the Let me insert this dialog in a User Interface sequence check box.
In the User Interface panel, select Installation in the User Interface Sequence list. In the list of dialogs, select InstallWelcome. Based on these selections, InstallShield will insert your new dialog in sequence immediately following the InstallWelcome dialog.
In the Dialog Position and Condition panel, leave the default settings, and click Finish. Your new dialog appears in the Dialogs list.
Right-click the dialog and select Rename. Rename the dialog WelcomeBitmap.
Using the same technique, you can insert additional dialogs in your installation’s user interface.
In this step, you will modify the WelcomeBitmap dialog that you just created:
First, create a bitmap (using a program like Microsoft Paint) that measures 300 by 150.
Open the Dialogs view.
Expand the WelcomeBitmap dialog’s node. Click English (United States) to open the Dialog Editor.
Click the Dialog Bold Title text box at the top of the dialog. In the Text field, type Welcome Bitmap. This changes the dialog’s main title.
Click the Dialog Normal Description text box at the top of the dialog. In the Text field, type Displays my welcome bitmap. This changes the dialog’s description.
Click the Bitmap button on the Dialog Control toolbar and use the cursor to drag a box on the dialog. Set the Height to 150 and the Width to 300.
In the File field browse to the bitmap file that you created in step 1.
After rebuilding the project (by pressing F7) and running it (by pressing CTRL+F5), the Welcome Bitmap dialog will appear after the Install Welcome dialog.
You need to edit the ResourceID (to something unique) in the Dialog table which is found in the Direct Editor under Additional Tools section in the Installation Designer.
By custimizing standard InstallShield dialogs, like sdWelcome, sdFinish and sdFinishReboot you will be able to use the dialogs default script APIs with the performed customization's

Dismiss spinner control popup if you don't want an item in android

I have an android spinner which I call via the performClick method to show a list of items (the actual control is hidden from the user and is called from a checkbox, too complex to explain why I have done it this way).
If I do not want an item in the list, how can I dismiss the popup by clicking on the black area?
Does this make sense? :/
Edit: Sorry, forgot to mention that the users will not be able to operate the bottom buttons (device is going to be galaxy tab) as they will be covered up with protective layer due as they will be outdoors.
usually such a control is dismissed using the back key in the android applications. So I would suggest that you find a way to do it the same way on your control.
'Esc' button should do the same job..

Resources