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

Developed or developing a new product in PureBasic? Tell the world about it.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

srod wrote:I'll give the virtual grids some more thought.
That would be cool - looking forward to hearing any update about that :)
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

e-mail on its way. :)
I may look like a mule, but I'm not a complete ass.
magicjo
User
User
Posts: 61
Joined: Sun May 07, 2006 10:43 am
Location: Italy

Post by magicjo »

Hi srod:
First of all thanks for the quick last replies, and now a few requests:
1) if is possible to show the standard popup of edit string gadget(Cut,Copy,etc..),supposing that you blocking it;

2 )if is possible to know the row previously selected when the egrid loses the focus, instead of manually store the row on event #egrid_losingfocus in someone variable,struct,etc.

3)I've had an invalid access memory using the PURELVSort Gnozal's library, follow a code example :

Code: Select all

If OpenWindow(1,5,5,300,210,"",#PB_Window_SystemMenu) And CreateGadgetList(WindowID(1))
  egrid_CreateGrid(0,5,5,290,105,18,0,#egrid_ResizeColumnsTrue)
  ;egrid_CreateCellCallback(0,@CellCallBack())
  egrid_AddColumn(0,0,"Col1",150)
  egrid_AddColumn(0,1,"Col2",150)
  If PureLVSORT_SelectGadgetToSort(0, #PureLVSORT_ShowClickedHeader_IconLeft) = #PureLVSORT_Ok
    PureLVSORT_SetColumnType(0, 0, #PureLVSORT_String) ; default, not necessary
    PureLVSORT_SetColumnType(0, 1, #PureLVSORT_String) ; default, not necessary
  EndIf
  ButtonGadget(1,5,110,80,30,"Click me!")
  Define i
  For i=1 To 9
    AddGadgetItem(0,-1,""+Chr(10)+"Col1_"+Str(i)+Chr(10)+"Col2_"+Str(i))
  Next
  
  Define Event.l
  Repeat
    Event=WaitWindowEvent()
    Select Event
      Case #PB_Event_CloseWindow : 
        Break : 
      Case #PB_Event_Gadget
        If EventGadget()=1
          egrid_AddRow(0,0)
        EndIf
    EndSelect
  ForEver
EndIf
Execute, then order first column, press button and reorder the first column and crash on WaitWindowEvent() line; on some previous replies you said that might be problems on double subclassing of listviewgadget, therefore who must prey for fix the bug, you or Gnozal ? :o
PB Registered User, Egrid Registered User
Win7 x64 Ultimate, 4,00 Gb Mem, Ati Radeon HD4600 Series, Realtek High Definition Audio Integrated
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

magicjo wrote:Hi srod:
First of all thanks for the quick last replies, and now a few requests:
1) if is possible to show the standard popup of edit string gadget(Cut,Copy,etc..),supposing that you blocking it;
I disabled that for some reason. I think it was causing some kind of problem (memory escapes me now!) I'll try reinstating it to see what happens.
2 )if is possible to know the row previously selected when the egrid loses the focus, instead of manually store the row on event #egrid_losingfocus in someone variable,struct,etc.
When #egrid_losingfocus fires, there is no selected row! Again I did this on request. I'll look into adjusting this so that the #egrid_LosingFocus message notifies you which cell was previously selected etc. You could also use the flag #egrid_AlwaysShowSelection when creating an egrid. This way the selection box will always remain.
3)I've had an invalid access memory using the PURELVSort Gnozal's library, follow a code example :

Execute, then order first column, press button and reorder the first column and crash on WaitWindowEvent() line; on some previous replies you said that might be problems on double subclassing of listviewgadget, therefore who must prey for fix the bug, you or Gnozal ? :o
I really can't vouch for what will happen when you use these libraries together (for one I have not used PURELVSort). Both libs undoubtedly employ various levels of subclassing and who knows where the 'bug' will be? For one thing, column 0 in egrid will be column 1 in PURELVSort etc. as an egrid is a massively subclassed ListIcon with the 'proper' column 0 blanked out. This was absolutely necessary for various reasons which I won't go into right now. :) It may well be that, individually, both libraries contain no bugs related to this procedure. However, together they may simply be too incompatible etc. My intention, and my answer to those enquiring about sorting, is that you will probably have to code your own routine. I have distant thoughts of adding such functionality later, but this won't be any time soon I'm afraid.

Try it without a CellCallback function and see if that makes any difference?
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 »

**UPDATE: 15th October 2006.

(See previous post above).

Have reinstated the right-click context menus for the edit controls used to edit certain cells. I originally removed them because of certain issues which have now been addressed.

Have also ammended the #egrid_LosingFocus message so that the developer is informed which cell was last selected before the message is sent etc.

(I won't be able to upload the update until late tonight because I have no access to my broadband account right now.)

In the meantime I will investigate the issues with the PURELVSort library, but no promises here! If it looks as if the problem is with the egrid lib then I'll see what I can do. :)
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 »

REMOVED.
Last edited by srod on Sun Oct 15, 2006 1:31 pm, edited 1 time in total.
I may look like a mule, but I'm not a complete ass.
magicjo
User
User
Posts: 61
Joined: Sun May 07, 2006 10:43 am
Location: Italy

Post by magicjo »

@srod :
1) Thanks;
2) Rethanks;
3) the code example i've post is without cellcallback(the line is commented),so i shall code manually the sorting ? you want make me cry ? :lol:
PB Registered User, Egrid Registered User
Win7 x64 Ultimate, 4,00 Gb Mem, Ati Radeon HD4600 Series, Realtek High Definition Audio Integrated
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

