wxgrid , Detecting Scroll event - visual-c++

I have created a wxGrid with custom table. Whenever the user scrolls down to very bottom of the grid, I have to load the next 100 rows from my table. I tried EVT_SCROLL_BOTTOM() but I am not able to detect it. What is the right thing to do? Thanks.

I don't know the answer to your question but I am reminded that the grid was designed to work with an object of type wxGridTableBase that can be extended by the application. By extending this class, you should be able to do whatever caching you want inside of the extended object.

You could bind the scroll win event for the grid. I have encountered almost the same requirement as you. :)
self.Bind(wx.EVT_SCROLLWIN, self.OnScroll)

Related

Optimal and best way to control Recycler View items

what could be the best way to control events in RecyclerView items? That is, if we are going to change the display of the Recycler View items, or if we are going to test an event on them at all, what would be the best way?
I mean, to control these changes on each item in the onBindViewHolder() method, or in the MyViewHolder class, if the latter is more appropriate, then how do we calculate the first position?
Because Default -1 comes first and this issue causes it to crash sometimes.
Thank you if you have a better experience in this field
If you want to perform the event automatically (not from user behaviour), then you must do it within onBindViewHolder().
If you want to perform an event based on the user behaviour (like click, drag, etc.), then you can do it within the onBindViewHolder() or MyViewHolder.

Make the sidemenu slide OVER the form in Codename One

The current behavior of the sidemenu in Codename One is that the sidemenu pushes the current form aside as it comes out. I need to have the sidemenu slide over the form without displacing it instead.
It appears that the only options are to modify the underlying code for the sidemenu or to utilize some other component in a way that would mimic sidemenu behavior. From a conversation I had with CN1 support, modifying the underlying code sounds problematic and I haven't been happy with the results thus far of layering other components on top of the form.
Has anyone else been able to successfully implement this functionality? if so, can you please share how it was done?
Thanks!
I would hope we can do that for you but scheduling is making this really challenging. If all else fails try avoiding the sidemenu altogether and using a Container in the layered pane or alternatively a full blown InteractionDialog to simulate a sidemenu.

Coded ui objects in UIMap

I have a question regarding coded ui UIMap.
Every time I record an action on the same application, coded ui generates a new object for the same window in the application.
It looks like:
UIAdminWindow
UIAdminWindow1
UIAdminWindow2
and so on...
every window class holds different buttons, even though it's the same window.
Thus it's very hard to keep code maintenance.
What i would like is that every time i perform actions and records on a window, even if not at the same time, the already generated class for this window, will be updated with the new controls.
any suggestions to why it happens?
Thanks a lot!
You can clean up your UIMaps by doing two things:
Use the UIMap Toolbox (from codeplex) to move controls within the UIMap so they are all under one control tree.
When you have duplicate UI controls, go to the properties for the action that references the duplicate control and change the UI Control property to point to the original control in the UIMap.
The duplicate trees should now be unreferenced and you can delete it from your map, keeping things clean.
And yes, it's a pain to do, but it's worth it for maintainability.
In UIMap.uitest you can change the action name and the control name for better maintenance.
For example: you can set UIAdminWindow as FirstAcessWindow or other name that will express comfortably the control or the action.
What I can guess is that there is some randomly generated content or element identification data such as class or title that may be causing it. This may be caused by different username for example. Also you can update the element from UI map element tree.

Can you add to GestureRecognizer of the same type to one view?

I need to detect long-press on a UITextView, which already recognises long-press thus it has a long press recognizer, can I create a new one and add to it? How will it work then, two recognizers will get the same callback when you long-press?
Thanks!
Just add two UILongPressRecognizers with different selectors (initWithTarget:selector:) to the view. It should work just like you think it will work. You may need to return YES from your delegate's -gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer: when both of your UILongPressRecognizers are invoked simultaneously.
Note that you will likely encounter problems with Apple's recognizer for popping up the magnifier loupe.

Core data dirty flag not being set

I have a core data document based cocoa app that is working well except for one slightly odd problem.
For some reason, if I make a change to any of my fields the menu/window don't seem to recognize it - ie. the red close button doesn't get the black 'dirty' indicator and the File/Save menu item isn't enabled. However, if I attempt to close the application (via command-Q), I do get the popup asking me if I want to save my changes.
It seems that the document's dirty flag is being set, but the window/menu items aren't reacting to it. I am curious as to where I might look to see why this might be the case. I suspect that it may have something to do with my window not knowing about my ManagedObjectContext...
The only slightly atypical behaviour is that my document's makeWindowControllers method has been overridden and I am adding my window controllers using a call to my document's [self addWindowController:xxx] method. My window controllers subclass from NSWindowController so I had to add my own instance variable to each window controller to hold the ManagedObjectContext, but I suspect that this isn't getting passed to the window/menu. Not sure what the normal pattern is here...
Anyway, any thoughts would be much appreciated. Thanks
From the description it sounds like your UI elements are not actually bound to the document itself. If so, then the UI elements are not observing the document and are not reacting to changes in the document. Check the bindings.
Thanks in part to TechZen, and also re-reading my own question (in particular, where I said "I suspect that it may have something to do with my window not knowing about my ManagedObjectContext") I started to look at the bindings for my WindowController subclass.
As it turned out, I hadn't bound the window outlet for the File's Owner to my actual NSWindow. As soon as I did that, the black dirty dot and the window's menus started behaving correctly.

Resources