| Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 | 1. How to convert wxString to floating point? #3488 | Hi, I am using wxGrid. I get the value from the cells, but it return wxString. But, i need to get some of the cell of the value to do some calculating... Therefore, i need to convert it to floating point first, after convert back to wxString...
Anyone can teach me?
Thank you....Meow~ | 2. Re: How to convert wxString to floating point? #3491 Posted by: upCASE 2004-03-11 18:17:03 | Hi! To convert a string to a number use one of the following ToLong() ToULong() ToDouble() To convert a number into a string use Format() or Printf(). If you want your grid to take floating point variables you'll have to derive your own wxGridTable from wxGridTableBase and set your table as the underlying table for the grid using SetTable(). I'm currently doing something like that because I need a grid for displaying property values for a resoucre editor. By standard wxGrid uses a wxGridStringTable, that's why it stores all values as strings.
upCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! | 3. Re: How to convert wxString to floating point? #3495 | Hi Upcase, Would you mind to show me the examples about wxGridTable with wxGrid? Thank you.Meow~ | 4. Re: How to convert wxString to floating point? #3499 Posted by: upCASE 2004-03-11 22:00:21 | Hi! I'd really like to, but I'm not finished with it yet. There is a sample for this though. Check out the grid example and browse the source looking for BugGridTable which is derived from wxGridTableBase and implements storing boolean values. Also the source for wxGrid itself is interesting, because there the "standard table" (wxGridStringTable) is implemented. Maybe I find the time to do some more work on my PropertyGrid tonight and I can comment on my findings later on.
upCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! | Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 |
|
|