期貨量化軟件:赫茲量化窗體對象中的圖形和鼠標(biāo)事件的處理
現(xiàn)在,每個窗體對象都將擁有一個新的“與環(huán)境交互”屬性。 如果設(shè)置了該屬性,則表示對象應(yīng)根據(jù)其狀態(tài)響應(yīng)鼠標(biāo)操作。 其余的窗體對象應(yīng)該在重置窗體中具有該標(biāo)志。 這可令我們選擇光標(biāo)懸停在其上的窗體(按下按鈕),以及其它任何僅可針對單一窗體執(zhí)行的必要操作,從而無關(guān)圖表不響應(yīng)鼠標(biāo)操作。
在同一文件中,在畫布上的圖形元素整數(shù)型屬性枚舉中設(shè)置屬性:
//+------------------------------------------------------------------+ //| Integer properties of the graphical element on the canvas ? ? ? ?| //+------------------------------------------------------------------+ enum ENUM_CANV_ELEMENT_PROP_INTEGER ?{ ? CANV_ELEMENT_PROP_ID = 0, ? ? ? ? ? ? ? ? ? ? ? ? ?// Element ID ? CANV_ELEMENT_PROP_TYPE, ? ? ? ? ? ? ? ? ? ? ? ? ? ?// Graphical element type ? CANV_ELEMENT_PROP_BELONG, ? ? ? ? ? ? ? ? ? ? ? ? ?// Graphical element affiliation ? CANV_ELEMENT_PROP_NUM, ? ? ? ? ? ? ? ? ? ? ? ? ? ? // Element index in the list ? CANV_ELEMENT_PROP_CHART_ID, ? ? ? ? ? ? ? ? ? ? ? ?// Chart ID ? CANV_ELEMENT_PROP_WND_NUM, ? ? ? ? ? ? ? ? ? ? ? ? // Chart subwindow index ? CANV_ELEMENT_PROP_COORD_X, ? ? ? ? ? ? ? ? ? ? ? ? // Form's X coordinate on the chart ? CANV_ELEMENT_PROP_COORD_Y, ? ? ? ? ? ? ? ? ? ? ? ? // Form's Y coordinate on the chart ? CANV_ELEMENT_PROP_WIDTH, ? ? ? ? ? ? ? ? ? ? ? ? ? // Element width ? CANV_ELEMENT_PROP_HEIGHT, ? ? ? ? ? ? ? ? ? ? ? ? ?// Element height ? CANV_ELEMENT_PROP_RIGHT, ? ? ? ? ? ? ? ? ? ? ? ? ? // Element right border ? CANV_ELEMENT_PROP_BOTTOM, ? ? ? ? ? ? ? ? ? ? ? ? ?// Element bottom border ? CANV_ELEMENT_PROP_ACT_SHIFT_LEFT, ? ? ? ? ? ? ? ? ?// Active area offset from the left edge of the element ? CANV_ELEMENT_PROP_ACT_SHIFT_TOP, ? ? ? ? ? ? ? ? ? // Active area offset from the upper edge of the element ? CANV_ELEMENT_PROP_ACT_SHIFT_RIGHT, ? ? ? ? ? ? ? ? // Active area offset from the right edge of the element ? CANV_ELEMENT_PROP_ACT_SHIFT_BOTTOM, ? ? ? ? ? ? ? ?// Active area offset from the bottom edge of the element ? CANV_ELEMENT_PROP_MOVABLE, ? ? ? ? ? ? ? ? ? ? ? ? // Element moveability flag ? CANV_ELEMENT_PROP_ACTIVE, ? ? ? ? ? ? ? ? ? ? ? ? ?// Element activity flag ? CANV_ELEMENT_PROP_INTERACTION, ? ? ? ? ? ? ? ? ? ? // Flag of interaction with the outside environment ? CANV_ELEMENT_PROP_COORD_ACT_X, ? ? ? ? ? ? ? ? ? ? // X coordinate of the element active area ? CANV_ELEMENT_PROP_COORD_ACT_Y, ? ? ? ? ? ? ? ? ? ? // Y coordinate of the element active area ? CANV_ELEMENT_PROP_ACT_RIGHT, ? ? ? ? ? ? ? ? ? ? ? // Right border of the element active area ? CANV_ELEMENT_PROP_ACT_BOTTOM, ? ? ? ? ? ? ? ? ? ? ?// Bottom border of the element active area ?}; #define CANV_ELEMENT_PROP_INTEGER_TOTAL (23) ? ? ? ? ?// Total number of integer properties #define CANV_ELEMENT_PROP_INTEGER_SKIP ?(0) ? ? ? ? ? // Number of integer properties not used in sorting //+------------------------------------------------------------------+