UBBFriend: Email This Page to Someone!
  Computer Workshop User Forums
  General Questions about EZGUI
  Treeview Right-Click

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   Treeview Right-Click
Frank Kelley
Member
posted 05-20-2007 10:10 PM     Click Here to See the Profile for Frank Kelley     Edit/Delete Message Reply w/Quote
In a project I'm working on under EZGUI 4.0, I am using %EZ_RButtonUp with a Treeview control to access a pop-up menu. However, the Treeview appears to require a double right-click to get the menu to appear. Other controls, such as ListBox and ListView, do not exhibit this behavior (a single right-click brings up the menu).

I tried doing the same thing in a second program that uses the Treeview and get the same results. Has anyone else experienced this, or is it just my version of WinXP SP2?

Hmmm...just tried it on my Win2k laptop and got the same behavior. Here's the code I used:

code:



' *************************************************************************************
' Code Generated by EZGUI Visual Designer 4.0
' Portions: Copyright Christopher R. Boss, 2003 to 2006
' All Rights Reserved !
' Registered EZGUI 4.0 users may use this code Royalty Free !
' *************************************************************************************
'
' --------------------------------------------------------
' WARNING ! Do Not Modify any code WITHIN Protected Sections !
' You can add code (Sub,Function,etc.) BEFORE any Protected Routine
' by using the following CODE TAGS: '<<SAVE>> '<<END>>
' and the Designer will not remove it.
' --------------------------------------------------------

' ======================================
' [PROTECTED CODE] Do NOT Edit !
' ======================================
'
#COMPILE EXE
#DIM ALL ' This is helpful to prevent errors in coding
' ------------------------------
' Enable all constants below to
' customize maximums in EZGUI
' runtime.
' ------------------------------
' %EZGUI_MaxColors = 800
' %EZGUI_MaxFonts = 800
' %EZGUI_MaxImages = 300
' %EZGUI_MaxControls = 1500
' %EZGUI_MaxForms = 150
' %EZGUI_MaxMenus = 200
' ------------------------------
' --------------------
#INCLUDE "C:\ezgui40pro\includes\ezgui40.inc" ' EZGUI Include file for Declares
' --------------------
' *************************************************************************************

' *************************************************************************************
' Code Generator Defined Constants and Declares
' *************************************************************************************
DECLARE FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
DECLARE SUB OtherForm_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)
DECLARE SUB OtherForm_Design(FormName$)
DECLARE FUNCTION PreProcess_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) AS LONG
DECLARE SUB EZ_FORM1_Display(BYVAL Parent$)
DECLARE SUB EZ_FORM1_Design()
DECLARE SUB EZ_FORM1_ParseEvents(CID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
' ------------------------------------------------

%FORM1_TV = 100

DECLARE SUB FORM1_TV_Fill(BYVAL Mode&)
DECLARE SUB FORM1_TV_Events(MyID&, CMsg&, CVal&, Cancel&)

' *************************************************************************************
' Code Generator Defined Global Variables and Types
' *************************************************************************************

' Note: Do NOT change the names of the EZGUI Callback Procedures !

' --------------------
#INCLUDE "C:\ezgui40pro\includes\ezwmain.inc" ' EZGUI Include file for WinMain
' --------------------

' *************************************************************************************
' User Defined Global Variables and Types
' (Put code in CODE TAGS! to protect from deletion by Code Generator !)
' *************************************************************************************

SUB EZ_Main(VerNum&) ' (PROTECTED)
EZ_Reg %EZ_USERID,%EZ_REGNUM
EZ_DefImageFolder "Images"
EZ_AllowCommandEvents 1
EZ_AllowNotifyEvents 1
EZ_AllowKeyEvents 1
EZ_AllowCursorEvents 1
EZ_DefFont 6, "Tahoma", 8, "L+V"
EZ_DefFont 7, "Tahoma", 8, "BV"
EZ_DefFont 8, "Arial", 12, "BV"
EZ_DefFont 9, "Webdings", 16, "L+SV"
EZ_DefSystemColor 32, 4
EZ_DefSystemColor 33, 5
EZ_DefSystemColor 34, 15
EZ_DefSystemColor 35, 24
EZ_DefColorL 36, &HB96FFF
EZ_DefColorL 37, &H14AB9F
EZ_DefColorL 38, &H47A7FF
EZ_DefColorL 39, &HD2AACF
EZ_DefColorL 40, &H1CD5E3
EZ_DefColorL 41, &HBC8943
EZ_DefColorL 42, &H6C6AB7
EZ_DefColorL 43, &HDD4489
IF Main_Initialize(VerNum&) THEN
EZ_FORM1_Display ""
END IF
END SUB

' -------------------------------------------------------------------------------------

SUB EZ_DesignWindow(FormName$) ' (PROTECTED)
SELECT CASE FormName$
CASE "FORM1"
EZ_FORM1_Design
CASE ELSE
OtherForm_Design FormName$
END SELECT
END SUB

' -------------------------------------------------------------------------------------

SUB EZ_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) ' (PROTECTED)
IF PreProcess_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) THEN EXIT SUB
SELECT CASE FormName$
CASE "FORM1"
EZ_FORM1_ParseEvents CID&, CMsg&, CVal&, Cancel&
CASE ELSE
OtherForm_Events FormName$, CID&, CMsg&, CVal&, Cancel&
END SELECT
END SUB

