Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
use Third-party listview control Error
#1
Hi,

I tried to use the listview control in the Suite Pro for ActiveX in QM, Most functions execute correctly and Work well

But the following QM code prompts the following error when executing the function( ListViewIcons.Icons.LoadBitmap )
 
Code:
Copy      Help
Error in Macro13:DlgProc:  function at left does not return interface pointer.
 
vb6 original code:
 
Code:
Copy      Help
ListViewIcons.ListItems.Add , , "Settings", 1
ListViewIcons.ListItems.Add , , "Find", 2
ListViewIcons.ListItems.Add , , "Run", 3
ListViewIcons.ListItems.Add , , "Help", 4
    
ListViewIcons.Icons.LoadBitmap App.Path & "\Icons\AlphaSettings.bmp", 1, xtpImageNormal
ListViewIcons.Icons.LoadBitmap App.Path & "\Icons\AlphaFind.bmp", 2, xtpImageNormal
ListViewIcons.Icons.LoadBitmap App.Path & "\Icons\AlphaRun.bmp", 3, xtpImageNormal
ListViewIcons.Icons.LoadBitmap App.Path & "\Icons\AlphaHelp.bmp", 4, xtpImageNormal

Some transcoding skills may be required, Any suggestions and help are welcome
david

Macro Macro13
Code:
Copy      Help
typelib XtremeSuiteControls {A8E5842E-102B-4289-9D57-3B3F5B5E15D3} 22.0

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 ActiveX 0x54030000 0x0 0 0 106 104 "XtremeSuiteControls.ListView {C0DE2200-31D2-4B4A-85B8-14C2465ADA30} data:9100C7188F07F61794041F6F4F91A6E35DB314295A995DFAF236C3BA7BCCC6441EAB3F4EAAF4B2CA4BCB036A228425DA4F74D874C4E9818BC9B33331A09098256AAF6735D601AE1FC22BCB221684994B05C62512565F0F3340616EE884B36A2FE2FB62484676B82CBDE8AA1F92B1DAA7320869B37E08348C00877CD16318084825DA501ADE1FE14D03"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C02 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret

#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,XtremeSuiteControls.ListView li3
,li3._getcontrol(id(3 hDlg))
,
,;The following code executes successfully
,li3.ListItems.Add(0, "", "Settings", 1)
,li3.ListItems.Add(0, "", "Find", 2)
,li3.ListItems.Add(0, "", "Run", 3)
,li3.ListItems.Add(0, "", "Help", 4)
,
,;The following code fails to execute
,li3.Icons.LoadBitmap("$desktop$\AlphaSettings.bmp", 1, XtremeSuiteControls.xtpImageNormal)
,li3.Icons.LoadBitmap("$desktop$\AlphaFind.bmp", 2, XtremeSuiteControls.xtpImageNormal)
,li3.Icons.LoadBitmap("$desktop$\AlphaRun.bmp", 3, XtremeSuiteControls.xtpImageNormal)
,li3.Icons.LoadBitmap("$desktop$\AlphaHelp.bmp", 4, XtremeSuiteControls.xtpImageNormal)

,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#2
Usually with com needs full path to file.  Use expandpath  or the full path .
#3
Still not working

Code:
Copy      Help
,;The following code fails to execute
,str s1.expandpath("$desktop$\AlphaSettings.bmp")
,str s2.expandpath("$desktop$\AlphaFind.bmp")
,str s3.expandpath("$desktop$\AlphaRun.bmp")
,str s4.expandpath("$desktop$\AlphaHelp.bmp")
,li3.Icons.LoadBitmap(s1, 1, XtremeSuiteControls.xtpImageNormal)
,li3.Icons.LoadBitmap(s2, 2, XtremeSuiteControls.xtpImageNormal)
,li3.Icons.LoadBitmap(s3, 3, XtremeSuiteControls.xtpImageNormal)
,li3.Icons.LoadBitmap(s4, 4, XtremeSuiteControls.xtpImageNormal)
#4
VB function LoadPicture is also used in the control code, what is its QM equivalent

ResizerSample.MouseIcon = LoadPicture(App.Path & "\grabhnd2.cur")
#5
I want to achieve the following demonstration effect
[Image: 1674086698]

The following link contains all the relevant files
1. Codejock.SuitePro.ActiveX.Eval.22.0.0 setup File
2. VB project code file

https://download.ru/files/ZtefhwQt

