In actionbar, I've button to toggle sliderDrawer, home button. But I can't change it's image, it is Smartface Emulator's icon. How can I change it?
P.S: No, it isn't icon of actionbar, it is home button in actionbar. So this isn't my solution:
function Page1_Self_OnShow(e){
this.actionBar.backgroundColor = "#ff0000";
this.actionBar.icon = "ic_actionbar.png";
this.actionBar.displayShowTitleEnabled = true;
this.actionBar.title = "Title";
this.actionBar.subtitle = "Subtitle";
this.actionBar.displayHomeAsUpEnabled = false;
this.actionBar.visible = true;
this.actionBar.onHomeIconItemSelected = function(e){
Pages.back();
}
}
If you have a sliderdrawer object related to a page, you can only see the icon of sliderDrawer on actionBar.
There was a problem about changing sliderDrawer's icon, it is fixed and will work in next release.
Until then, you won't be able to change it's icon.
SliderDrawer's icon normally changes as below :
var mySliderDrawer = new SMF.UI.SliderDrawer({
position : SMF.UI.SliderDrawerPosition.left,
icon : "myicon.png" //icon property
});
This code block will work with the next release of Smartface App Studio.
Related
I use the library: https://pub.dev/packages/share
image1
image2
And when pressing quickly and continuously on a button, many bottom sheets are displayed. How to only have 1 bottom sheet visible?
Question: What you can do to avoid this?
Answer: Declare a bool right here =>
class YourAppState extends State<YourApp> {
bool _isClicked = false;
and then use it in your method _showShare()
void _showShare() async {
if(!_isCLicked)
{
await Share.share("https://xxxx.com");
_isCLicked =true;
}
}
and when you want to use that share feature again revert its value to false.
You can use a flag for your problem when ever user select sharing icon, your flag will be false and when sharing modal will open completely your flag will be true again.
finally use your flag for handling that is user selecting the sharing icon or not
I am working to an application with unity3D and MRTK package for hololens2 and I am trying to change the color of a toggle when it is disabled.
The toggle has an Interactable script on it with many profiles, one of them has two themes for the selected state that are "InteractableActivateTheme" and "Interactable color children theme".
I used successfully the latter to change color of the toggle when selected using the theme field "Pressed" and "Default", but I am not able to use the "Disabled" field in any case.
Screenshot of the profile I am talking about
I disable the toggle by code setting the state to disabled in this way:
PlaceToggle.SetState(InteractableStates.InteractableStateEnum.Disabled, true);
PlaceToggle.enabled = true;
The toggle disables itself but the color remains red has set in the "Default" State Properties of the "InteractableColorChildrenTheme".
I also tried to change the color by code like this, but I had no result:
var activeThemes = PlaceToggle.ActiveThemes;
foreach (InteractableThemeBase itb in activeThemes)
{
if (itb is InteractableColorChildrenTheme)
{
Debug.Log(" changing state property");
var property = itb.StateProperties;
oldColor = itb.StateProperties[0].Values[0].Color;
itb.StateProperties[0].Values[0].Color = Color.gray;
}
}
Any idea on how could I understand what it is happening and why it is not working??
Thanks you all
Please try the following code to disable your button:
buttonInteractable = this.GetComponent<Interactable>();
buttonInteractable.IsEnabled = false;
Verified in MRTK2.7 & Unity 2019.4.22.
I have tried to find solutions but somehow I can't find the right solution for my problem. I have 5 buttons and each button opens or closes its panel. However, I want that if I click on Button 2 that the panel closes for Button 1 and so. There should be only one panel active for each button.
It is just having a tab menu you are clicking through, only the panel of the last pressed button is active. I have seen a tutorial with images and Eventsystems but does not fit my current project.
I would be grateful for any help.
You can create a list for panels and in the same order add buttons to the another list. Respective button and panel in same places. Then when you press a button get index it in script. Activate matching panel index and disable others. In my script, I don't want to disable panels because I need to those script to run everytime. In your case you can just disable them.
for (int i = 0; i < panels.Count; i++)
{
if (i == index)
{
panels[i].GetComponent<CanvasGroup>().interactable = true;
panels[i].GetComponent<CanvasGroup>().alpha = 1;
panels[i].GetComponent<CanvasGroup>().blocksRaycasts = true;
// Place to front for interaction
panels[i].transform.SetAsLastSibling();
}
else
{
panels[i].GetComponent<CanvasGroup>().interactable = false;
panels[i].GetComponent<CanvasGroup>().alpha = 0;
panels[i].GetComponent<CanvasGroup>().blocksRaycasts = false;
}
}
I'm looking for simple code that adds a popup in my Google Apps Script Ui that comes up when I hit a submit button. The popup box would display a message and have a button to close the popup.
I've looked all over the place - everything seems so complicated and does way more than I need it to do.
This is the current code I have for the submit button.
function doGet() {
var app = UiApp.createApplication();
app.setTitle("My Logbook");
var hPanel_01 = app.createHorizontalPanel();
var vPanel_01 = app.createVerticalPanel();
var vPanel_02 = app.createVerticalPanel();
var vPanel_03 = app.createVerticalPanel();
var submitButton = app.createButton("Submit");
//Create click handler
var clickHandler = app.createServerHandler("submitData");
submitButton.addClickHandler(clickHandler);
clickHandler.addCallbackElement(hPanel_01);
////Test PopUp Panel
var app = UiApp.getActiveApplication();
var app = UiApp.createApplication;
var dialog = app.createDialogBox();
var closeHandler = app.createClientHandler().forTargets(dialog).setVisible(false);
submitButton.addClickHandler(closeHandler);
var button= app.createButton('Close').addClickHandler(closeHandler);
dialog.add(button);
app.add(dialog);
//////
return app;
}
Since UiApp is depreciated, HTMLService should be used to create custom user interfaces.
To prompt simple popup to display a message, use alert method of Ui class
var ui = DocumentApp.getUi();
ui.alert('Hello world');
will prompt simple popup with hello world and an ok button.
To display customized html template in Dialog, use HTMLService to create template and then pass it to showModalDialog method of Ui Class
var html = HtmlService.createHtmlOutput("<div>Hello world</div>").setSandboxMode(HtmlService.SandboxMode.IFRAME);
DocumentApp.getUi().showModalDialog(html, "My Dialog");
HtmlService.createHtmlOutputFromFile allows you to display html that is in a separate file. see the documentation
Have you tried using zIndex? It places the panel above all of your other panels...
var popupPanel = app.createVerticalPanel().setId('popupPanel')
.setVisible(false)
.setStyleAttribute('left', x)
.setStyleAttribute('top', y)
.setStyleAttribute('zIndex', '1')
.setStyleAttribute('position', 'fixed');
x = panel position from the left portion of your app
y = panel position from the top portion of your app
zIndex = the 'layer' your panel will appear on. You can stack panels using '1', '2', '3' etc.
position = your panel will be in a fixed position denoted by (x,y)
Visibility is set to false until you click submit, then have a client handler for your submit button make the popupPanel visible. When you click the button on your popupPanel, have the client handler set visibility to false once again and it will disappear.
One more thing, I noticed you get the active app and then create a new app. You do not need to create a new app...just new panels inside your app.
Hope this helps!
You can use a dialogbox to popup.
Add a button to the dialog-box. Add a client handler that sets the dialog box invisible,once you click the button.
var app = UiApp.createApplication;
var dialog = app.createDialogBox();
var closeHandler = app.createClientHandler().forTargets(dialog).setVisible(false);
var button= app.createButton('Close').addClickHandler(closeHandler);
dialog.add(button);
app.add(dialog);
This should help.
EDIT
Added "()" after .createClientHandler. That should remove issues related to TypeError: Cannot find function createDialogBox in object function createApplication() {/* */}
Popup - use something like this:
var table = app.createFlexTable();
table.setStyleAttribute("position", "absolute");
table.setStyleAttribute("background", "white");
add items to the table and hide and show as needed.
I am developing a Windows application using .NET (C#) and I have a DropDownList with some list items. On the event OnSelectedIndexChanged I need to display a progess bar, which should disappear after retrieving some data.
I'm trying this way:
for (int i = progressBar1.Minimum; i <= progressBar1.Maximum; i++)
{
progressBar1.PerformStep();
}
panel1.Visible = false;
where my progress bar is placed in panel1, but I get the progress bar when I initially load my application. After that whenever the item is changed the progress bar is not visible.
I need the solution asap...
Thanks in advance!
Try panel1.Visible = true; at the start of your on selected index changed event of the combo box.
I don't see the code that would make the Panel visible again and you would also need to reset the ProgressBar before updating it again by changing the Value property to zero.
private void comboBox1_SelectedIndexChanged(...)
{
progressBar1.Value=progressBar1.Minimum;
panel1.Visible = true;
for (int i = progressBar1.Minimum; i <= progressBar1.Maximum; i++)
{
progressBar1.PerformStep();
}
panel1.Visible = false
}
This should make the panel1 visible, however, I'm not sure what you mean by:
"and should disappear after retrieving
some data"
and if the solution of filling the progress bar solves it.