Resetting Programmatically adding buttons for UITableViewCell Reuse - swift3

In my tableview controller. The images are being added as backgrounds to the button. These buttons are then added to the table view cell on user requirement.
If i show/hide the cell. The buttons with background images from the hidden cell are being shown on the enabled row/cell i.e. overlapping. I have read articles regarding prepareforReuse function. Which can be used if i know the existing properties. In my app the buttons are being added based on user selection.
Is there any way to use prepareforReuse to reset every thing even the buttons which have been added programmatically so that when they are called then overlapping issue doesnt appear.
Main Problem: I cannot give names of my buttons to set their values as nil because i dont know how many will be created. While in prepareforReuse (to reset the cell) i need to provide some property names which exist in cells already.

Related

wxWidgets - Switch between different view on button click

I am making a music application, I have it show like a mini-view of the app as the default view, and I want it to switch to a big view on a button click. The default/mini view has a panel -> sizer -> sub-sizer -> widgets. And for the big view, I have a separate sizer and panel.
The default view looks like this
And when I press the L button on bottom right, I want it to switch to big view which is supposed to look like this
The top panel is empty here, I have not added widgets to it yet. I can provide additional information if required, like code snippets and all. But I want everything to be on the same wxFrame. I have defined all widgets in the constructor, but it overrides the previous panel and sizer. Also I want to be able to switch back and forth between the 2 layouts.
For completely replacing the frame contents like this you may find wxSimplebook useful as you can then just call its ChangeSelection() method to switch pages. You will need to adjust the frame size, e.g. by calling frame->SetClientSize(book->GetBestSize()), after switching pages manually however.

Is is possible to create a tabbarcontroller that does not have elements hidden within "More" section?

I'm currently running into issues similar to the ones described in this post and am wondering if it is possible in a tabbarcontroller to not show the "More" icon and display all of the view controllers in the tab bar?
The issue of reconciling the show and hide becomes problematic if I assume that some views have navigation bars and that a user may change the order of the tabs, so hiding and showing tab bars becomes another facet of the project I will need to keep track of in appearance and disappearance methods.
Per Apple's documentation, the morenavigationcontroller is something that does not is set in the tabbar's vc array, but is merely a property

Update / change store of list component sencha touch

I have an overlay that has a toolbar as a dockedItem and a Ext.List as an item.
This overlay is shown as the user drags the slider to show the important things in each card I have in a carousel. Each card has its own store with data I want to show in the overlay.
I am able to change the toolbar's title while I drag:
this.overlayTb.setTitle(cards[index].categoryName);
but when I try to change the store that feeds my list view, it does work.
this.myList.store = cards[index].store;
It just keeps showing the data of the initial store I set up instead of changing, like the toolbar title does.
I have tried calling doLayout() on myList and Ext.StoreMgr.get('newsStore').load(); as suggested in this answer, but no good came out of that. And if I try:
this.myList.update();
it stops showing the data of the store, and I can only see a blank panel
While debugging, I can see that this.myList.store changes to the store I need, but the view is not updating.
I hope you can help me
Use the bindStore(cards[index].store) method of the Ext.List which properly destroys and cleans up after the old store and binds the new store to the List's events.

How to make checkboxes in a list view control tri-state?

Is it possible to make the checkboxes in a list view control with LVS_EX_CHECKBOXES style tri-state (having BS_3STATE button style)? I'm using WTL but I'm OK manually sending messages around.
Yes, you need an ImageList with 3 images of a unchecked, checked and indeterminate checkbox. Call ListView_SetImageList() to assign the LVSIL_STATE image list. Manipulate LVITEM.state to display the kind of checkbox you want.

MFC - How can I disable a list item?

I have a CListCtrl with checkboxes. I want to be able to disable one of the items so that the user cannot click the checkbox. Is this possible? If so, how?
Edit:
Found the specifics on how to hide a checkbox in another question
Need only some rows in a CListCtrl control to have check boxes
Shortly: Not easily possible.
You'll need to sub-class the CListCtrl and implement this behavior on your own or download for example the MFC Grid Control that allows you to do that.
As for the removing check-boxes idea, yes, that might be possible, MSDN:
Version 4.70. Enables check boxes for items in a list-view control. When
set to this style, the control creates
and sets a state image list with two
images using DrawFrameControl. State
image 1 is the unchecked box, and
state image 2 is the checked box.
Setting the state image to zero
removes the check box.