April 27, 2024, 04:17:38 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


IWGrid Development Updates

Started by LarryMc, October 08, 2011, 09:56:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

With this first update the grid has an optional title as well as optional row and column headers.
One cell has been preloaded with some text.
clicking on the cell puts it in edit mode.
the cell is actually configured as a numeric only cell.

hit ESC key to abort edits
to save edits
   hit ENTER key
   click any other cell
   use the scroll bars

when there is no cell currently in edit mode the arrow keys will move the selection box and ultimately cause the grid to scroll.
the colum dividers in the header can be dragged to change the width of a column
There's a bug right now with that. Pressing the mouse button to drag the coulmn width causes the currently hi-lighted cell to go into edit mode.

Right now you have to click the cell to enter edit mode.
Should the ENTER key also open the currently hi-lighted?
Should the click only select a cell and not put it in edit mode?
If a user just wants to copy the contents of the cell it HAS to be in edit mode.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

When all else fails, get a bigger hammer.

jerryclement

 ;D
Very nice Larry!

Can you only enter numbers in a cell?
I could not enter alpha characters.

Jerry
Jerry - Newbie from TN

LarryMc

Quote from: jerryclement on October 09, 2011, 05:47:15 PM

Can you only enter numbers in a cell?
I could not enter alpha characters.

Jerry


One of the key requirements of the grid designed required that the sub classing of an edit control work.(for the various mask to work.)

So, in my experimenting to see if I was going to attempt building yhe grid I subclassed to accept only numbers.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

jerryclement

 :)
Thanks for the info Larry, I am really following your progress as this is a very useful app.
Jerry
Jerry - Newbie from TN

LarryMc

right now I'm hung up on getting the protectcell and protectgrid flags to play pretty when opening a cell and making the controlenable command make the edit control in the cell respond correctly.

I've got a pretty big rats-nest of code right now.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Got my cell and grid protection issues resolved.
The 'grid protect' is the basic layer.
Turning this flag on and off controls all cells in the grid that haven't been assigned an individual protection status.

The "cell protection" is the top layer.
Cells may be designated as protected or unprotected.
These individual settings override the current "grid protect" flag.

Cells that typically would be individually protected would be labels.
Unprotected cells would be for user input.

If a cell is protected(either individually or with the "grid protect") and a user clicks on the cell the edit window will appear but the edit control will be disabled.
This is to allow the user to be able to highlight and copy the contents of the cell.

I'm now going to work on the scheme for setting the different types of cells.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Okay, got my scheme for identifying and handling different types of cells worked out.
I structured it so I COULD have up to 100 different types of cells.

The attached is an example of where I'm at right now.
The left column entries are protected alphanuric entries.  They can't be changed by the user. They are labels.
the right column contains unprotected cells of the types indicated.
they can be edited by the user as long as the grid is not protected.
The checkbox in the upper left corner of the parent window allows you to toggle the protected state of the grid.

Comments are welcome.
Put any wish list items in the wishlist post to keep them together.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

on the previous demo I accidently left cell 3C protected and I shouldn't have.

NOTE: the protection state of the grid is check only when a cell is first open for editing.
if you toggle the grid protection while a cell is open for editing the editing process continues with the state the grid was in when the edit started.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Got the combobox working, will now work on the checkbox

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

Larry,

That looks really good - who's a clever chappie? I wouldn't know
where to start with something like that!

Are you thinking of adding simple formulas, something like adding a
column or row up, simple calculations like that?

Brian

LarryMc

Quote from: Brian Pugh on October 13, 2011, 04:45:18 AM
Are you thinking of adding simple formulas, something like adding a
column or row up, simple calculations like that?

In this topic I wrote this:
QuoteAnd if I can get all that done I'll tackle functions like adding a group of cells.
It's there but its at the bottom of the list. ;)

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

checkbox now works

going to tackle the combination of an edit cell that is accompanied with a button to call a subroutine

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

That was easier than I thought!

I got the combination edit/button cell to work.

when you click the ell and put it in edit mode a button appears at the right edge
you have the option of typing in the edit portion or clicking the button to call a user defined function.

When the button is clicked the contents of the edit window is passed to the user's routine and the string returned from the user's routine is placed in the edit window.

In the demo I used this as my user subroutine:
sub test(string d),string

return "Made ["+d+"] it!"
endsub


It will be a while before I post another update.
I'm going to start working on edit field mask. (Along the lines of a USING statement in results)

wish me luck ;)

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

whitenite1

LarryMc
  I would like to be the first to extend a "Good Luck" though I don't think 'Luck' has anything to do with your programming talent. When you got it, you got it!!

whitenite1

LarryMc

you'd be surprised how much of this stuff I don't know.

right now, I could not write a program, from scratch, that had a main window with one of each of the available controls.
I've built up a rather large stockpile of bits and pieces of code I've used over the years; I'd be lost without the IDE "find in files" tool, and I look at the help file almost hourly.  Did I mention searching the IW forums AND the old Pyxia forums disk.

But I'm hell on wheels when it comes to cutting and pasting various pieces together ;D.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Rock Ridge Farm (Larry)

Some of the best programmers I ever worked with were cut/paste programmers.
It is a wise man who can see the end result and find the bits to put together to acheive
it.

Larry

LarryMc

just to let ya'll know I'm still plugging away.

I'm basically working on a Masked Editor control to incorporate into the
Grid control.

I've got some of it working to some extent right now.

The attached demonstrates 4 of the types, so far. 
I'm working on the cut and paste aspects right now.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

Larry,

Forgive my ignorance, but what is an SSN?
And will you be able to change the telephone mask properties? They may
work for you, but not for us on this side of the Pond!

Brian

whitenite1

Larry..
  I am only able to enter 6 digits of the phone number, after the area code.

Brian Pugh..
The SSN is the Social Security Number. I think that's used also, only on this side of the pond.

whitenite1

LarryMc

Quote from: whitenite1 on October 18, 2011, 12:13:44 PM
  I am only able to enter 6 digits of the phone number, after the area code.
It doesn't like the embedded space after (xxx).  I'll have to look into it.

@Brian - yes SSN is the US social security identification number format.

I started out thinking I would make a mask for each type I could think of and/or people asked for.

I guess what I really need to try to do is make it universal to let people design their own mask.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Got the basic currency mask working.
With the way the code is written the max positive number it will handle is $1,999,999,999.99. (Haven't checked the max negative yet.)

Got to address cut/paste also.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Quote from: LarryMc on October 19, 2011, 10:06:16 AM
With the way the code is written the max positive number it will handle is $1,999,999,999.99. (Haven't checked the max negative yet.)

Limitation was being imposed by a combination of the STR$ and VAL commands.
I coded a work-around since I was using it only to strip leading blanks from the number.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

Have you tried the USING to return fancy numerics, instead of STR$ and VAL?

Bill
When all else fails, get a bigger hammer.

LarryMc

Quote from: billhsln on October 21, 2011, 01:28:51 AM
Have you tried the USING to return fancy numerics, instead of STR$ and VAL?

Bill
Yes, but it didn't serve my purpose in this particular case.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library