Appcelerator. Options dialog is opening several times when refreshing table - appcelerator-mobile

Titanium SDK version: 1.7.0.RC1
iPhone SDK version: 4.2
I am developing an iOS app in Appcelerator. I am retrieving tweets from twitter and inserting them into a table. For each row/tweet I am also extracting the containing links for that individual tweet/row and the user can select them from an options dialog which is opened when the row is clicked.
The problem is that if I reload the page and click the row, two dialogs are open upon each other. If I click three times, three dialogs is opened and so on. How can I make sure that the dialog only opens once?
This is my code: http://pastie.org/2004091
Thankful for all help!

I had a similar problem. Especially on the iPhone 3G as this runs slowly and you're more tempted to tap things more than once. The way I got around it is to either remove the event listener from within the event listener itself. Or you set a variable and test for its value in the event listener. So, if you set a variable call 'clicked' to false. When the listener is first check for 'clicked' = false, if it is set it to true so next time the code is not executed.

Related

How can I save Checkbox selection in qt c++?

I am trying to develop an application with QT C++. I added a checkBox. How can I make my checkBox be in the last selection when I close my app and open it again. For example, if the checkbox was selected before the application was closed, I want it to be selected when the application runs again. If it wasn't selected before closing, it should come back unselected when it runs again. How can I do that?
Read the value of the checkbox when your app shuts down. Save the value somewhere, like; QSettings, a custom file, windows registry, etc. When your application starts, read the stored value and set the checkbox state to match.

Paste From QT Window to Another Application Input Widget

