How to change the value of wxDatePickerCtrl? - c++

I have tried this, But I am not able to get date displayed on the datePickerCtrl.
Here SDOB is a wxDatePickerCtrl.
SDOB->SetValue(Rs.GetDate(3));
But I am able to get the date onto a label or text field by doing
wxStaticText11->SetLabel(Rs.GetDate(3).FormatDate());
But for my purpose I would like to get it onto the datePickerCtrl itself. Help!
Also where can I find good documentation with examples for wxWidgets? I am a beginner.

You're using the correct function for setting wxDatePickerCtrl value, so if you don't see what you expect, the date you pass to it must be invalid or otherwise different from what you think it is. Generally speaking, when asking about why something doesn't work you should explain both how do you expect it to work and what actually happens because otherwise nobody else can know what's really going on.
The documentation for this control is at https://docs.wxwidgets.org/3.1.4/classwx_date_picker_ctrl.html as could be expected and there are a hundred of examples distributed with wxWidgets, so if you want to see an example of this class in action, I recommend doing grep -lR wxDatePickerCtrl samples in the directory containing wxWidgets sources.
Good luck!

Related

How does GDB pretty printer know the output format the user is requesting?

I have a few complex classes generated by a third party domain-specific tool. The classes are complex because the tool tries to be generic as much as possible, so that I was asked to design a GDB pretty printer python script to improve the debugging experience.
I designed it by "to_string" APIs which can print the information with organized rich text (e.g. colors), so far everything works fine.
However, I don't know how to get the output format user requests, no matter that user uses "p" or "p/x" will all output the same string because my script does not know user wants hex rather than decimal.
I tried googling but didn't figure out an elegant approach. I indeed have a few workarounds but they all change the usages (for example, implement two printers to be switched), please give me some suggestions, thank you.
Just realized there had been a feature request to GDB already.
Bug 17291 - IWBN if the print format was available to pretty-printers.

Why doesn't Find-String work on the output from Powershell commands?

I don't know if this is a problem on a larger set of Powershell library commands, but I'm using the Share Point Online library right now and can't get this to work:
Get-SPODeletedSite | Select-String "100060-24"
I can see that this string exists in the output if I just type "Get-SPODeletedSite", but when I try and filter for just the line that contains this text, it comes up empty. What's going on here? This is a basic piping operation.
PowerShell is an Object-Oriented language. As such, it is designed to work with Objects (Structures). PS has builtin instructions on how to present Objects on the screen but that is for display purposes only. That's the best explanation I can provide. Maybe someone with a better overall understanding of PS could offer a better explaination.

Printing text in different colours in the Windows CMD

I am planning to make a console game in C++, kind of like Dwarf Fortress (although I don't know if it was coded in C++), but I have encountered a big problem.
I want to display different things in different colours on the screen at once. I also need to change something that has already been printed (so that I don't have to re-print everything and make the screen flash annoyingly, especially that I will want to make changes every second or so) and I found a way to do that with WriteConsoleOutput() and although I don't know yet exactly how to use it, I'll be reading into it soon.
As for the colours, I found a post here about some ANSI Escape things, but it
a) doesn't work, even when copying the linked code from github
b) I don't know if it'll work with attempts to over-write the console in specific places with WriteConsoleOutput()
So my request is: could someone please ELI5 to me what am I supposed to do and why, as well as present with a viable solution to this combination of two problems so that I can replicate something like this, with the possibilty of changing what the characters show.
Thanks in advance!

Good coding patterns in RShiny applications?

What are some good resources/examples for good coding patterns to follow in RShiny applications?
I feel I am following two bad patterns in the shiny applications I am creating.
To make things react to user changes properly, I seem to end up wrapping most parts of server.r in observe().
At the beginning of each observe(), I want the expression to rerun if any one of a whole bunch of inputs change.
Ideally, I would like to put input[change_set] where change_set is a character vector of input names, however this gives an error of Error in [.reactivevalues: Single-bracket indexing of reactivevalues object is not allowed.
(or if I use input[[change_set]]: Error in checkName: Must use single string to index into reactivevalues)
What I end up doing to make things work is including multiple lines of input$var1, input$var2, ..., input$var15. This feels very wrong.
I am not making use of any functions like: reactive(), reactiveValues(), isolate(), withReactiveDomain(), makeReactiveBinding(), ... . I am guessing that I probably should be, but I don't know how to use them.
The solution to this problem is likely to be me rereading the small print in the documentation and reading code from example applications. Does anybody know any good quality resources for this?

Vim OmniCppComplete on vectors of pointers

I might have done something wrong in the set up but is OmniCppComplete supposed to provide the members/functions of classes when doing this?
vectorofpointers[0]->
At the moment all I get when trying that are things relating to the vector class itself, which obviously isn't very useful. I think it might have been working before I tagged /usr/include/ but I could be wrong.
Also, is it possible to disable the preview window? I find it just clutters up my workspace. And since I enabled ShowPrototypeInAbbr I don't really need it.
Thanks,
Alex
I do not think it is possible to get proper code completion on the objects that are included in the vector, but someone please correct me if I am mistaken.
To disable the preview window, make sure to not set preview for the the completeopt option, type :help completeopt in Vim for more information.
We finally have sane code completion for C++ in Vim using GCCSense. With GCCSense it is possible to autocomplete on the contents of a vector.