Ccuiviewwrapper doesn't allow touch dispatcher to catch touches - cocos2d-iphone

When I use CCUIViewWrapper, I notice that my touch dispatcher doesn't catch any touches, even when the layers that need to have touches are added after the wrappers. Any idea how to remedy this?

It looks like CCUIViewWrapper adds their contained UIViews to the root window as a subview, so essentially the order of things is everything Cocos2d, then any CCUIViewWrappers on top of it. That explains whey the UIViews are capturing my input even when I add children after the wrappers are added.
It sounds like my best option may be to create any functionality that needs to be done on top of these wrappers within an additional wrapper itself and further add that on top.

Related

Hide Page/Tab from QTWidget - QT 5.5

i need to hide tabs from a existing project in QT, i don't want to delete the code because i have to set parameters on that code, the Application relay on that too. Seems like QT hasn't built-in hide(); function, i tried to edit stylesheet to make it smaller, but doesn't work too, i've looked on the internet and seems like this is a known issue. Does somebody have some tricks to avoid this?
Only thing i was able to come up with is:
ui->TabObject->setEnabled(false);
basically i disable objects in the tab to make them not usable by the user, but this is not a good thing for the whole UI.
Maybe by calling QTabWidget::removeTab(index) - this removes the tab from the QTabWidget, but does not delete the tab's QWidget.

CTreeCtrl - only use checkboxes for certain rows/children

I have a CTreeCtrl and I filled it with content. Now I wanted to add checkboxes but JUST for certain ones. I've found the possibilty to activate checkboxes on the TreeCtrl with m_Tree.ModifyStyle(0, TVS_CHECKBOXES), but this adds a checkbox on each node/child on the whole Ctrl. Is it possible to turn this feature on, but just for certain ones?
All I found is the possibility to add three different pictures, catch the clickevent on a node and change the image. Is there an easier way? Let me know.
Thanks a lot,
jntme
I don't think that CTreeCtrl provide any method to add check boxes at specified node only.
Easiest way to do this is explain in following link.
http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2005-10/msg00454.html.
please go through and let me know if you are facing problem.
You may be able to accomplish what you want with a custom draw tree control. But, you'll need to render the image states yourself. That could get messy because you'll need to account for all of the possible different states.

How do I inject a Coldbox plugin into every handler?

We have some plugins that are used throughout a Coldbox application.
Is there a way to globally inject these without having to manually specify the property for each one?
I've looked through the Wirebox docs, but can't see anything relevant. (Entirely possible I'm overlooking something; it's a long and dense page.)
It would seem like decorating the FrameworkSupertype might be a way to do this, but I can't find any mention of doing that.
I'll point out that Stack Overflow also requires logging in and typing a subject :)
There are several ways to accomplish this and honestly any way works.
The first would be to simply call getPlugin("myPlugin") everywhere you want to use it since the getPlugin() method is available in every handler, view, and layout.
The second would be to use mixin injection and place the following at the top of every handler and then access the plugin from the variables scope:
property name="myPlugin" inject="coldbox:plugin:myPlugin";
The third would be to have all your handlers extend a base handler like Joel suggested and place the DI property in your base handler.
The fourth, which you mentioned, would be to use an AOP aspect and bind it to the init() method for every CFC in the handlers directory and set the plugin into the variables scope as an "after" advice.
A fifth option, would be to use an interceptor to listen to the afterHandlerCreation announcement, and manually inject the plugin into the oHandler object.
And a sixth possibility would be to use the requestStartHandler or a the preProcess interception point and place a reference to your plugin in the private request collection (prc) which will also be available in the views and layouts.
So lots of options, and honestly that probably isn't even all of them. Personally, I'd probably use the afterHandlerCreation interceptor, but you should find the one that works best for you and run with it!

cpp graphical menu

I am making a new graphical menu interface for a project I am making. I don't want to use the menu system provided by windows APIs and want to make one from scratch.
My question is, what is the best method for setting up the structure?
I'm thinking I will need a menu item object, each of which will have to have their own item array list, etc...
Is it considered sloppy to have recursive coding like that? (Ie an object which contains objects of itself, which contains objects of itself, etc...)
I'm thinking I can give the item object a draw interface which checks itself to see if it has an item array that is not null. If it does, it executes the draw command all the way down, thereby giving me a menu with (for my purposes) unlimited submenu level
In my opinion your approach is fine. In nearly all UI frameworks, views contain views as subviews after all.
But the thing is that writing drawing code is too much work for small projects I think. I would consider using a UI framework such as QT and use its view mechanism as a starting point. You can write your own Menu class which will be a subclass of generic View class in the framework.

(Qt) How to implement editorOpened(index) and editorClosed(index) signals in a view

I've coded myself into a corner sort of with my data abstraction scheme and it's resulted in my needing editorOpened(QModelIndex) and editorClosed(QmodelIndex) signals in my views (QTableView almost exclusively).
The reason being that my data classes have automatic behavior that needs to be block/disabled during editing, then re-enabled afterwards.
At first I thought to try to do it with custom delegates but ran into problems for a couple reasons: one being just that it seems a bit excessive to use a custom delegate providing the same behavior for every single item, in other words it seems like it ought to be done for all items by the view itself. The second problem being that the delegates seem to be const which prevents me from setting an internal handle to the data object within the delegate.
Looking at the view methods, I found QAbstractItemView::edit and QAbstractItemView::closeEditor which would be perfect candidates for re-implementing with opened() and closed() signals, however I need an index/handle to the specific item being edited, which I don't think I can obtain from within those methods...
At this point I have no idea what else I could do. I'd appreciate any tips or pointers in the right direction! Thanks for reading
I solved it on my own...
I found QAbstractItemDelegate::editorEvent which is non-const (I must have not been looking as closely as I thought when reading the docs before).
I was able to set an internal handle in the custom delegate within this method, which allowed me to simply create a slot to do what I needed upon closing, and connect the closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint) signal to it.