Skip to content

Commit

Permalink
Fixed: Compiling GridData example
Browse files Browse the repository at this point in the history
  • Loading branch information
XusinboyBekchanov committed Mar 21, 2022
1 parent 49bc003 commit f5e00b3
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 76 deletions.
Binary file added Examples/GridData/Data/Test.db
Binary file not shown.
46 changes: 25 additions & 21 deletions Examples/GridData/GridData.bi
Expand Up @@ -1098,7 +1098,7 @@ End Enum
If Parent AndAlso Parent->Handle Then
Item(Index)->Visible = False
End If
#EndIf
#endif
FItems.Remove Index
End Sub

Expand All @@ -1117,7 +1117,7 @@ End Enum
' #EndIf
' End Sub

Function GridDataItems.IndexOf(BYREF FItem As GridDataItem Ptr) As Integer
Function GridDataItems.IndexOf(ByRef FItem As GridDataItem Ptr) As Integer
Return FItems.IndexOF(FItem)
End Function

Expand All @@ -1135,11 +1135,11 @@ End Enum
End Function

Sub GridDataItems.Clear
#IfDef __USE_GTK__
#ifdef __USE_GTK__
If Parent AndAlso Cast(GridData Ptr, Parent)->TreeStore Then gtk_tree_store_clear(Cast(GridData Ptr, Parent)->TreeStore)
#Else
If Parent AndAlso Parent->Handle Then Parent->Perform LVM_DELETEALLITEMS, 0, 0
#EndIf
#else
If Parent AndAlso Parent->Handle Then SendMessage Parent->Handle, LVM_DELETEALLITEMS, 0, 0
#endif
For i As Integer = FItems.Count -1 To 0 Step -1
Delete Cast(GridDataItem Ptr, FItems.Items[i])
Next i
Expand Down Expand Up @@ -1173,7 +1173,7 @@ End Enum
'QGridDataColumn(FColumns.Items[Index]) = Value
End Property

#IfDef __USE_GTK__
#ifdef __USE_GTK__
Sub GridDataColumns.Cell_Edited(renderer As GtkCellRendererText Ptr, path As gchar Ptr, new_text As gchar Ptr, user_data As Any Ptr)
Dim As GridDataColumn Ptr PColumn = user_data
If PColumn = 0 Then Exit Sub
Expand Down Expand Up @@ -1289,9 +1289,9 @@ End Enum

Sub GridDataColumns.Insert(Index As Integer,ByRef FCaption As WString = "", FImageIndex As Integer = -1, iWidth As Integer = -1, tFormat As ColumnFormat = cfLeft, ColEditable As Boolean = True,tDataType As GridDataTypeEnum = DT_String,tLocked As Boolean=False,tControlType As GridControlTypeEnum=CT_TextBox,ByRef tComboItem As WString = "",tSortOrder As SortStyle=ssSortAscending)
Dim As GridDataColumn Ptr PColumn
#IfNDef __USE_GTK__
#ifndef __USE_GTK__
Dim As LVCOLUMN lvc
#EndIf
#endif
PColumn = New GridDataColumn
FColumns.Insert Index, PColumn
With *PColumn
Expand All @@ -1307,8 +1307,8 @@ End Enum
.SortOrder=tSortOrder
.GridEditComboItem= tComboItem
End With
#IfNDef __USE_GTK__
lvC.mask = LVCF_FMT OR LVCF_WIDTH OR LVCF_TEXT OR LVCF_SUBITEM
#ifndef __USE_GTK__
lvC.mask = LVCF_FMT Or LVCF_WIDTH Or LVCF_TEXT Or LVCF_SUBITEM
lvC.fmt = tFormat
lvc.cx=0
lvc.iImage = PColumn->ImageIndex
Expand All @@ -1322,19 +1322,19 @@ End Enum
ListView_SetColumnWidth(Parent->Handle, Index, iWidth)
End If
End If
#EndIf
#endif
End Sub

Sub GridDataColumns.Remove(Index As Integer)
FColumns.Remove Index
#IfNDef __USE_GTK__
#ifndef __USE_GTK__
If Parent AndAlso Parent->Handle Then
Parent->Perform LVM_DELETECOLUMN, cast(WPARAM, Index), 0
SendMessage Parent->Handle, LVM_DELETECOLUMN, Cast(WPARAM, Index), 0
End If
#EndIf
#endif
End Sub

