How to hide the cfgrid default bottom toolbar? - coldfusion

As coldfusion is upgraded for my current application. The earlier code for extjs isn't working anymore
Could you suggest the latest version for the below implementations?
var grid = ColdFusion.Grid.getGridObject('mainGrid');
grid.getBottomToolbar().hide();
this doesnt hide the default toolbar that appears with cfgrid. Tried adding a xtype: 'pagingtoolbar', to the grid and renderTo :grid.bbar , where grid.bbar is null in the newest version.
Also
e.grid.colModel.config[e.column].editor.selectOnFocus = true;
while adding a listener function the above code isn't working
Also
grid.syncSize();//Sync to size up everything properly again
what shall be used instead here?

Related

How can I use multiple instances of webkit in c++ gtkmm program?

Short question:
How to make different instances of webkit in C++?
Long question:
I'm writing a simple webbrowser with Webkit2 in C++ on ubuntu with a gtkmm gui. I would like to use different pages with different Webkit instances.
So far, I have a window to which I can add and remove pages/tabs and Webkit successfully running in the first page/tab. When I add a second page/tab with an other instance of Webkit I'm not able to load any webpage. My code in the callback function to add a page/tab:
m_WebKit00 = WEBKIT_WEB_VIEW(webkit_web_view_new()); // WebKitWebView* was initialized to the nullptr in the constructor
surf00 = Glib::wrap(GTK_WIDGET(m_WebKit00)); // Gtk::Widget* was initialized to the nullptr in the constructor
m_pViewport00->add(*surf00); // Gtk::Viewport* was initialized to the nullptr in the constructor
m_pNotebook->append_page(*m_pViewport00, *m_pTab00); // Gtk::Notebook* was initialized to the nullptr in the constructor
// same for m_WebKit01, surf01 and so on, ex:
m_WebKit01 = WEBKIT_WEB_VIEW(webkit_web_view_new());
// at start of program one page/tab is created and it is selected; adding/removing pages/tabs works perfectly
Code in the on_notebook_switch_page() callback which is run if an other page/tab is selected by the user after adding a page:
// here I have a switch to check which page/tab is selected.
// WebKitWebView** m_WebKit(nullptr) // initialized by the constructor
m_WebKit = &m_WebKit00; // if page 0 is selected // WebKitWebView** was initialized to the nullptr in the constructor
m_WebKit = &m_WebKit01; // if page 1 is selected
// and so on;
The idea is to let m_WebKit point to the webkit instance of the selected page/tab.
Now I want to load the webpage when someone enters an url in the searchentry with:
webkit_web_view_load_uri(m_WebKit, &url[0]);
// reuse this function whenever the searchentry is used, no matter on what page/tab you are
This works perfectly for page 0, but not for page 1. On page 1 nothing loads, no errors or changes to the page or viewport.
What am I missing here? Isn't it possible to use multiple instances of webkit? Would a solution be the use of smart/shared/weak pointers or is the no loading caused by something else? Any better techniques and/or webkit tutorials?
Please help!! Thank you
#273K: edited the code with the same result

NSStatusItem setTitle is ignored on Yosemite

I've been working on a new feature for Mac support in Qt. Basically, it's about adding a NSStatusItem::title() support. Since Qt is a C++ framework, I am working in scope of ObjC-binding (corresponding method is declared in C++ header and defined in .mm source file).
void QCocoaSystemTrayIcon::updateTitle(const QString &title)
{
NSString *nstitle = title.toNSString();
[trayItem setTitle: nstitle];
}
Note: in the code above, toNSString() creates & releases a proper NSString* in place.
Interesting, if you replace actual setting line with
[[trayItem view] setToolTip: nsstring];
tool tip, in fact, is being changed. It proves that trayItem and nsstring are proper objects.
I am running IIRC latest OS X Yosemite 10.10.1
Almost all NSStatusItem methods are deprecated in Yosemite because of the new vibrancy features. Nice description here, NSStatusItem change image for dark tint
The fact that [trayItem view] returns a valid object suggests that you or Qt is setting a custom view.
Once you set a custom view on a status item, setting the title has no effect. (This was true even before these methods were deprecated).
A standard status item (no set custom view) can have its image and title set and have that be forwarded onto the implicitly created button. This was made more explicit/obvious in 10.10 in that those status item properties were deprecated, and you set the button's properties directly.

