I want to show my tab/menu bar items on the top instead of bottom using Xcode.How to do it? - uitabbarcontroller

I want to show my tab/menu bar items on the top instead of bottom using Xcode.How to do it?
I am Using Swift5 and Xcode 11, but not able to show my tabs on the top.

Working example :
Create a new file.
Select source cocoa touch class.
Designate subclass of: UITabBarController
Name the class "CustomTabBarController" or whatever you'd like.
Add the following code to the class.
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
var tabFrame:CGRect = self.tabBar.frame
tabFrame.origin.y = self.view.frame.origin.y
self.tabBar.frame = tabFrame
}
If you're using storyboard make sure to change the tab bar class to your custom class via the "Identity inspector".

Related

How to add a separator to Gio::Menu

I'm writing an application using GTK3 and gtkmm. I'm adding a menu button to the header bar. So far, I got items to show up, but I can't add a separator.
Here's where I create the menu:
auto main_menu = Gio::Menu::create();
...and add some items:
main_menu->append("Export to WAV", "app.exportToWav");
main_menu->append("About", "app.about");
And here's what I get:
But I want to add a horizontal line between the two items. There seems to be no obvious way to do this with Gio::Menu, and I want that popover. I tried adding an item with "-" as its content, but that did nothing. Gtk::SeparatorMenuItem exists, but it doesn't seem to be compatible. Is this even doable with this kind of menu?
I've figured it out. Turns out, with Gio::Menu, you don't specify "separators," per se. Instead, you specify sections.
Essentially, what this means is creating multiple menus, and then grouping them all together in a single menu using the append_section(Gio::MenuModel) function.
Here's what I ended up doing:
// Create master menu
auto main_menu = Gio::Menu::create();
// Create menu sections
auto main_menu_section1 = Gio::Menu::create();
auto main_menu_section2 = Gio::Menu::create();
// Add item(s) to first section
main_menu_section1->append("Export to WAV", "app.exportToWav");
// Add item(s) to second section
main_menu_section2->append("About", "app.about");
// Append the new sections to the master menu
main_menu->append_section(main_menu_section1);
main_menu->append_section(main_menu_section2);
Then, each section is separated by a horizontal line:
It's faint, but it's there

Acumatica - How to change the page opened by the edit button (pencil)

I'm trying to customize a page so that the edit button (the pencil icon one) directs the user to a specific page. In my case, the edit button is linked to a BAccountID field :
By default, it opens the Business Account's page (page CR303000):
I would like it to open a different page that I created that has a similar BAccount view (page AR303001) :
Can this be done ? And how ? I can't seem to find the code behind this logic.
The target graph is declared in the PXPrimaryGraph attribute decorating the DAC.
BAccount DAC is a special case that uses a more complex attribute (CRCacheIndependentPrimaryGraphList) that inherits from PXPrimaryGraph.
[CRCacheIndependentPrimaryGraphList(new Type[]{
typeof(CR.BusinessAccountMaint),
typeof(EP.EmployeeMaint),
typeof(AP.VendorMaint),
typeof(AP.VendorMaint),
typeof(AR.CustomerMaint),
typeof(AR.CustomerMaint),
typeof(AP.VendorMaint),
typeof(AR.CustomerMaint),
typeof(CR.BusinessAccountMaint)},
new Type[]{
typeof(Select<CR.BAccount, Where<CR.BAccount.bAccountID, Equal<Current<BAccount.bAccountID>>,
And<Current<BAccount.viewInCrm>, Equal<True>>>>),
typeof(Select<EP.EPEmployee, Where<EP.EPEmployee.bAccountID, Equal<Current<BAccount.bAccountID>>>>),
typeof(Select<AP.VendorR, Where<AP.VendorR.bAccountID, Equal<Current<BAccount.bAccountID>>>>),
typeof(Select<AP.Vendor, Where<AP.Vendor.bAccountID, Equal<Current<BAccountR.bAccountID>>>>),
typeof(Select<AR.Customer, Where<AR.Customer.bAccountID, Equal<Current<BAccount.bAccountID>>>>),
typeof(Select<AR.Customer, Where<AR.Customer.bAccountID, Equal<Current<BAccountR.bAccountID>>>>),
typeof(Where<CR.BAccountR.bAccountID, Less<Zero>,
And<BAccountR.type, Equal<BAccountType.vendorType>>>),
typeof(Where<CR.BAccountR.bAccountID, Less<Zero>,
And<BAccountR.type, Equal<BAccountType.customerType>>>),
typeof(Select<CR.BAccount,
Where2<Where<
CR.BAccount.type, Equal<BAccountType.prospectType>,
Or<CR.BAccount.type, Equal<BAccountType.customerType>,
Or<CR.BAccount.type, Equal<BAccountType.vendorType>,
Or<CR.BAccount.type, Equal<BAccountType.combinedType>>>>>,
And<Where<CR.BAccount.bAccountID, Equal<Current<BAccount.bAccountID>>,
Or<Current<BAccount.bAccountID>, Less<Zero>>>>>>)
},
VerifyRightsBy = new [] { typeof(CR.BusinessAccountMaint) })]
There is no way to easily customize this attribute. To change it would you need to replace the BAccount DAC with another one. The preferred method for your use case is to avoid usage PXPrimaryGraph attribute by using a regular action button.
The action button can be configured to show the pencil icon:
Make PXButton appear as pencil icon
And it can be displayed beside the field using PXLayout Merge property or you can use LinkCommand to redirect:
https://stackoverflow.com/a/60446714/7376238

