Static wxRichTextControl? - c++

I want to create an Help page for my wxWidgets application, which consists of only text of various fonts, sizes and colors. I tried achieving that with wxStaticText's and sizers but I was having trouble so I switched to a wxRichTextCtrl, which I like to use. The problem is, the text should of course be non-modifiable. I know of the existance of the wxRE_READONLY flag, but it doesn't hide the caret that appears when I click on the text.
Isn't there some kind of wxRichStaticTextCtrl that works exactly like a wxRichTextCtrl, but is readonly by default and doesn't have this problem? I tried looking online, but to no avail.

The best solution for "rich" static text is wxHtmlWindow: this allows you to just define your help contents in terms of simple HTML which is usually more than enough.

Related

How to use images in GTK Stack Switcher

I'm writing an application using C++ and gtkmm. I made a Gtk stack in it. Now I want to add images instead of text on stackswitcher's buttons. I assume that it's possible because something like this is made in gtk3-demo:
Unfortunatelly the example is made using UI file and I want to do it without UI designer. For now I found this answer:
But it's not very helpful to me. The answer was to use stack.child_set_property but I checked gtkmm documentation for stack and there isn't anything like this for C++. The closest match was Gtk::Stack::child_property_name with adnotation that it returns A ChildPropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes. I suppose this may be the thing i'm looking for, but due to lack of examples I have no idea how to use it.
To sum up: Is anyone able to tell me how to set an image as StackSwitcher's label?
Ok, it seems I've found an answer. I'll post it if anyone needs it in the future:
To change Stack Switcher's text label into image I just needed to do that:
stack->child_property_icon_name(ChildName) = "Icon Name";

What is the best way to fin and use a template in cakephp 3

i'm new in cakephp and I have started with version 3. I want to build a beautifull app and because I'm not good in design, I would really like to use a free template or buy one that I can use within cakephp.
So, I would really appreciate all your propositions and ideas or best practises. The easy way will be the best because I don't have a lot of time with this project. Thank you in advance.
If you don't have a lot of time like you mentioned, the easiest way to go ahead and get started is to paste a lot of the code in your default.ctp layout inside of src/Template/Layout/default.ctp.
You'll notice there are some lines of PHP already in there that are relevant to fetching blocks of css, meta tags, and other bits of code that could potentially exist throughout your project.
Find the main layout of the theme your trying to use - the one that will be consistent across most of the pages. That's the one you'll use for default.ctp. Compare what's already in default.ctp and make the comparable adjustments around the HTML in that document while keeping the important lines of PHP there as well.
For other important pages like a login or registration page, just create a new document for those, like 'login.ctp', then inside the function that loads the page (maybe 'login' inside of UsersController'), change the default layout with this line of code:
$this->viewBuilder()->layout('login'); // without the .ctp ending
This way you can create one-off layouts that don't really match any other page.

Customizing CMFCRibbonBar im MFC

I am trying to customize the default MFC RibbonBar. I need to reduce its height, change its color etc, but so far i haven't found anything on how to do so. I've been to msdn, and they just tell you how to add new controls on the ribbon.Can any one please point me in the right direction? Is this ribbon control even customize-able? i mean apart from adding categories and other controls on it, i want to change the look of the ribbon.
Some code samples about how to work with MFCRibbonControl would be of great help too.

Is it possible to reference individual tabs of a QTabWidget by tab number?

Very quick question here. I was wondering if it is possible for me to reference individual tabs from a QTabWidget by number. This will save me a lot of time, as I am generating an unknown number of tabs during run-time. I could not find anything in the QT documentation, but I feel like this is a very basic feature that should be included. I am thinking something like this (not real code just an idea, I realize tabNumber() doesn't exist):
ui->tabArea->tabNumber(12);
If there isn't a public function, perhaps there's some other way? Please don't suggest referencing tabs by name because that is out of the question (potentially 100's of tabs), and I have already tried it.
If you want the tab with a certain index, use widget():
QWidget* tab = tabWidget->widget( index );
I think the setCurrentIndex() method is what you are looking for.

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 ....