Function GridDataColumns.IndexOf(BYREF FColumn As GridDataColumn Ptr) As Integer
Function GridDataColumns.IndexOf(ByRef FColumn As GridDataColumn Ptr) As Integer
Return FColumns.IndexOF(FColumn)
End Function

Expand Down Expand Up @@ -1985,13 +1985,17 @@ End Sub

' case WM_MOUSELEAVE
' 'print "WM_MOUSELEAVE !!!!!!!!!!"
' case WM_VSCROLL
Case WM_VSCROLL
mDrawRowStart = ListView_GetTopIndex(Handle)
GridReDraw(mDrawRowStart, mDrawRowStart + mCountPerPage, mRow, mCol)
' tSCROLL_HorV=False
' 'print "WM_VSCROLL XXXXXXXXX"

' case WM_HSCROLL
Case WM_HSCROLL
' tSCROLL_HorV=true
' 'print "WM_HSCROLL !!!!!!!!!!"
mDrawRowStart = ListView_GetTopIndex(Handle)
GridReDraw(mDrawRowStart, mDrawRowStart + mCountPerPage, mRow, mCol)
' Case WM_RBUTTONDOWN
Case WM_LBUTTONDOWN
Dim lvhti As LVHITTESTINFO
Expand Down Expand Up @@ -2228,7 +2232,7 @@ End Sub
If message.LParam=99911 Then GridEditText.Visible =False
If message.LParam=99922 Then GridEditComboBox.Visible =False
If message.LParam=99933 Then GridEditDateTimePicker.Visible =False
'GridReDraw(mDrawRowStart, mDrawRowStart + mCountPerPage,mRow, mCol)
GridReDraw(mDrawRowStart, mDrawRowStart + mCountPerPage, mRow, mCol)
End If
Case VK_SPACE
Print "VK_SPACE"
Expand All @@ -2240,7 +2244,7 @@ End Sub
message.Result= CDRF_SKIPDEFAULT
End If
message.Result= CDRF_SKIPDEFAULT
'GridReDraw(mDrawRowStart, mDrawRowStart + mCountPerPage,mRow, mCol)
GridReDraw(mDrawRowStart, mDrawRowStart + mCountPerPage, mRow, mCol)
Case VK_RIGHT,VK_TAB
ListView_GetSubItemRect(Handle, mRow, mCol, LVIR_BOUNDS, @RECHeader)
If RECHeader.Right<This.Width Then
Expand All @@ -2251,7 +2255,7 @@ End Sub
If message.LParam=99911 Then GridEditText.Visible =False
If message.LParam=99922 Then GridEditComboBox.Visible =False
If message.LParam=99933 Then GridEditDateTimePicker.Visible =False
'GridReDraw(mDrawRowStart, mDrawRowStart + mCountPerPage,mRow, mCol)
GridReDraw(mDrawRowStart, mDrawRowStart + mCountPerPage, mRow, mCol)
Case VK_RETURN
ListView_GetSubItemRect(Handle, mRow, mCol, LVIR_BOUNDS, @RECHeader)
If RECHeader.Right<This.Width Then
Expand Down
96 changes: 48 additions & 48 deletions Examples/GridData/GridDataTest.rc
@@ -1,49 +1,49 @@
1 24 "xpmanifest.xml"

#define VER_FILEDESCRIPTION_STR "\0"

#define VER_FILEVERSION 0,0,0,16
#define VER_FILEVERSION_STR "0.0.0.16\0"

#define VER_LEGALCOPYRIGHT_STR "\0"

#define VER_INTERNALNAME_STR "\0"
#define VER_ORIGINALFILENAME_STR "\0"
#define VER_PRODUCTNAME_STR "\0"

#define VER_PRODUCTVERSION 0,0,0,0
#define VER_PRODUCTVERSION_STR "0.0.0\0"
#define VER_COMPANYNAME_STR "\0"

VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", VER_COMPANYNAME_STR
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", VER_INTERNALNAME_STR
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
/* The following line should only be modified for localized versions. */
/* It consists of any number of WORD,WORD pairs, with each pair */
/* describing a language,codepage combination supported by the file. */
/* */
/* For example, a file might have values "0x409,1252" indicating that it */
/* supports English language (0x409) in the Windows ANSI codepage (1252). */
VALUE "Translation", 0x409, 1252
END
1 24 "xpmanifest.xml"
#define VER_FILEDESCRIPTION_STR "\0"
#define VER_FILEVERSION 0,0,0,24
#define VER_FILEVERSION_STR "0.0.0.24\0"
#define VER_LEGALCOPYRIGHT_STR "\0"
#define VER_INTERNALNAME_STR "\0"
#define VER_ORIGINALFILENAME_STR "\0"
#define VER_PRODUCTNAME_STR "\0"
#define VER_PRODUCTVERSION 0,0,0,0
#define VER_PRODUCTVERSION_STR "0.0.0\0"
#define VER_COMPANYNAME_STR "\0"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", VER_COMPANYNAME_STR
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", VER_INTERNALNAME_STR
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
/* The following line should only be modified for localized versions. */
/* It consists of any number of WORD,WORD pairs, with each pair */
/* describing a language,codepage combination supported by the file. */
/* */
/* For example, a file might have values "0x409,1252" indicating that it */
/* supports English language (0x409) in the Windows ANSI codepage (1252). */
VALUE "Translation", 0x409, 1252
END
END
10 changes: 5 additions & 5 deletions Examples/GridData/frmGridDataTest.bas
Expand Up @@ -18,8 +18,8 @@ If SQLiteOpen(SQLiteDB, ExePath & "\Data\Test.db", "") Then
Print "Opened SQLiteDB successfully.", ExePath & "\Data\Test.db"
End If
#define _NOT_AUTORUN_FORMS_
#include once "mff/Dialogs.bi"
#include once "mff/Form.bi"
#include once "mff/Dialogs.bi"
#include once "mff/TextBox.bi"
#include once "mff/RichTextBox.bi"
#include once "mff/TabControl.bi"
Expand Down Expand Up @@ -249,10 +249,10 @@ Constructor frmGridDataTest

imgListGrid1.Height=16 'Change the Height of Body
imgListGrid1.Width=16
imgListGrid1.AddPng "Grid", "Grid"
imgListGrid1.AddPng "New", "New"
imgListGrid1.AddPng "Open", "Open"
imgListGrid1.AddPng "Save", "Save"
imgListGrid1.Add "Grid", "Grid"
imgListGrid1.Add "New", "New"
imgListGrid1.Add "Open", "Open"
imgListGrid1.Add "Save", "Save"
'MSHFGridCont.Align = 1'alLeft 2'alRight 3'alTop 4'alBottom 5'alClient
'MSHFGridCont.SetMargins 0,50,10,10

Expand Down
10 changes: 8 additions & 2 deletions Examples/GridData/frmGridDataTest.vfp
Expand Up @@ -5,13 +5,15 @@ File=SQLITE3_UTILITY.inc
File=GridDataTest.rc
File=xpmanifest.xml
ProjectType=0
Subsystem=0
ProjectName=""
HelpFileName=""
ProjectDescription=""
PassAllModuleFilesToCompiler=false
MajorVersion=0
MinorVersion=0
RevisionVersion=0
BuildVersion=16
BuildVersion=24
AutoIncrementVersion=false
ApplicationTitle=""
ApplicationIcon=""
Expand All @@ -22,13 +24,17 @@ LegalCopyright=""
LegalTrademarks=""
OriginalFilename=""
ProductName="{ProjectName}"
CompileToGCC=false
CompileTo=0
OptimizationLevel=0
OptimizationFastCode=false
OptimizationSmallCode=false
CompilationArguments32Windows=""
CompilationArguments64Windows=""
CompilationArguments32Linux=""
CompilationArguments64Linux=""
CompilerPath=""
CommandLineArguments=""
CreateDebugInfo=false
AndroidSDKLocation=""
AndroidNDKLocation=""
JDKLocation=""
Binary file added Examples/GridData/libsqlite3-32.a
Binary file not shown.
Binary file added Examples/GridData/libsqlite3-64.a
Binary file not shown.

0 comments on commit f5e00b3

Please sign in to comment.