disable firefox extension programmatically

I'm having a problem trying to disable Firefox extensions programmatically. Right now, I'm modifying the extension.json file , changing the 2 parameters , active and userDisabled , but without any success. Despite the fact that in the extension menu it appears to be disabled , the icon of extensions still appear in the toolbar and I can see that the extensions still work. Is there a way to make this work using C++ ?
That won't work you have to use AddonManager.jsm to change the property like this:
Cu.import('resource://gre/modules/AddonManager.jsm');
AddonManager.getAddonByID('Profilist#jetpack', function(addon) { //id of the addon
console.info('addon:', addon);
addon.userDisabled = false; //set to true to enable it
});

Unit testing android listview scrolling using Roboelectric

I have a method that attempts to programatically scroll to a position in a ListView. The method has some conditionals so that its implementation differs slightly based on the Android SDK version the app is running on.
The functionality works fine on 3 android devices that I have tested on. However, I have written a unit test using junit and Roboelectric that checks if the scrolling has made the the item at the target position visible. The test fails. When I debug, I notice that android.os.Build.VERSION.SDK_INT is 0 when running with Roboelectric (i.e., on the desktop vs. device or emulator).
I've tried ignoring the version and just using ListView.smoothScrollToPosition(), but the getFirstVisilePoition() and getLastVisiblePosition() methods continue to return 0, even immediately after I call smoothScrollToPosition(150).
Does anyone know if/how scrolling a listview can be tested using Roboelectric?
Any help would be appreciated - I can't seem to find any information on the topic.
Thanks,
Ana
If you're using robolectric 1.1 or 1.2, here is the source for the AbsListView:
https://github.com/pivotal/robolectric/blob/master/src/main/java/com/xtremelabs/robolectric/shadows/ShadowAbsListView.java
It looks like all the scrolling functionality is it ShadowAdapterView:
https://github.com/pivotal/robolectric/blob/master/src/main/java/com/xtremelabs/robolectric/shadows/ShadowAdapterView.java
It doesn't look like getFirstVisiblePoition() or getLastVisiblePosition() are implemented.
I was able to get the smooth scroll position.
#RunWith(RobolectricTestRunner.class)
public class SmoothScroll {
#Test
public void testSmoothScroll() {
Activity context = new Activity();
ListView view = new ListView(context);
view.smoothScrollToPosition(100);
Assert.assertEquals(100, Robolectric.shadowOf(view).getSmoothScrolledPosition());
}
}
You can get the smooth scrolled position. Based on the height of the elements, you may be able to work out which ones are visible.

Appcelerator. Buttons in rows are unclickable

Titanium SDK version: 1.6.2 (tried with 1.7 too)
iPhone SDK version: 4.2
I am developing an iPhone app and I am fetching data from my API and presenting it in a table. In this table I got a button on each row that should allow the user to add that person to his or her contacts. The only problem with the code (I think) is that only the last button responds when being clicked. Nothing happens when I click the other buttons.
This is my code: http://pastie.org/1932098
What is wrong?
You are adding the button.addEventListener outside of the for statement, and since you are overwriting the button var with each iteration, the eventListener only attaches to the last button created.
This probably isn't the best way to work this, but to fix your problem, move the button.addEventListener inside the for statement, and then check for a unique identifier in the object that gets sent to the event. Example:
for (x=0;x<5;x++) {
var button = Titanium.UI.createButton({
height:40,
width:100,
top:50*x,
id:x
});
var label = Titanium.UI.createLabel({
text:'LABEL '+x
});
button.add(label);
win1.add(button);
button.addEventListener('click', function(e){
Ti.API.info('Button clicked '+e.source.id);
});
}
The button.id property is just made up, but now you can see which button sends the event. You could also use title, or anything else that is unique.
Other options to look at are creating unique variable names for each button, but that's probably more work. Also, instead of working with putting a button in the table row, use a label or image, then listen for the event generated by the table or row.