Qooxdoo Tooltip not working on Menu Button - qooxdoo

I can't seem to get a tooltip to stick to a menu button. Is this a bug?
var menu = new qx.ui.menu.Menu();
var undoButton = new qx.ui.menu.Button("Undo", "icon/16/actions/edit-undo.png", this.__undoCommand);
var tooltip = new qx.ui.tooltip.ToolTip("test", null);
undoButton.setToolTip(tooltip);

By default, qx.ui.menu.Button hides tool tips. Try
undoButton.setBlockToolTip(false);

Related

Component not showing when swipeable container is swiped using code

I have a swipeable container with a button exposed when you swipe it.
It works when you use your mouse to swipe, but it doesnt seem to work when
you use code to perform the same action.
Form hi = new Form(new BoxLayout(BoxLayout.Y_AXIS));
Container multiButtonCont = new Container(new BoxLayout(BoxLayout.Y_AXIS));
MultiButton mButton = new MultiButton();
mButton.setTextLine1("mButton 1");
Button testB1 = new Button("TestButton1");
SwipeableContainer swipe = new SwipeableContainer(testB1,mButton);
multiButtonCont.addComponent(swipe);
Button openButton = new Button("Open");
openButton.addActionListener(e->{
for(int i=0;i<multiButtonCont.getComponentCount();i++){
((SwipeableContainer) (multiButtonCont.getComponentAt(i))).openToRight();
}
});
Button closeButton = new Button("Close");
closeButton.addActionListener(e->{
for(int i=0;i<multiButtonCont.getComponentCount();i++){
((SwipeableContainer) (multiButtonCont.getComponentAt(i))).close();
}
});
hi.addComponent(GridLayout.encloseIn(2, openButton, closeButton));
hi.addComponent(multiButtonCont);
hi.show();
Any ideas on how to implement opening a swipeable container using code?
Thanks for the code, it seems to be a regression in the component. I've fixed it and it should be available for the coming update which is on October 7th 2016

appcelerator titanium - edit button in tabgroup doesn't go away

Using Titanium mobile sdk 1.7.2, I created a tabgroup with 11 tabs. The problem is when I open any of the tabs inside the 'more' tab, if the child window has a right navbar button, some times the 'edit' button of the 'more' tab doesn't go away..
my code is:
app.js:
var tabGroup=Titanium.UI.createTabGroup({top:20});
............
/** list of windows and tabs **/
............
var win9 = Titanium.UI.createWindow({
url:'discover.js',
title:'Discover',
navBarHidden:true,
barColor: navBarColor
});
var tab9 = Titanium.UI.createTab({
icon:'images/icons/Discover.png',
title:'Discover',
window:win9
});
discover.js:
win=Titanium.UI.currentWindow;
var btn=Titanium.UI.createButton({title:'Discover'});
btn.addEventListener('click',function (){
//do some stuff
});
win.rightNavButton=btn;
the problem is, sometimes when I open the 'tab9' which opens 'win9' my button (btn) doesn't appear, the 'edit' button of the 'more' is shown instead.
N.B: the click event listener works just fine, It is the 'edit' title that persists. Any one knows how to solve this?
thank you,
You need to set allowUserCustomization:false in your Tabgroup.
var tabGroup=Titanium.UI.createTabGroup({top:20,allowUserCustomization:false});
try to set
win.rightNavButton = null;
win.rightNavButton = btn;

Ext Js - show/hide grid's header menu

How to control show and hide of the grid header context menu dropdown [ext js] through a javascript function on a button click?
After some digging I have found this workaround:
button.on('click', function() {
var grid = Ext.getCmp('my-grid');
// assuming that we need to expand the first column's menu
var column = grid.columns[0];
var hc = grid.view.headerCt;
hc.showMenuBy(column.el.dom, column)
});

Appcelerator Titanium Mobile App Screens?

I am trying to figure out how to make a multi-screen app using Appcelerator Titanium. I am familiar with Android development, so using the Android SDK I would create a few different activities, each doing their different work (login screen, screen displaying list of items, etc.) What is the equivalent in Titanium? I know that app.js is the main part of the app, but I assume it is not recommended to just put all code in that single file. The kitchen sink app has a lot of files and functionality, but I am not sure how they all fit together. So, what is the recommended way to create a project in Titanium for a basic app with a few screens doing different things? I am missing the Titanium concept of a screen.
no..
you can do it like
var button = Ti.UI.createButton({..});
button.addEventListener('click',function(e){
var window = Ti.UI.createWindow({
url:"../newWindow.js",
title:"newWindow"
});
Titanium.UI.currentTab.open(window,{animated:true});
});
i recommend to use the MVC-pattern like i already posted here.
App.js file is basically the file to initialize different window screens, and use Tabs to load those windows screens.Here is a link to create simple screens Create Window & Tabs
For further properties related to TitaniumUI
Try doing this:
app.js
Tintanium.include('window1.js', 'window2.js');
...
var button1 = Titanium.UI.createButton({...});
button1.addEventListener('click',function(){
window1.open();
});
window1.js
var window1=Titanium.UI.createWindow({...});
...etc...
Hope this will help ;)
try using my code below:
// functions
function openHomescreen(e)
{
settings.close();
getlucky.close();
survey.close();
homescreen.url = 'homescreen.js';
homescreen.open();
}
function openGetlucky(e)
{
settings.close();
homescreen.close();
getlucky.url = 'getlucky.js';
getlucky.open();
}
// events
Ti.App.addEventListener('homescreen',openHomescreen);
Ti.App.addEventListener('getlucky',openGetlucky);
openHomescreen({});
To open homescreen in other JS file, use this.
Ti.App.fireEvent('homescreen');
After a lot of time research i i found the solution for opening different windows with a click event attached to a button.
employee.js
//Current window (employee window)
var employeeWin = Ti.UI.currentWindow;
//define button
var moveToDetailBtn = Ti.UI.createButton({
width : 200, //define the width of button
height : 50, //define height of the button
title : 'Show Detail' //Define the text on button
});
//Click event to open the Employee Details window
moveToDetailBtn.addEventListener('click', function(){
//Call a export function
var win = require('employeeDetails').getEmployeeDetailSWin;
//Create new instance
var employeeDetailsWin = new win();
//Open the Employee Details window
employeeDetailsWin.open();
});
//Add the button to the window
employeeWin.add(moveToDetailBtn);
In employeeDetails.js
exports.getEmployeeDetailSWin = function(){
//Creates a new window
var empDetailsWin = Ti.UI.createWindow({
backgroundColor : '#ffffff' //Define the backgroundcolor of the window
});
//Addin a label to the window
empDetailsWin.add(Ti.UI.createLabel({
width : 100, //Define width of the label
height : 50, //Define height of the label
title : 'Employee Details'
}));
return empDetailsWin;
};
I found the solution in this page: http://www.mindfiresolutions.com/Open-New-Window-Without-URL-Property-In-Titanium-2214.php

Can I put a Button in a RichTextBox in Silverlight 4?

I would like to allow users to put a System.Windows.Controls.Button in the System.Windows.Controls.RichTextBox. The button would do a pre-defined thing.
I figured out how to do this. It's called an InlineUIContainer you can do something like this to get it working. Although it doesn't save it into the Xaml
var p = new Paragraph();
var inlineUIContainer = new InlineUIContainer() { Child = new Button() { Content = "This is a Button!" } };
p.Inlines.Add(inlineUIContainer);
_richTextBox.Blocks.Add(p);

Resources