Flex/FlashBuilder :: Spark List / IconItemRenderer:: Disable Selection Highlight / No Selection / Remove Selection

I had trouble removing the selected and down state colors for a spark list using IconItemRender. If you are making a mobile app and using IconItemRender (instead of ItemRenderer) there is no autoDrawBackground property.
I figured I'd drop it in here after figuring it out thanks to this page: http://www.sajeevkumar.com/2012/01/08/flex-4-6-list-mobile-iconitemrenderer-background-image/
You can do the following to muck around with the down and selected colors. For more control over items in a list using IconItemRender look at the LabelItemRenderer class and the drawBackground function.
override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void {
var bgColor:uint = 0xffffff;
graphics.clear();
graphics.beginFill(bgColor,1);
graphics.lineStyle();
graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
graphics.endFill();
// Draw the separator for the item renderer
super.drawBorder(unscaledWidth, unscaledHeight);
opaqueBackground = bgColor;
}

JList in JScrollPane messes up JPanel height

I have a weird problem that I can't seem to solve. I've got a JList which has to be able to scroll if there are more items in it then can be displayed. However if I put the JList in a JScrollPane, it doesn't utilise the full height of the EAST part of the BorderLayout it's in.
Example without JScrollPane:
public UsersPanel(){
String[] userList = new String[]{"Foo","Bar","Foo","Bar","Foo","Bar","Foo","Bar","Foo","Bar","Foo","Bar","Foo","Bar"};
JList users = new JList(userList);
add(users);
}
Example with JScrollPane:
public UsersPanel(){
String[] userList = new String[]{"Foo","Bar","Foo","Bar","Foo","Bar","Foo","Bar","Foo","Bar","Foo","Bar","Foo","Bar"};
JList users = new JList(userList);
JScrollPane sp = new JScrollPane(users);
add(sp);
}
I want a JList that utilises the full available height of the EAST part of the BorderLayout it's in. I've tried wrapping my JList inside another JPanel, but that doesn't solve my problem either.
use setVisibleRowCount() method to set number of visible rows in Jlist.
users.setVisibleRowCount(10);
One hack that I've used successfully before is to add a ComponentListener to parent component of the JList / JScrollPane, and as it changes reset the preferred size of the JList and/or Jscrollpane via (pseudo-code) setPreferredSize(getPreferredSize().width, parentHeight)

How to programmatically create/build up a CTabCtrl?

Without using the "Graphic Resources" how can I create and build up a CTabCtrl?
What I have so far creates it, but I don't know the MESSAGE_MAP for it. Also how to create different views for each "tab" as apposed to displaying/hiding controls depending upon what tab was selected?
thx
CTabCtrl *tabMain = new CTabCtrl();
tabMain->Create(WS_CHILD|WS_VISIBLE|TCS_TABS|TCS_SINGLELINE,CRect(700,100,1000,600),this,5);
TC_ITEM ti;
ti.mask = TCIF_TEXT;
ti.pszText = _T("Tab0");
tabMain->InsertItem(0,&ti);
ti.pszText = _T("Tab1");
tabMain->InsertItem(1,&ti);
ti.pszText = _T("Tab2");
tabMain->InsertItem(2,&ti);
The last parameter you pass to the Create function is the Id which you should use in the MESSAGE_MAP .
For eg:
ON_NOTIFY(TCN_SELCHANGE, 5 , OnSelchangeTab)