i'm learning C++/CLI and i was asking myself if there's any way to customize form's frame parameters such as:
Corner radius
Close,maximize and minimize buttons appearance and position on the actionbar
Border color and thickness
but i found nothing on google about this, does someone know how to do it?
The only idea i have could be to set Formborderstyle to none and drop down on the form those elements again:
Label with custom background for the actionbar
3 Buttos for Close,Maximize and Minimize
But i should then re-do the listener for the label when is holded by the mouse for re-positioning, what do you think?
Related
First I'll explain what I want to do before seeing the code, the user can click to the PLAY Button and after click, a popup Menu is displayed, the Menu contain 2 MenuItemSprite for play with bot or friend, for the MenuItemImage it's to display a small background around 2 MenuItemSprite.
The problem is when I want to click on a MenuItemSprite inside the Menu, nothing is happening, but when I set enable the Background to false all is okay without any problem, But I don't want this solution because I have inside another background (almost transparent). If the user click to this background, he can hide automatically the Menu, so I said set enable the background to false it'll give another problem conflit between Background (Window) and background (Menu).
Code :
//Background (Scene)
background=Sprite::create(BACKGROUND);
background->setPosition(SonarCocosHelper::UI::GetScreenCenter());
background->setOpacity(0);
this->addChild(background,1);
//Background Menu
MenuItemImage * overlayWindowItem=MenuItemImage::create(GAME_OVER_WINDOW,GAME_OVER_WINDOW,GAME_OVER_WINDOW,NULL);
//overlayWindowItem->setEnabled(false);
//FRIEND ITEM
MenuItemSprite * friendItem=MenuItemSprite::create(Sprite::create(FRIEND_BUTTON), Sprite::create(FRIEND_BUTTON),CC_CALLBACK_1(MenuScene::goToPlay,this));
friendItem->setTag(PLAY_WITH_FRIEND);
friendItem->setPosition(Vec2(-overlayWindowItem->getContentSize().width/4,friendItem->getPositionY()));
//BOT ITEM
MenuItemSprite * botItem=MenuItemSprite::create(Sprite::create(BOT_BUTTON), Sprite::create(BOT_BUTTON),CC_CALLBACK_1(MenuScene::goToPlay,this));
botItem->setTag(PLAY_WITH_BOT);
botItem->setPosition(Vec2(overlayWindowItem->getContentSize().width/4,botItem->getPositionY()));
//menu
menu=Menu::create(overlayWindowItem,friendItem,botItem,NULL);
menu->setPosition(Vec2(SonarCocosHelper::UI::GetScreenCenter().x,SonarCocosHelper::UI::GetScreenCenter().y+screenSize.height));
this->addChild(menu,1);
How I can avoid conflit between MenuItemImage & MenuItemSprite, I want to click on MenuItemSprite, MenuItemImage is just a background.
Thank you,
As I can see in your code, why are you taking overlayWindowItem as MenuItemImage? You are not calling any function (Set to NULL in your code).
Simply take GAME_OVER_WINDOW as an sprite. Please correct me if I am telling anything wrong.
I currently need a small ImageViewer in my project, where you can zoom in and go to next or previous image. These buttons should be fixed at right bottom corner like in this picture:
In this case I have q QLabel which has a Layout with some buttons. But now it should be zoomable, so I need QScrollArea, like explained here. But how I add my buttons again in this example? It is possible to archive this view just with QtDesigner?
Maybe QToolBar will suite your needs. It will make a floating panel over your graphics view. An example. If you need to achieve the background of the toolbar transparent while its buttons are semi-transparent then it is doable as well. But first you need to decide if toolbar works for you.
When a ListView item is selected, its color changes to indicate that it is selected. Now what I want to do is to disable this visual effect and implement my own, so for example I want when an item is selected to draw a rectangle around the item.
How can I do that? (Note that I am talking about the Icon view).
This is a case for custom drawing of controls.
It's all about handling the NM_CUSTOMDRAW notification and then to draw the control more or less by yourself.
I've never done it by myself changing the appearance seriously but I've change background colors of controls using this mechanism.
There is a lot of information about this on the internet...
Hi I am trying to convert an existing WC_TABCONTROL window with TCS_OWNERDRAWFIXED so that I have full control of its appearance.
But it seems all I can draw is the tab headers and even there I do not have much control on how the borders are drawn around tab page as well as tab headers.
Can someone point me to some material that explain how to custom draw, tab items and tab pages. I need to have control on how both the background and borders are drawn.
What's the best way to go about creating a vertical and horizontal ruler bars in an SDI app? Would you make it part of the frame or the view? Derive it from CControlBar, or is there a better method?
The vertical ruler must also be docked to a pane and not the frame.
To make it a little clearer as to what I'm after, imagine the vertical ruler in the Dialog Editor in Visual Studio (MFC only). It gets repositioned whenever the tree view is resized.
I would not use control bars. I have no good reason other then (IMOHO) are difficult to get to do what you want - if what you want if something other than a docking toolbar.
I would just draw them directly on the View window using GDI calls.
I guess I might think about making each ruler its own window, and draw the rulers on their own window. I would then create these two CWnd derived classes in the view and position as child windows. This is good if you want to interact with the mouse on these rulers (easier to sort out what messages are for the rulers).
I ended up deriving the ruler from CWnd as you suggested and skipping the control bar route. This code works in either case:
m_wndSplitter.CreateStatic(this, 1, 3);
m_wndLeftPane.Create(&m_wndSplitter,WS_CHILD|WS_VISIBLE,m_wndSplitter.IdFromRowCol(0, 0));
m_ruler.Create(&m_wndSplitter,WS_CHILD|WS_VISIBLE,m_wndSplitter.IdFromRowCol(0, 1));
m_wndSplitter.CreateView(0, 2, pContext->m_pNewViewClass, CSize(300, 0), pContext);
SetActiveView((CScrollView*)m_wndSplitter.GetDlgItem(m_wndSplitter.IdFromRowCol(0, 2)));