VB code(The code isn't very long, and I'd love to know the QM equivalents of some properties):
Code:
Copy      Help
VERSION 5.00
Object = "{A8E5842E-102B-4289-9D57-3B3F5B5E15D3}#22.0#0"; "Codejock.Controls.Unicode.v22.0.0.Demo.ocx"
Begin VB.Form Test
   Caption         =   "Test"
   ClientHeight    =   3825
   ClientLeft      =   120
   ClientTop       =   450
   ClientWidth     =   5760
   LinkTopic       =   "Form1"
   ScaleHeight     =   3825
   ScaleWidth      =   5760
   StartUpPosition =   2  '
   Begin XtremeSuiteControls.ListView ListViewIcons
      Height          =   3615
      Left            =   2400
      TabIndex        =   1
      Top             =   120
      Width           =   3255
      _Version        =   1441792
      _ExtentX        =   5741
      _ExtentY        =   6376
      _StockProps     =   77
      BackColor       =   -2147483643
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
         Name            =   "Microsoft YaHei Mono"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      GridLines       =   -1  'True
      HoverSelection  =   -1  'True
      Appearance      =   5
      IconSize        =   24
   End
   Begin XtremeSuiteControls.PushButton PushButton1
      Height          =   1095
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   2175
      _Version        =   1441792
      _ExtentX        =   3836
      _ExtentY        =   1931
      _StockProps     =   79
      Caption         =   "Hello World"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
         Name            =   "Microsoft YaHei Mono"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Transparent     =   -1  'True
      Appearance      =   5
      Picture         =   "Form1.frx":0000
      TextImageRelation=   1
   End
End
Attribute VB_Name = "Test"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
    ListViewIcons.ListItems.Add , , "Settings", 1
    ListViewIcons.ListItems.Add , , "Find", 2
    ListViewIcons.ListItems.Add , , "Run", 3
    ListViewIcons.ListItems.Add , , "Help", 4
    
    ListViewIcons.Icons.LoadBitmap App.Path & "\Icons\AlphaSettings.bmp", 1, xtpImageNormal
    ListViewIcons.Icons.LoadBitmap App.Path & "\Icons\AlphaFind.bmp", 2, xtpImageNormal
    ListViewIcons.Icons.LoadBitmap App.Path & "\Icons\AlphaRun.bmp", 3, xtpImageNormal
    ListViewIcons.Icons.LoadBitmap App.Path & "\Icons\AlphaHelp.bmp", 4, xtpImageNormal
End Sub
#6
in response to post #3  try this
Code:
Copy      Help
,case WM_INITDIALOG
,XtremeSuiteControls.ListView li3
,li3._getcontrol(id(3 hDlg))
,li3.ListItems.Add(0, "", "Settings", 1)
,li3.ListItems.Add(0, "", "Find", 2)
,li3.ListItems.Add(0, "", "Run", 3)
,li3.ListItems.Add(0, "", "Help", 4)
,li3.SetIconSize(24 24)
,XtremeSuiteControls.ImageManagerIcons lvi3=li3.Icons 
,str s1.expandpath("$desktop$\AlphaSettings.bmp")
,str s2.expandpath("$desktop$\AlphaFind.bmp")
,str s3.expandpath("$desktop$\AlphaRun.bmp")
,str s4.expandpath("$desktop$\AlphaHelp.bmp")
,lvi3.LoadBitmap(s1 1 XtremeSuiteControls.xtpImageNormal)
,lvi3.LoadBitmap(s2 2 XtremeSuiteControls.xtpImageNormal)
,lvi3.LoadBitmap(s3 3 XtremeSuiteControls.xtpImageNormal)
,lvi3.LoadBitmap(s4 4 XtremeSuiteControls.xtpImageNormal)
#7
Thank you so much! #3 is perfectly solved.

1.How to add a click event for each item?  Huh
2.How to Change the font of the item text? 
 
Code:
Copy      Help
,li3._setevents("sub.li3")

#sub li3_ItemClick
function XtremeSuiteControls.ListViewItem'Item ;;XtremeSuiteControls._DListView'li3
#8
Code:
Copy      Help
#sub li3_ItemClick
function XtremeSuiteControls.ListViewItem'Item ;;XtremeSuiteControls._DListView'li3
out Item.Text
out Item.Index
#9
The first click succeeds. Then, click again and there is no more response Huh

Code:
Copy      Help
#sub li3_ItemClick
function XtremeSuiteControls.ListViewItem'Item ;;XtremeSuiteControls._DListView'li3
out Item.Text
sel Item.Index
,case 1
,run "control"
#10
seems once the item is clicked it is selected so if you click it again the event is not fired again

workaround  deselect it


Code:
Copy      Help
#sub li3_ItemClick
function XtremeSuiteControls.ListViewItem'Item ;;XtremeSuiteControls._DListView'li3
out Item.Text
sel Item.Index
,case 1
,run "control"
,Item.Selected=0
#11
I use the code below to make the text of the clicked item bold

I just want to keep the text of the currently clicked item in bold. Is that possible?
 
Code:
Copy      Help
#sub li3_ItemClick
function XtremeSuiteControls.ListViewItem'Item ;;XtremeSuiteControls._DListView'li3
;out Item.Text
Item.Selected=0
sel Item.Index
,case 1
,run "control"
,case 2
,run "control"
,case 3
,run "control"
,case 4
,run "control"
Item.Bold=1


In addition:

1.change the item text font
2.Gets icon and image data
Icon           =   "CellIconAndTextOpts.frx":0000
Images       =   "CellIconAndTextOpts.frx":058A
ResizerSample.MouseIcon = LoadPicture(App.Path & "\grabhnd2.cur")

really no solution?


Forum Jump:


Users browsing this thread: 1 Guest(s)