Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 24 JUL 2001 09:08:11PM Mike Parrish wrote:

Hello all, it's me again.

I have noticed something that seems somewhat odd to me…2 things actually…

1) On a database-bound edit table within a form, it seems that the Options Quickevent is global for the entire edit table. Before I go through all of the trouble of programatically attempting to call the various popups related to the individual columns in order to show the users the entry options, will this approach even work? Is there an easier way? Hmmm… on further thought, it would seem that the entire table might be processed as an individual unit and thus could make program calls a little difficult. Clearly, I haven't a clue how I should do this. I need the functionality of AMVs, thus the edit table displaying so many fields.

2) Edit tables don't seem to have a check box for uppercase entry. I attempted to use @UPPER_CASE in the conversion field for the prompts that I'd like uppercase but, naturally, that attempt failed. Again, is there an easier (faster) way other than programatically CONVERTing @lower_case to @upper_case?

Just trying to save myself some steps wherever I can.

Thanks in advance for any help. You guys have been great in the past!

BR,

Mike+


At 24 JUL 2001 11:44PM WinWin/Revelation Support wrote:

The edit table is a single control, so windows messages (events) go to the entire control, you have to resolve for the current cell. For cell specific stuff look at the SELPOS property and poschanged event.

The edit table is also a third party control with functions that were not all mapped into the Get_Property / Set Property OI model. For some functions you will need to look at the SEND_MESSAGE function.

Finally there are times when you just have to reach out and whack the thing yourself. To set the upper case property you need code like the following ( I think this originated with Carl Pates of Sprezzatura, has been used / revised by others since. )

call it in the CREATE event of your window,

CTRLENTID is the id of the edit table

cols is a space or vm delimited list of edit table column numbers

Upper is a boolean, send 1 to set column to uppercase

Hope this helps

Bob

subroutine ETSetCase(CtrlEntID, Cols, Upper)

* this subroutine can be used to force a specified

* column in an EditTable to be uppercase-only.

*

* Chris Salese

* Revelation Support

* July 9, 1996

declare function Get_Property

declare subroutine SendMessage

$insert Logical

equ WM_USER$ to 1024

equ DTM_SETCOLFORMAT$ to WM_USER$ + 18

if assigned(Cols) else Cols='

if assigned(Upper) else Upper= ''

if len(cols) else cols=1

if len(upper) else upper=TRUE$

convert ' ' to @vm in cols

hWnd=Get_Property(CtrlEntID, "HANDLE")

if hWnd then

Format=str("lu" not(not(Upper))+1,1, 119): \00\
rcol='
rflag='
loop
  remove col from cols at rcol setting rflag
While col  
  SendMessage(hWnd, DTM_SETCOLFORMAT$, Col - 1, GetPointer(Format))
Repeat  

end

return


At 25 JUL 2001 01:24AM Scott, LMS wrote:

Hi Mike

Seems like the most popular way of dealing with an edittable is to have a dialog box/popup to enter the data in each line. Which can be a pain if you'd prefer to edit in an spreadsheet kind of format.

I decided to use a commuter event. I figured if I wanted different options pop up I could use the SELPOS to figure out what column/field I was in, and a case statement on the commuter event to run the appropriate options popup.

I'd still like to know what the version of SELPOS is that will get me PREVPOS ie which cell I just left so I could do a corresponding cell based lostfocus validation, but I guess I could update an @MYPREVPOS on the changedpos (commuter) event to keep track of it.

Currently I call the commuter from the lost focus on the table and my save button on the form, to validate the contents of the table all at once.

With the uppercase/lowercase, you could maybe set up your own OCONV function - I've got one called "TPM_CONV", and put this in the conversion part of the column properties for the text columns.

Ie instead of something that looked like (MD2) you'd have TPM_CONV, UPPER in the conversion part. Coded the call looks like

upper_text=OCONV(mixed_text, "TPM_CONV, UPPER")

the TPM_CONV parameters look like:

COMPILE SUBROUTINE TPM_CONV (TYPE, DATA.TO.CONVERT, SUBR.LABEL, RETURNED.DATA)

the SUBR.LABEL parameter is the one that ends up being set to "UPPER" which you can then use to determine that you want to do an UPPERCASE convert on the DATA.TO.CONVERT. I'm not sure how the data gets in the DATA.TO.CONVERT. You need to fill out the RETURNED.DATA. I don't know a lot about how these custom conversion things work because it was there before I came to work on my system.

I find the conversion routine works quite well on the edittable provided I remember to make sure that the column that I want converted is *selected* before I fill in the conversion details.

Hope that helps a bit. I wouldn't mind knowing more about how other people might do cell by cell validation without doing a popup/dialog.

Scott, LMS


At 25 JUL 2001 02:40AM [url=http://www.sprezzatura.com" onMouseOver=window.status=Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:

Scott

Try PREVSELPOS.

See you tonight!

The Sprezzatura Group

World Leaders in all things RevSoft


At 25 JUL 2001 10:00AM Donald Bakke wrote:

Hi Mike,

FYI, the MDI application I showed you allows the developer to filter out options for each column. Specifically, the Options button is enabled/disabled based on certain columns so the end user is given a better idea of when they can press F2 or click on the button.

Also, regarding the upper case issue with edittable, the code that Bob provided does not change the underlying record information. As he mentioned, the edittable is a third-party control and so somethings have to be done differently. Unfortunately, upper casing your data is more of a chore than it really should be. Depending on how specific you want the behavour to be you can either just do something like Scott suggested or both.

The code that Bob posted will force the display of all entered text to only appear in upper case. Scott's code (and there are variations on her approach) will take care of the true text that gets written to disk. However, if all you do is implement Scott's code then your text will appear lower case while being typed and then get converted to upper when moving to the next cell. If that is okay then just stick with it. Otherwise, add Bob's code as well for a total package.

Finally, all of this code and hooks to easily attach edittables are within our MDI application package ;-)

dbakke@srpcs.com

SRP Computer Solutions, Inc.


At 25 JUL 2001 12:26PM Mike Parrish wrote:

Bob,

Yikes! But ok, I'll give it a shot! Thanks for the assist.

Mike+


At 25 JUL 2001 12:38PM Mike Parrish wrote:

Don, Bob & Scott,

Thanks, guys, for all your help. I'll try to get these things to work today…well, at least I'll start on 'em today!

It's funny how some of the OI stuff works and even funnier how some of it doesn't work – or at least not in the ways I would have suspected they'd work. I well remember when OI first came out and the proclamations that it wasn't ARev for Windows. Granted, I can see how OI does some things remarkably well, unfortunately a good deal of some really cool (and useful) ARev things didn't make it. For some reason the phrase, "rue the day" comes to mind. ;)

Oh well. Onward and upward.

Mike+

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/9d3145acf03ea3d785256a9400063e50.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1