News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Spread sheet custom control

Started by KetilO, March 16, 2007, 10:27:19 AM

Previous topic - Next topic

Mark N

Just noticed something: If a consecutive vertical series of cells are defined as hyperlinks, the first cell entered with the mouse changes the text to blue, but if you move vertically to an adjacent hyperlink cell, the original cell stays blue but the new cell doesn't change color. Clicking the hyperlink in the new cell works correctly.

If you move off the hyperlinked cell to a non-formatted cell, the hyperlink cell reverts to normal color correctly.


KetilO

Thanks Mark N and jcfuller

New upload at the top.

Version 0.0.2.1
- Single click on CheckBox cell changes checked state.
- Enter or space in a CheckBox cell changes checked state.
- Single click on ComboBox button shows combolist.
- Enter or space in a ComboBox cell shows combolist.
- Enter in a combolist selects the item.
- Escape in a combolist hides the list.
- Enter or space in a Button cell that has the STATE_LOCKED state sends a SPRN_BUTTONCLICK notification.
- Column headers are now multiline.
- Fixed bug with hyperlink coloring.

KetilO

jcfuller


Mark N

Yes indeed, thanks very much!  :clap:

jcfuller

KetilO,
  Is it possible to change the 0,0 header text? I can change all others.

James

jcfuller

Quote from: jcfuller on June 10, 2008, 03:26:57 PM
KetilO,
  Is it possible to change the 0,0 header text? I can change all others.

James


Never mind. I can get the effect I want with TPE_WIDEBUTTON and spri.state = STATE_LOCKED

James

PBrennick

VERY nice! Not sure how to do all I want such as making a header that goes across three columns but it is probably there, just need to get the cobwebs out.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

Mark N

KetilO,

Just noticed something: If you create the control with the WS_TABSTOP style, you can tab into the control but not out of it.

Not exactly earth-shattering, I know...

Mark N

KetilO

Hi PBrennick

To make a header cover more than one column:

mov rect.left,1
mov rect.right,3
mov rect.top,0
mov rect.bottom,0
invoke SendMessage,hSht,SPRM_EXPANDCELL,0,addr rect


KetilO

KetilO

Hi Mark N

Nothing to do about that since the tab key is used to navigate between splitts.

KetilO

Mark N

Regarding the Tab key: Not a problem in the least, just thought I'd pass it on.

PBrennick

The GeneSys Project is available from:
The Repository or My crappy website

Gafny Jacob

Hi Ketilo
I just try to use the control with powerbasic. after creating the control, I tryed this code snippet

    spri.flag = %SPRIF_TEXTALIGN OR %SPRIF_DATA OR %SPRIF_WIDTH OR %SPRIF_HEIGHT or %SPRIF_BACKCOLOR or %SPRIF_TEXTCOLOR
    spri.col=1
    spri.row=0
    spri.fmt.txtal = %FMTA_CENTER OR %FMTA_MIDDLE
    spri.wt = 200
    spri.ht = 35
    Spri.Fmt.bckcol = %BLUE: Spri.Fmt.TxtCol = %YELLOW
    Bu = "Type"
    spri.lpdta = STRPTR(Bu)
    SendMessage hGrid, %SPRM_SETCELLDATA,0,VARPTR(spri)

   However, the background color remain the  same (Text color changed), and the text remain on top of the cell(I thout it should be in the middle).
  Am I doing somthing wrong.
  TIA

   

KetilO

Hi

There are some limitations to the row / column headers. Try changing the row from 0 to 1 and it should work.

KetilO

majkinetor

#29
Hello there.

First of all , thanks for version 2, it works much better and faster then before and it is almost perfect. Even in interpeted environment it loads 65K cells in few seconds and works flowleslly afterwards.

While creating wrapper for your control, I wrote down things I encountered, bugs and suggestions.

   Bugs and Problems:
      - Graph background color stays the same even when you change global cell background.
      - When u enter edit (or use txtal "all") on type FLOAT with SPRIF_SINGLE (or double), extra digits of precision are shown, those that are probably artifacts of conversion.
      - Multiline text editing doesn't allow for entering new lines. ENTER should work normaly in such case, with modifier CTRL used to exit the editing.
      - If I have 2 integers, and set formula A11/A12 with A12=0, I don't get DIV0 error but the Formula displays A11.
      - Row header doesn't account for Y text alignment. So if you resize height, #1 symbol (splitt no) will be stay in center and row header can't be set to follow.
      - It is very hard to adjust row height. Movement cursor dissapears to easily. See example for proof.

   Questions:
      - How to get GRAPH and FORMULA text ?
      - What is the difference between BlankCell & DeleteCell ?
      - Why do I have fCancel in update when I can't cancel update ? (This applies only for ComboBox and CheckBox selection,)
   
   Suggestions:
      - InsertRow & Col should have nRows/nCols as paramter to say how many to insert.
        Now, if I want to add 100 rows in the middle Ill have to Insert 100 times in a loop.
      - DateTime cell should have associated DateTime control similar to ComboBox & ListBox
      - DeleteCell should be used to actually delete the cell. This means that cell's row or column need to be adjusted.
        The wparam could set axis of adjustment (x or y - col or row) and lparam direction of adjustment (x - left/right, y - up/down).
        This naturaly extends to DeleteMultiSel that may have exactly the same API doing its magic for block of cells.
      - Editable ComboBox type .
      - If you choose to set fCancel to 1 in select notification for particualr row, later that row can't be skipped with arrows.
        When control encounters such row, it simply stucks there while it should skip it. This can be set up in handler tho (but it shouldn't be necessary).
      - Scrolling needs update.
        Horizontal scrolling is happening on selection or click even when column widths are correctly adjusted if VSCROLL flag is present.
        Previous columns will get out of the view altho there is no need for it.
        Moving mouse wheel always scrolls the last row to be on the top of the control, even if all rows are visible.
        New creation style could also be used, to prevent user V or H scrolling for making fixed look dialogs or fix to scrolling problems mentioned above.
        For instance, imagine scenario in which I have 30 rows in the sheet but I want only to show 10 in a view without user moving from that view.


Thx again for great work I hope you will take some things into consideration.

In case it means something to you, I created documentation for my AutoHotKey wrapper, so other people can use it to get to know controls possibilities and behavior.

Cheers.