MicroGrid ~ Rev 0.97 now available.

Share your advanced PureBasic knowledge/code with the community.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: MicroGrid ~ Does anyone want Rev0.96?

Post by Kwai chang caine »

i have not good explain.
How you do for passing the picture in the first column an text in the second ??
ImageThe happiness is a road...
Not a destination
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: MicroGrid ~ Does anyone want Rev0.96?

Post by blueznl »

Thanks for posting. I'm in need of *some* editable grid and for some reason I'm not too much into coding one myself today :P

Haven't tried your code yet, but before I do: any kind of strings / license attached, or is it FFA? (Free For All :lol: )
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Re: MicroGrid ~ Does anyone want Rev0.96?

Post by RichardL »

@blueznl
No strings, ropes or cordage of any type in sight! Enjoy... but on your own head be it.
RichardL
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Re: MicroGrid ~ Does anyone want Rev0.96?

Post by RichardL »

@KCC
If you look at the manual for the description of uGridSetCellType() you will see that you can set any cell (or rectangular area of cells) to be flagged as being one of a several types. The cell type you are using is:

Code: Select all

#uGrid_CellImageFlip ; A cell that can display either of two defined images.
The syntax of the command is:

Code: Select all

 uGridSetCellType(Gadget,cx,cy,cw,ch,Flag,FlagSwitch=#True)
cx,cy,cw and ch follow the same conventions as for drawing a graphical rectangle... X,Y,Width,Height.
The only special cases are:
If 'cx' = 0 and cw= -1 the value of 'ch' is interpreted as the height of the grid.
If 'cy' = 0 and ch = -1 the value of 'cw' is interpreted as the width of the grid.
If 'cx' and 'cy' are both 0 and 'cw' and 'ch' are both -1 the whole grid area is adjusted.

So... in your example:
uGridSetCellType(#Gad_Grid3,1,0,2,-1,#uGrid_CellImageFlip) ; Columns 2 and 3 to be images.
...1,0,2,-1... means starting at X=1,Y=0 with a width of 2 columns and for the whole column height the cells are type #uGrid_CellImageFlip.

So, if you want to change all the cells in column 0 from the default Text type to #uGrid_CellImageFlip you would write something like this:
uGridSetCellType(#Gad_Grid3,0,0,1,-1,#uGrid_CellImageFlip) ; Column 0 to be images.
OK?

RichardL
Frank Smart
New User
New User
Posts: 8
Joined: Wed Jul 20, 2005 2:36 pm

Re: MicroGrid ~ Does anyone want Rev0.96?

Post by Frank Smart »

Hello RichrdL,

thank you for sharing your good code. But when I try to compile the code from the first post. I get this Error message from the compiler:
---------------------------
PureBasic
---------------------------
The procedure 'uGridCallback()' has been declared but not defined.
---------------------------
OK
---------------------------

Did you post the right version of MicroGrid?

Thanks!
Best regards,
Frank
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Re: MicroGrid ~ Does anyone want Rev0.96?

Post by RichardL »

@Frank

Originally the first post contained the uGrid library followed by a demo program.
Because the size of library+demo grew beyond the 60,000 character upload limit I had to spilt the two apart. So...

Download the library (which it sounds like you have done) and then join on the test/demo section that you will find a few postings later.

Better still, why not get the latest versions from DropBox (see my post of the 14th). I've just clicked the link and it is still live OK.

Richard
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Re: MicroGrid ~ Rev 0.97 Small fixes and new features

Post by RichardL »

Hi,
I'm just finishing some tests on the latest version of MicroGrid and will post a Dropbox link here tomorrow.

Added: Link as promised: https://www.dropbox.com/sh/i24jfrjkg2g0j3l/LAc8xJwCrw

Most of the MicroGrid testing is now carried out by testing of my Amateur Radio Log Book which it uses extensively. As and when I find irritations or bugs they get sorted, but there are no major additions recently.

Here are the changes in the 0.97 update.

; Rev 0.97
; ========
; Fixed - Cursor not appearing a StringGadget() PB gadget after exiting a uGrid
; Fixed - Caret now killed when grid lost focus.
; Added - Caret now positioned properly when user clicks within a cell's text string.
; Mod - Cells type #uGrid_CellList are not cleared by uGridClearCell().
; Added - #uGridGridReceivedFocus New callback when a grid is first selected
; Mod - Mouse wheel moves selection cell vertically, as before. Hold down to move horizontally. ***

@KCC: Pictures soon I hope :wink:

Best regards,
RichardL
Last edited by RichardL on Fri Apr 18, 2014 4:19 pm, edited 1 time in total.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: MicroGrid ~ Does anyone want Rev0.96?

Post by Kwai chang caine »

I wait....no probem :wink:
Thanks Richard 8)
ImageThe happiness is a road...
Not a destination
User avatar
aaaaaaaargh
User
User
Posts: 55
Joined: Thu Jul 27, 2006 1:24 pm

Re: MicroGrid ~ Rev 0.97 now available.

Post by aaaaaaaargh »

Awesome!
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: MicroGrid ~ Rev 0.97 now available.

Post by Andre »

It seems to be a very interesting code! :mrgreen:

Any chance to get it adapted/working on MacOS? (replacing/avoiding the xxxCaretxxx_() WinAPI commands and the Windows callback)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Re: MicroGrid ~ Rev 0.97 now available.

Post by RichardL »

@Andre
I'm on holiday, welcoming a new (4 days old today) granddaughter to her home in the French Alps and enjoying the sun and wine :)
However, I brought a laptop with me to keep in touch and work on my current project... but not too much!

I am using uGrid in my own projects and the rate of updating/patching has dropped to a satisfactorily low level, so maybe it is time to stir it up again.

I do not have the uGrid source files with me, but from recollection... I can probably get rid of any Windows callbacks with BindEvent() (Not tried yet... I have only just upgraded) and that just leaves the caret to make OS independent. My current thoughts are to use a small borderless window as the caret and hide/unhide it with a timer. The positioning will need to be tied to uGrid's underlying CanvasGadget() and visibility controlled taking account of Z level and a switching mechanism. Seems a bit heavy.... OK, something to think about!

... and I've got KCC wondering when I will get the overdue picture management sorted :oops:

Best regards to all uGrid users, I'll be back home in time for the UK GrandPrix!
RichardL

Edit: I just found a source file for uGrid only a few weeks out of date... NO WINDOWS CALLBACK!... one less thing to do!
Last edited by RichardL on Tue Jun 24, 2014 9:51 am, edited 1 time in total.
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Re: MicroGrid ~ Rev 0.97 now available.

Post by RichardL »

Duplicated in error.
@Moderator, please delete, if convenient. Thanks.
Last edited by RichardL on Tue Jun 24, 2014 11:59 am, edited 1 time in total.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: MicroGrid ~ Rev 0.97 now available.

Post by Kwai chang caine »

In life..the holiday is important...mainly for the brain :D
The big oxygen of mountains...again more :mrgreen:
ImageThe happiness is a road...
Not a destination
Niffo
Enthusiast
Enthusiast
Posts: 504
Joined: Tue Jan 31, 2006 9:43 am
Location: France

Re: MicroGrid ~ Rev 0.97 now available.

Post by Niffo »

Thank you VERY much for this great work !
Niffo
Post Reply