 |
|
 |
I try sample and find a bug:
if mouse down at column header and move out cursor from it
header stay clicked.
|
|
|
|
 |
|
 |
I want to hide the context menu when :
- I double click on a cell and right click on the active cell.
can someone tell me hopw to block the context menu from popping up.
|
|
|
|
 |
|
 |
Hi,
I really appreciate your (WTL GRID writer) job!
You are a real pioneer of WTL-based grids, but - forgive me - I do not understand how one can write source code this way (as WTL GRID is written).
This code should be given as an example "how to not to write a code"!!!
- no comments - it seems you write your code for yourself
- coding style - your code is not readable at all (bad naming convention, no spaced between function parameters, related members/functions are not put in some blocks, etc.
The most important is that there are no comment of your code. I do not understand what did you generate Doxygen docs for if your code is not commented?!?
As I realized this article (and the code attached) is very old, there is a newer version on your Web Site, but you've not mentioned about the new version in this article.
I know it os Open Source software, you make a big contribution to the Open Source community and developers but your code seems to be usable at all
if developer does not no how to use it. Developer is forced to read and analize your code very carefully but shouldn't. Please, try to feel as you read WTL Grid code for a first time.
Open Source software is ALWAYS well documented and commented.
When you write Open Source write it well or do not publish it at all.
Open Source software should provide as good quality of code.
Simply, I do not understand why CodeProject published it in this poorstate.
I'm not going to attack you. I'm not at all.
Best regards
mloskot
|
|
|
|
 |
|
 |
Hello,
Thank you for your comments,
While WtlGrid is certainly not a example of clean code I don't think it deserve such a critics. I find the structure easy to follow :
a class for a cell, a class for a column, a class for a collection of column, a class for a row, ...
The naming convention is a matter of taste, personally I hate Hungarian notation and I don't use it.
I have put the whole source in one .h for convenience, but of course feel free to cut it in part for an easier grasp.
Last, I don't feel that a lot of comment would help, I think that structure is more important.
As you know, there is a newer version on http://www.gistek.net, you will find doxygen generated docuentation, but still not a lot of comments I'm afraid.
Wtlgrid was my first try at Wtl, I wouldn't write it that way today.
As for CodeProject, they publish what you submit, if its crap, don't use it, after all its free.
|
|
|
|
 |
|
 |
You are right that code does not dererve such a critics as I gave.
But you should understand me when I tried to use your code, where no comment exists
I understand your point of view about coding style, but as I understand
your code is "a kind of" part of WTL. So, WTL style should be followed.
The doxygen-based documentation is not helpful at all for me.
There is only list of classes and list of members of those classes.
I wanted to use your WTL GRID and planned to contribute and add some features, but I gave up, I'm not able to do it.
Besides my critics, I really appreciate your effort.
Best regards
Mateusz Łoskot
|
|
|
|
 |
|
 |
I wanna to put together cells!
This grid is not support. because...WtlGridRow is only one line cells.
plz..can you modify wtlgrid?
|
|
|
|
 |
|
 |
This code is full of BUGS!!!
I am tired of cleaning it...
For example when your creating empty grid with multi-row selection mode and pressing mouse in empty area of grid... the proga CRASH!!!
Second: wrong redrawing of horisontal lines of grid (try to add about 60 lines)
And so on...
Voland
|
|
|
|
 |
|
 |
??? Collapsible tree like behavior.
www.softwife.com
|
|
|
|
 |
|
 |
Ok, first off, thanks for submitting this article -- I think the intent is good, and I do appreciate it.
However, there are several problems here that should be addressed:
1. Lack of comments. If you're submitting code to a public website, please please please comment it, so you don't force developers to pour over your (excuse the criticism) somewhat poor design.
2. Bugs. There are some really obvious ones -- even in your demo app, the toolbar has no buttons, and leaves draw traces when resized. You must have noticed this when testing... why not fix?
The problem another guy here mentioned with inserting your class into a dialog is also a bug: in the construct() function, you take rcDefault, and then expect an OnSize call to actually size your inner window. In a dialog, you won't get an OnSize call if the window is created with the correct size in the first place -- once again, easily fixed, but annoying as hell.
3. Examples. You provide no examples of how to implement the tree functionality in your class, and it's much less than obvious how to do that -- after messing around with your class for awhile I finally gave up, exactly due to this point. If you submit a demo for an article, at least make sure the demo covers all aspects of your class.
4. Design. It would've been nice (and user-friendly) to nest all your internal classes within WtlGridWrapper class, so they don't clutter up the ClassView window of the IDE. One tiny change, but really helpful.
If you work with WTL, you should follow WTL class naming conventions, such as putting a C in front of your class names, and using standard function and variable names. (Get/Set, etc)
Anyway, once again, I do appreciate the work that went into making this, but I think attention to small details (and COMMENTS!) is really important when submitting code to a public web site.
----------------------------------------
----I said my name wasn't important
---------------------------SlartiBartFast
|
|
|
|
 |
|
 |
If you work with WTL, you should follow WTL class naming conventions, such as putting a C in front of your class names,
One link: http://www.jelovic.com/articles/stupid_naming.htm
|
|
|
|
 |
|
 |
roel_v, you are right, but there is a little "but"
Eugene explains it this way:
"If you work with WTL, you should follow WTL class naming conventions, such as putting a C in front of your class names, and using standard function and variable names. (Get/Set, etc)"
So, _IF_ you work with WTL....then you should stick to WTL coding style.
I agree with you that is isn't very elegant, but going 2 different ways the same time is more not elegant. So, first we (mainly WTL developers) should rewrite WTL code and change current coding style to something less "stupid"
I agree with Eugene which says that when you use WTL you should follow it's style coding but for GUI classes. Not for all, some libraries implementing logic may follow your own style (as it is with STL, by the way STL developers do not recommend to follow STL coding style as a very difficult and not intuitive one)
Thank you Noel for your WTL GRID.
Greets
Mateusz Łoskot
|
|
|
|
 |
|
|
 |
|
|
 |
|
 |
Would you send me the source for the example shown on the web page. I am interested in setting up a control with collapsible rows.
Also, is the source documented anywhere?
Cheers
|
|
|
|
 |
|
 |
Your source is very good.. thank you..
I want to use it in another atl object. Especially in ATL CCompositeControl), not in frame window..
but I can't receive WM_MOUSEWHEEL message..
How can I do that...
Please Advise me..
thank you..
|
|
|
|
 |
