News:

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

SpreadSheet question

Started by Faiseur, May 16, 2010, 11:17:03 AM

Previous topic - Next topic

Faiseur

Hi KetilO,

I am preparing a project to use Spreadsheet in grid version.

I will wish to use SPRM_IMPORTLINE, which is very convenient to add lines. By default, SPRM_IMPORTLINE adds a line at the bottom of the list. I want to change it to add each new entry at the top of the grid, while preserving the previous lines. I have not found how to do it... If possible, can you explain how, thank you.

Faiseur
French asm Forum: http://www.asmforum.net/   Website: http://www.faiseur.net/

Faiseur

Ok, i have added new Message in SpreadSheet called:


SPRM_IMPORTTOPLINE equ WM_USER+151 ;Import a line of data at the top of the grid. wParam=SepChar, lParam=pointer to data line.


Original IMPORTLINE is renamed:

SPRM_IMPORTBTLINE equ WM_USER+138 ;Import a line of data at the bottom of the grid. wParam=SepChar, lParam=pointer to data line.



This modification works but i'm not sure that all settings are preserved. I removed the verification of the number of columns since we use the first.


.elseif eax==SPRM_IMPORTTOPLINE
test [ebx].SHEET.winst,SPS_GRIDMODE
je @f
mov edx,1
push edx
invoke InsertRow,ebx,edx
pop edx
mov [esi].WIN.crow,edx
  @@:
mov [esi].WIN.ccol,1
mov edi,lParam
  @@:
invoke GetImpData,addr buffer,edi,wParam
.if eax
add edi,eax
invoke ConvInt,addr buffer
.if eax
invoke UpdateCell,ebx,[esi].WIN.ccol,[esi].WIN.crow,TPE_INTEGER,addr buffer,0
.else
invoke UpdateCell,ebx,[esi].WIN.ccol,[esi].WIN.crow,TPE_TEXT,addr buffer,0
.endif
inc [esi].WIN.ccol
jmp @b
.endif
mov [esi].WIN.ccol,1
invoke InvalidateRect,hWin,NULL,TRUE
jmp ExRet


French asm Forum: http://www.asmforum.net/   Website: http://www.faiseur.net/