egrid 4 grid gadget - (static PB library version.)

Developed or developing a new product in PureBasic? Tell the world about it.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Ah yes, this will be because Windows is ignoring the fact that egrid has taken over the painting of all cell contents and I do not use the default margins in order to align the text with the edit control used.

Believe me, this alignment (allowing for left, centered and right justified text) has taken hours and hours to get right and means that a double-click resize will be out by a couple of pixels.

egrid version 2 did not suffer from this problem because in that version, the selection border was drawn outside of the selected cell and so did not have to be accounted for.

Placing the cell border inside the selected cell (where it rightly belongs :) ) has necessitated a couple of minor sacrifices to be made.

I think you'll agree that it is only a minor deal and one not worth the effort of bothering with.

(Now agree damn you! :D )
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

**Bugs fixed - 11 October 2006.
  • Double-click column resize did not work when there was no CellCallback function defined.
  • Multiline text did not display the ellipsis when a single line could not be broken.
Next upload will include the fixes.
I may look like a mule, but I'm not a complete ass.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

srod wrote:I think you'll agree that it is only a minor deal and one not worth the effort of bothering with.
I guess it's not a huge deal (for me as the developer), but I can imagine one day some fickle user will come up to me and ask me why.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

mskuma wrote:
srod wrote:I think you'll agree that it is only a minor deal and one not worth the effort of bothering with.
I guess it's not a huge deal (for me as the developer), but I can imagine one day some fickle user will come up to me and ask me why.
Tell him his monitor is faulty!

Either that or bash him over the head with an iron bar. It works for me!

:)
I may look like a mule, but I'm not a complete ass.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

srod wrote:bash him over the head with an iron bar. It works for me!
:lol: Thereafter, the complaints will certainly subside.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Yep, I've always said that it's worth investing time and effort in building customer relations.

It pays dividends in the long run!

:wink:
I may look like a mule, but I'm not a complete ass.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

srod wrote:Yep, I've always said that it's worth investing time and effort in building customer relations
Most of my current users are mates or close colleagues - we have a mutual arrangement where they can bash me when I screw up, or I can bash them when they introduce a new feature request. But for others, I need to put away the bat..

Back to the matter - if it's out (consistently) by a couple of pixels, is it not possible to simply compensate by adding a value to the result returned by the width calculator? Or I guess the amount is likely to compensate dependent upon the font used.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

The calculations involved in setting the margins run roughly along the following lines:
  • Is xp themes enabled? If so are gridlines being used? If so make a whole bunch of adjustments ...
  • if not xpthemes, but gridlines enabled...
  • else calculate default margins
  • Is the item being painted within the first column (not always column zero)? If so make certain adjustments...
  • is text right justified? If so, compensate slightly...
  • Is multiline text enabled? If so, adjust vertical margins to centre the text vertically.
Now the above excludes the calculations necessary to position the edit controls used to edit text based cells etc. which are just as fiddly.

This is on top of some fiddly code to ensure things are painted in the correct order - requiring some bullyboy treatment of Windows!

Having spent the best part of my formative years getting these alignment issues running smoothly, I am very reluctant to alter any part of it. Even a single pixel adjustment will throw the whole lot out and undo a lot of work.

I read with interest an article by some guy who produced a similar grid control using MFC. He spent 4 years on it and had many of the same issues - many of which came down to individual pixels etc.

:)
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

**Bug fixed - 11 October 2006.
  • The unicode version of the egrid library would not accept registered users password.
Next upload will include the fix.

Also, despite the rant and rave above about being unable to fix the double click column resizing issue, - I've fixed it! :oops:
I may look like a mule, but I'm not a complete ass.
rw
User
User
Posts: 27
Joined: Mon Sep 04, 2006 9:55 pm

Post by rw »

Hi Stephen!

There is a glitch with the selection border.

Try your demo1 but without gridlines.

The botton line of the border is not drawn correctly.

Regards

rw
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

That'll be because of all the ammendments I've been making by way of requests. :)

I'll have a look.

Thanks for the report.
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Fixed.

The problem was that in ammending the code to allow for multiline text, I'd forgotten about taking gridlines into account. More accurately, I'd not taken the fact that there may not be any gridlines into account!

I'll upload new versions tomorrow as I'm working on the help manual now. And it's slow going!
I may look like a mule, but I'm not a complete ass.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

srod wrote:Having spent the best part of my formative years getting these alignment issues running smoothly, I am very reluctant to alter any part of it.

some guy who produced a similar grid control using MFC. He spent 4 years on it
Just what I thought.. so 7.50GBP for many years of honing.. folks, this grid is the bargain component of the decade :wink:. Get it while it's cheap.

Seriously, it's fantastic to get this level of support and dedication, though it's a part-time endeavour. My hat off to you srod!
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

mskuma wrote:
srod wrote:Having spent the best part of my formative years getting these alignment issues running smoothly, I am very reluctant to alter any part of it.

some guy who produced a similar grid control using MFC. He spent 4 years on it
Just what I thought.. so 7.50GBP for many years of honing.. folks, this grid is the bargain component of the decade :wink:. Get it while it's cheap.

Seriously, it's fantastic to get this level of support and dedication, though it's a part-time endeavour. My hat off to you srod!
Well said. Agreed.
Dare2 cut down to size
stubbsi
User
User
Posts: 50
Joined: Tue Jul 04, 2006 8:59 pm
Location: Mt Martha, Australia

Post by stubbsi »

looks like this is the australian agreement post...

Agreed!!!
Vincit qui primum gerit
"The Old Farts Wins" or "He Conquers Who First Grows Old"
Post Reply