I am very new to C++ programming and the bulk of my program will be using the QT libraries. However, there is one part where I believe I will need to use Win32.
The scenario I want to code for is as follows:
I will have a QT application running. I want to be able to take some text which has been typed into a TextBox on the QT Window and paste that text into a TextBox in another application e.g. the address bar of Chrome, the address bar of Windows Explorer.
I want to be able to do that as a response to a button click on the QT Window. So, it would all happen in 3 steps. For example:
User types text into QT Window;
User places cursor in address bar of Chrome (Browser);
User clicks button on Window which pastes text into address bar of Chrome.
A nudge in the right direction would be most appreciated.
Edit - Additional Info
The application I’m building is a self-set assignment. I want to build a clipboard manager, similar to this old Delphi application http://www.joejoesoft.com/vcms/97/ . It will run in the system tray, in a minimised state.
The user, will put their focus into a text input in some application
which is running on their Windows machine e.g. Notepad.
Then, they will hit a hot key combination which will open a form (my QT Window.
The application will have been collecting clips as the user presses Ctrl-C (or by right-clicking) and those will be listed in that QT Form (just like the app in the link above).
The user then clicks on the particular item that they want paste and it will be pasted into the original input that they had put the cursor into.
Further Edit - further info
I'll break step 4 into a couple of sub-steps as it is causing confusion:
The user then clicks on the particular item that they want paste
Focus changes from QT Window back to the window of the other Win32 application which originally had focus
Content is pasted into the input control which now has the focus
I pretty much know how I can gather up items when the user copies things. But I have no idea how I will paste from my application to the target application.
Cheers

asp repeater itemcommand not working on second click

I have a repeater which I bind the data using Bind method from the database. There is a Asp:Button with an onclientclick and onclick event. In OnClientClick I open a new window and onclick I am adding the data to the database. This works perfectly on the first Page load. After first click on any of the buttons in the repeater, the click events stops working on subsequent clicks.
I have spending hours on finding a solution for the same, can any one guide me where i am going wrong what needs to be done.
P.S: My application is AJAX Enabled , using WCF and JQUERY
Thanks & Regards,
Phani...
Never Mind I got it solved my self. For others who are trying to solve the same issue, here is the solution:
The code below opens up a new window with out popup blocker blocking the window
OnClientClick of the button write Javascript like below to open a new window and refresh the parent window (I have to do this as the ItemCommand event was not firing until the page is refreshed)
OnClientClick = "target='_blank'; setTimeout("location.reload(true);", timeout);
Phani...

can I set the AppUserModelID of an arbitrary process launched through a jumplist?

I have a simple console application written in C++ that acts as a stub for launching another application through it's jumplist. Purpose is to add jumplist abilities to applications that do not support this. Call it stub.exe. When running stub.exe it creates a custom jumplist using these steps (taken right form the MS samples):
create an ICustomDestinationList
ICustomDestinationList::BeginList()
create an IObjectCollection
for_each item_to_add
create an IShellLink, set its path/arguments/title/icon
add IShellLink to the IObjectCollection
get the IObjectArray interface from the IObjectCollection
call ICustomDestinationList::AddUserTasks( IObjectArray interface )
ICustomDestinationList::CommitList()
When pinning stub.exe to the taskbar and right-clicking it, the jumpilst appears and it contains all IShellLinks added. When clicking an item, it will launch the corresponding process.
Now I'd like a process launched through this jumplist have it's window(s) grouped under stub.exe's taskbar icon, instead of having it's own group. They key to get this working seems to be the AppUsermodelID. This is what I tried so far:
just for testing, create a couple of shortcuts and set the id through IPropertyStore->SetValue( PKEY_AppUserModel_ID, "id" ). Indeed, when launching these shortcuts, they will all group under the same taskbar icon.
since the shortcuts do what I want, I tried adding shortcuts to stub.exe's jumplist: no effect. The shortcuts don't even show up in the jumplist (maybe one cannot have a shortcut to a shortcut?), yet all methods return S_OK
setting the PKEY_AppUserModel_ID on each of the IShellLinks that get added to the jumplist: no effect
calling ICustomDestinationList->SetAppID(): no effect
instead of using SubTasks, tried with SHAddToRecentDocs: no effect. The recent doc list does not show up. But now things get messy. After setting the AppUserModelID on the shortcut that is responsible for the pinned taskbar item (the one in %APPDATA%/Roaming/Microsoft/Internet Explorer/Quick Launch/User Pinned/TaskBar), the jumplist changed: it does not show the 'Tasks' item anymore, but does show 'Recent' and the items I added using SHAddToRecentDocs. Now when clicking them I get a dialog box with a title that starts with 'd:\desktop' followed by Chinese characters. Hovering the items in the jumplist also shows Chinese characters instead of the descirption I set.
Questions:
What's with the Chinese characters in the jumplist?
How come setting the app id on the taskbar shortcut toggles between 'Tasks' and 'Recent' sections, why are they not both there?
What would be the way, if even possible, to achive what I actually want: a custom jump list of which the items launched will group under it's taskbar icon? (note that the processes I plan to laucnh their do not have their app id set currently)
not much reactions here ;]
In the meantime I managed to solve the main problem myself; it's not quite a straightforward solution but it fullfills the requirements: a program runs in the backround and installs a CBT hook. Each time an application creates a window (HookProc code = HCBT_CREATEWND), the hook checks the application's path against a map containing paths and desired application ids. If a match is found, the application id of the HWND is set. Since this occurs before the window is actually shown and is combined with the custom task list, from a user's point of view the application behaves just like one that does support a recent/pinned document list.

After Navigate2 Method returns S_OK Stuck at READYSTATE of READYSTATE_LOADING

I am working on a MFC Document View architecture application which has multiple documents and views and a tabbed window interface.
I have been tasked with making an automatic switch to another tab on the press of the OK button in one of the other tabs. When the other tab is clicked on it uses a C++ wrapper over IWebBrowser2 to navigate to a specific web page.
When this is done manually by clicking on the tab everything is fine and the webpage within the view loads successfully.
In my first attempt at doing this the tab successfully switched in response to a call to
AfxGetMainWnd()->SendMessageToDescendants(SOME_MESSAGE, ...);
however by sending this windows message at the wrong point the application would crash once control returned because the chain of events caused the (modeless) dialog (*) that
sent the message, to no longer exist.
I then found the correct place to make the call, but now when the other tab is activated, it no longer displays the webpage as it should.
To debug this problem I added code to check the READYSTATE in both the situation where it works and the situation where it does not. When the page fails to load (despite the call to Navigate2 returning S_OK), the READYSTATE just stays at READYSTATE_LOADING.
Unfortunately now I am to many edits away from when I had it partially working.
I have added TRACE statements to the most obvious events such as OnSetFocus, CView::OnActivateView but all traces come out in the same order despite the behaviour being different
* hosted in the view