|
 |
I want my grid as a control in a dialog.
I've done everything but it just won't show up although it is creating.
What exactly is rcdefault? (I don't see it documented anywhere). Is that the reason it isn't showing? Mine is showing up as 0x80000000 for top and left and 0 for bottom and right.
Or is it one of these fussy windows things where it breaks for any excuse it can find.
(Note: I hate GUI programming. I thought using WTL instead of MFC would get me away from
all these problems but it's just as bad. And when will Microsoft use C++ and use std::string,
especially as a RETURN value to a GetWindowText )
|
|
|
|
 |
|
 |
Ok, now for some serious issues.
It is not a good idea in STL to store collections of editable objects.
Why? Because in order to change them you have to return pointers or non-const references to the actual elements in the STL collection. That is fine if the collection will always remain static, but in this case it is flexible.
If any row or column is added or deleted anywhere, all your pointers could become invalidated. In addition it is quite expensive as you are copying collections time and again.
What you should use is an array of smart (reference-counting) pointers. To do that your row column and cell/value classes should contain their own reference count and your collections will be of these smart pointers. (There are various smart-pointer templates available. I use my own, but you can get them at boost and possibly at this site).
Incidentally, I changed the WtlGridCell class to be derived from WtlGridValue rather than contain it, as it exposed an identical interface extended.
I also made the listener pointer a smart pointer within the WtlGrid class. (I cannot give you my actual code changes without getting permission).
|
|
|
|
 |
|
 |
Ok now for some serious answer,
Its not a good idea to give advice without showing the code,
By the way, the code is copyrighted,
so if you want to play fair,
you should share your enhancment with us.
|
|
|
|
 |
|
 |
I wrote the comment before I had actually made the changes I suggested, and now I have made them and compiled but not tested it. I'm sure nobody here wants to see untested code.
As I have been enhancing it for company use and developed in company time, my enhancements belong to the company I work for and not myself, so I have to get their permission to put them on here. I may get permission to show some of them, just for illustration.
My smart-pointer template is my own and once I have updated my version at home I will make that publicly available. By the way I also made the changes suggested by anonymous2 which was me posting yesterday before I'd registered here.
|
|
|
|
 |
|
 |
common guys, you think as whole Microsoft does.
If you use and modify f.e. GPL code in work time, it becames the company code? No it DOES NOT, it is still GPL code (and you MUST publish the modifications).
And, if Noel published his famous grid and you modify it, you think it becames property of your company? NO, IT DOES NOT.
|
|
|
|
 |
|
 |
The GPL regulates source code and derivative works' distribution. As long as the derivative works are not being redistributed (for the company's exclusive use), the GPL's redistribution clauses do not apply.
If a bank designed ATM terminals using customized GPL'd sources, they would have no obligation to publish their changes until they started distributing their ATM kits to external entities.
|
|
|
|
 |
|
 |
Namespaces:
1. Do not put using namespace std in the header. Use std:: where appropriate instead
(sorry but some of us are fussy about not putting using namespace std in header files)
2. Wrap header in namespace. Either extend wtl itself or create a new one eg wtlx
Inlining:
3. Provide an "inline" version where all the functions are implemented in one "include" file.
This is how the rest of WTL is implemented.
Strings:
4. Is there any need to use CString? I purposely avoid MFC and prefer to use STL strings
as well as their vectors, or use CComBSTR when working with COM.
|
|
|
|
 |
|
 |
CString is also a WTL class, defined in the "atlmisc.h" header file.
Many WTL classes have the same name as MFC classes.
For example, the following WTL classes (also MFC classes) are defined in "atlmisc.h":
// CSize
// CPoint
// CRect
// CString
// CRecentDocumentList
// CFindFile
The following WTL classes (also MFC classes) are defined in "atlctrls.h"
// CStatic
// CButton
// CListBox
// CComboBox
// CEdit
// CScrollBar
// CImageList
Don't criticise unless you are confident that you know what you are talking about!
JusticeMonger
-- Justice will prevail! --
|
|
|
|
 |
|
 |
There is a redraw problem when resizing the form in the example.
The bar above the grid is not redrawn properly.
Raj Sidhu
|
|
|
|
 |
|
 |
Nor does it draw properly at all when I used it in my Dialog.
The row list never gets rendered. (Ok, where is it called? I haven't got a clue how yours worked because mine never draws the rows, and when I tried it there were no borders between the values, and they were all in the wrong place, and they were neither selectable nor editable).
|
|
|
|
 |