Implementing a custom header bar for chromiumembedded - c++

I have built the chromiumembedded cefsimple project successfully with visual studio. I need to know whether I could implement a custom header bar instead of below.
Eg: with a separate favicon and Title being set as a custom manner .. etc.
Your kind help is really appreciated.
Thank You !

If you are based on CefSimple, take a look at simple_handler_win.cpp. In SimpleHandler::OnTitleChange(), you can set the window title to what you want, instead of what CefSimple wants by changing the SetWindowText() call. This will appear shortly after launch, replacing the app name.
To change the app icons, just replace the icons in the projects cefsimple.rc.
If you want to change them dynamically, that will be a bit more work.

Related

How to fix not working keybind in WebStorm IDE

I generally have a bunch of custom keybinds for WebStorm, but this one particularly does not work - Select opened file. I've bound it with different key combinations (see screenshots below), and also I've verified that it does not conflict with any MacOS keybinds (although even the ones that conflict actually do work).
Also when I hover the actual UI button, it shows different keybind for it (which also does not work).
So, essentially, I have to always click the UI button with the mouse. I'd like to be able to do so with the keybind. I'm not even sure how to troubleshoot this...
Does anyone else using WebStorm have this keybind working properly?
It's a known usability issue, IDEA-271054. The actual action you need assigning a shortcut to is Other | Select File in Project View:

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.

How to edit plugin to use the theme's template files

I am using a theme called Hemingway, it's a great theme with three page layouts. (full-width, with sidebar, without sidebar). This is all working great. I can choose one of three options in page settings.
I'm also using the Projects plugin by Woothemes. This plugin makes it easy to add recent projects with a photo gallery and some other options. It's working when I'm using the shortcode:
[projects limit="12" columns="2" orderby="date" order="desc" exclude_categories=""]
I'm using this shortcode with two columns on a full-width template. This is working great, but when I'm trying to use the functionality to automatically add the content of projects to the page using the option built-in Projects:
The full-width template is not working and the sidebar is shown. Also the two column layout for projects is not working. They just aligned beneath eachother.
How it should look like (this example is with shortcodes):
http://hoveniersbedrijfameland.nl/projecten/
How it looks with the option in projects to choose a page: (this is wrong)
http://hoveniersbedrijfameland.nl/projects/
How can I debug this to see what breaks it?
What I tried so far:
I've tried the plugin to behave like I want. This means, that the
plugin will use the full page template for 'categories' instead of
using the archive page. I don't really know how the plugin is build,
so it's hard to eit the right file.
I've tried a workaround with url routing, but this isn't the best
approach.
I found a solution. I copied the archive-project.php file to my theme and edited the content with the ones in the full-width template. I need to style it myself because the pages are broken if I leave it like that.
If I want to edit page template now, I need to code it in the ffile instead of choosing it from the pages > page layout in the admin panel.
I'll fix that later.
FINAL UPDATE: I hardcoded everything and it's working for me now. I don't need any further help, I'm now looking into the custom post types to change the content template.

How can I visually design a component in C++ Builder?

I have been away from C++ for a couple of years now doing AS3/Flex work. I have gotten used to being able to create a component and place it in design mode with very little fuss and I am struggling to get my head around the C++ Builder way of doing the same thing.
I have written many components for C++ Builder in the past, but none of them have been visual. What I would like to do now is create a component for customer search and another for order processing because I want to be able to create a new instance of these on the fly. What I don't want to do is have to place each of the components like the dbgrid and search fields manually in code. I would like to do this (as well as set their properties) in design mode.
How do I go about this? I have browsed the source for other Delphi components and I notice they have dfm files which seems to be what I need. How do I do this in C++ Builder? The only option I see is to add a new form if I want a dfm, but this isn't what I want as my components will be based on TPanel.
Is there a way to do this or do I have to resort to doing it all in code with no visual reference?
Pursuing the DFM idea I did a test this morning where I created a component based on TPanel and added a new form to it which I create and parent in the constructor of the component. In design mode I set the form border to none and placed a grid on it. This all looks OK until I place the component in my application, at that point it looks like a panel with a standard looking form in it and the grid is missing. If I run the app the panel shows as expected, borderless and with a grid. The DFM appears to be ignored in design mode for some reason.
If you know a better way to do this than using components then please give me some pointers.
Any help and advice will be appreciated beyond words
You might want to have a look at frames (look for "Frame objects"). They are "subforms" you can design visually and then place on forms.
Just as an FYI item, you can also drop the panel on a form, put any other controls on it, position them, set captions, etc..
Now, click the panel to select it, and use Component->Create Component Template from the IDE's main menu. This creates a unit you can install as a component which will add the panel and it's sub-controls (as a single component) to the IDE's component palette.
Of course, you can then modify the source for that new component like any other component source.

Win32Api - Window Name Property

Is there any way to get a control's name through win32api? (c++)
I'm talking about the property that in C# is 'Name', like 'frmMain', or 'btnNext'.
Is there any way to retrieve this data through the win32API?
I've tried GetWindowInfo() and stuff but I think I'm not heading in the right direction..
thanks
edit: I'm iterating with EnumChildWindows() and I got the correct HWND.. not sure if I can use it to print it's name.. (im a c++/win32 absolute noob)
Added 7/10/09
By the way I found this really good tool to operate win32 apps.
http://www.autoitscript.com/autoit3/
Check it out looks good and looks like it's freeware? :)
The name of a control is usually a private variable of the control and is not exposed to win32. You could try GetWindowText to get the title of some controls or GetWindowLong to get some properties, but I don't think you can get the name of most controls.
I seriously doubt that this information is even in the executable code, I would think that from the c# compilers point of view these symbols get reduced to object pointers or window identifiers values (the IDC_ mentioned above).
Having been faced with this type of problem before I chose to create hidden static text controls with identifying text on each window to provide this named window capability to an external process. Not very elegant but solved my problem at the time.
The name property is something added, AFAIK, by the compiler. Win32 does not, inttrinsicaly, support naming like this.
In C/C++ one uses the IDC_* value instead with the added bonus that integer comparisons are far faster than string comparison.
Edit: Btw Its possible to use the IDC values mentioned above to get child controls of a dialog by using the GetDlgItemInt( hDlgWnd, IDC_* ) to get an HWND to the control. Far easier then using EnumWindows ....