' -------------------------------------------------------------------------------------

' *************************************************************************************
' Applications FORM Code
' *************************************************************************************

' ======================================
' [USER ACCESSABLE CODE] You may Edit !
' ======================================

FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
LOCAL RV&
RV&=1
FUNCTION=RV&
END FUNCTION

SUB OtherForm_Design(FormName$)
SELECT CASE FormName$
CASE ELSE
END SELECT
END SUB

SUB OtherForm_Events(FormName$, CID&, CMsg&, CVal&, Cancel&)
SELECT CASE FormName$
CASE "{OPENDLG}", "{SAVEDLG}", "{OPENDLGX}", "{SAVEDLGX}", "{COLORDLG}", "{FONTDLG}", "{PRINTDLG}", "{PAGEDLG}", "{FINDDLG}"
CASE "{ABORTDLG}"
CASE "{MSGBOX}"
CASE ELSE
END SELECT
END SUB

FUNCTION PreProcess_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) AS LONG
LOCAL RV&
RV&=0
FUNCTION=RV&
END FUNCTION

'<<BEGINFORM>> "FORM1"

' ======================================
' [PROTECTED CODE] Do NOT Edit !
' ======================================

SUB EZ_FORM1_Display(BYVAL Parent$) ' (PROTECTED)
EZ_Color -1, -1
EZ_Form "FORM1", Parent$, "Treeview Test", 0, 0, 35.25, 18, "C"
END SUB

SUB EZ_FORM1_Design() ' (PROTECTED)
LOCAL CText$
EZ_Color-1,-1
EZ_UseFont 6
EZ_SubClass 2
EZ_TreeView %FORM1_TV, 4.25, 1.5, 26.5, 13.625, "-+STV"
EZ_SubClass 0
FORM1_TV_Fill -1
EZ_AddToolTip "Form1", %FORM1_TV
' -----------------------------------------------
END SUB

SUB EZ_FORM1_ParseEvents(CID&, CMsg&, CVal&, Cancel&) ' (PROTECTED)
SELECT CASE CID&
CASE %EZ_Window
FORM1_Events CID&, CMsg&, CVal&, Cancel&
CASE %FORM1_TV
IF CMsg& = %EZ_ToolTip THEN EZ_SetToolTip ""
FORM1_TV_Events CID&, CMsg&, CVal&, Cancel&
CASE ELSE
FORM1_Events CID&, CMsg&, CVal&, Cancel&
END SELECT
END SUB

' ======================================
' [USER ACCESSABLE CODE] You may Edit !
' ======================================

SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
SELECT CASE CID&
CASE %EZ_Window
SELECT CASE CMsg&
CASE %EZ_Loading
CASE %EZ_Loaded
CASE %EZ_Started
CASE %EZ_Close
CASE ELSE
END SELECT
CASE ELSE
END SELECT
END SUB

SUB FORM1_TV_Fill(BYVAL Mode&)
END SUB

SUB FORM1_TV_Events( MyID&, CMsg&, CVal&, Cancel&)
SELECT CASE CMsg&
CASE %EZ_Selected
CASE %EZ_RButtonUp
EZ_MSGBOX "", "Right-clicked!", "", "OK"
CASE %EZ_ToolTip
EZ_SETTOOLTIP "Right-click me! (If one click doesn't work, try TWO!)"
CASE ELSE
END SELECT
END SUB


Chris Boss
Administrator
posted 05-20-2007 11:12 PM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
The treeview appears to prevent the right button up message from being generated. EZGUI isn't doing this, but Windows is.

The best workaround would be to subclass the control and trap the WM_RBUTTONDOWN message.

ie.

code:



SUB FORM1_TREEVIEW1_SubClass(BYVAL CVal&, Cancel&)
LOCAL hCtrl&, Msg&, wParam&, lParam&
EZ_GetSubClass CVal&, hCtrl&, Msg&, wParam&, lParam&
SELECT CASE Msg&
CASE &H204 ' %WM_RBUTTONDOWN
BEEP
CASE ELSE
END SELECT
END SUB


Frank Kelley
Member
posted 05-20-2007 11:35 PM     Click Here to See the Profile for Frank Kelley     Edit/Delete Message Reply w/Quote
Thanks, Chris!

All times are EST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Computer Workshop ( EZGUI ) Home Page

Copyright 2000 to 2007 Christopher R. Boss

Powered by: Ultimate Bulletin Board, Version 5.44
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.