REMOVED.
Last edited by srod on Sun Oct 15, 2006 1:32 pm, edited 1 time in total.
I may look like a mule, but I'm not a complete ass.
KidNovak
New User
New User
Posts: 6
Joined: Sun Sep 03, 2006 12:39 am

How to install...

Post by KidNovak »

Sorry, I'm still a PB rookie.

I downloaded the latest version of eGrid "egrid4.zip".
Where do I put the files that are in the zip, and do I have to
configure anything?

When I run "egrid4 demo1.pb" I get error:
Line 35 - egrid_CreateGrid() is not a function...

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

Re: How to install...

Post by srod »

KidNovak wrote:Sorry, I'm still a PB rookie.

I downloaded the latest version of eGrid "egrid4.zip".
Where do I put the files that are in the zip, and do I have to
configure anything?

When I run "egrid4 demo1.pb" I get error:
Line 35 - egrid_CreateGrid() is not a function...

Thank you,
Novak
There are basic instructions on the download page - but yes I should make the instructions easier! :) I'll add a page to the help manual (work in progress!)

Basically, the zip contains 3 versions of the library so you'll need to pick the one you need.

Lets pick 'egrid4_AnsiNonThdsafe' (this is a non-threadsafe ansi version for non Unicode applications). Place this file in your Purebasic installation folder within the PureLibraries\UserLibraries subfolder.

Next place the file 'egrid_Resident..res' within the Residents subfolder of your Purebasic installation folder.

Now restart Purebasic and demo 1 should run.
I may look like a mule, but I'm not a complete ass.
magicjo
User
User
Posts: 61
Joined: Sun May 07, 2006 10:43 am
Location: Italy

Post by magicjo »

@srod, sorry for the delay, i'v tried the examples modified by you, but crash the same! (tested with PureLVSort version 4.12) :shock:
PB Registered User, Egrid Registered User
Win7 x64 Ultimate, 4,00 Gb Mem, Ati Radeon HD4600 Series, Realtek High Definition Audio Integrated
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Confirmed.

It now crashes at a slightly different place in the source code at exactly the point where one of my windowprocs would be calling one of PURELVSort's (or the result of being called by on of PURELVSort's).

Because of this, it is unlikely that I can do anything about it! :(

I'll keep poking around however.
I may look like a mule, but I'm not a complete ass.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

thx for unicode support, works fine :D

why not use subsystem? i have renamed all libs to egrid4 and moved to:
...\PureLibraries\UserLibraries\
...\SubSystems\UserLibThreadSafe\PureLibraries\
...\SubSystems\UserLibUnicode\PureLibraries\
like gnozals and PBOSL libs?

regards
Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Yep, I will probably add an installer which will place the different versions within the subsystem folders etc.

@magicjo: The problem is definitely in one of the libs passing messages on to the other and I suspect some kind of infinite loop which win XP is pretty good at spotting and throwing this kind of exception. The only way, however, I can attempt to get to the bottom of this is to have both libs as source code includes so that I can really see where the problem is.

I'll contact Gnozal and see what we can do. But at the end of the day we're dealing with two complex libraries here and put them together like this and ...... boom!

I'll be in touch.

:)
I may look like a mule, but I'm not a complete ass.
magicjo
User
User
Posts: 61
Joined: Sun May 07, 2006 10:43 am
Location: Italy

Post by magicjo »

srod, you'ld rename your nick in supersrod! :lol:
PB Registered User, Egrid Registered User
Win7 x64 Ultimate, 4,00 Gb Mem, Ati Radeon HD4600 Series, Realtek High Definition Audio Integrated
Post Reply