股票量化軟件:赫茲量化移動擴展的標準圖形對象的軸點
如果鼠標光標位于窗體內(nèi),但在其活動區(qū)域之外,我們就可以實現(xiàn),例如,在按下鼠標右鍵時激活復合圖形對象的關(guān)聯(lián)菜單。 如果光標位于活動區(qū)域之內(nèi),那么,除了關(guān)聯(lián)菜單之外,我們還可以用鼠標抓取該窗體,并移動它。 在這種情況下,附著在窗體里的線端點也會隨之移動。
當然,這只是一個嘗試復合圖形對象新功能的測試。 在創(chuàng)建了創(chuàng)建復合圖形對象和處理窗體對象所需的所有工具之后,我將創(chuàng)建一組用于開發(fā)自定義對象的標準庫復合圖形對象。 創(chuàng)造它們是作為一個示例,并講述如何創(chuàng)建自己的這類對象。
目前,我只是在開發(fā)函數(shù)庫的功能,并為制作自定義對象“添磚加瓦”。 在我的文章中講述、分析和實現(xiàn)的步驟,可作為“按原樣”使用的基礎(chǔ),而無需從頭開始實現(xiàn)一切。
改進庫類
打開 并實現(xiàn)一些修改。
軸心點控件窗體包含一個點和一個圓圈。 所應(yīng)用顏色之前已在代碼中正確指定。 我們添加含有默認顏色的宏替換:
//--- Pending request type IDs #define PENDING_REQUEST_ID_TYPE_ERR ? ?(1) ? ? ? ? ? ? ? ? ? ? ? ?// Type of a pending request created based on the server return code #define PENDING_REQUEST_ID_TYPE_REQ ? ?(2) ? ? ? ? ? ? ? ? ? ? ? ?// Type of a pending request created by request //--- Timeseries parameters #define SERIES_DEFAULT_BARS_COUNT ? ? ?(1000) ? ? ? ? ? ? ? ? ? ? // Required default amount of timeseries data #define PAUSE_FOR_SYNC_ATTEMPTS ? ? ? ?(16) ? ? ? ? ? ? ? ? ? ? ? // Amount of pause milliseconds between synchronization attempts #define ATTEMPTS_FOR_SYNC ? ? ? ? ? ? ?(5) ? ? ? ? ? ? ? ? ? ? ? ?// Number of attempts to receive synchronization with the server //--- Tick series parameters #define TICKSERIES_DEFAULT_DAYS_COUNT ?(1) ? ? ? ? ? ? ? ? ? ? ? ?// Required number of days for tick data in default series #define TICKSERIES_MAX_DATA_TOTAL ? ? ?(200000) ? ? ? ? ? ? ? ? ? // Maximum number of stored tick data of a single symbol //--- Parameters of the DOM snapshot series #define MBOOKSERIES_DEFAULT_DAYS_COUNT (1) ? ? ? ? ? ? ? ? ? ? ? ?// The default required number of days for DOM snapshots in the series #define MBOOKSERIES_MAX_DATA_TOTAL ? ? (200000) ? ? ? ? ? ? ? ? ? // Maximum number of stored DOM snapshots of a single symbol //--- Canvas parameters #define PAUSE_FOR_CANV_UPDATE ? ? ? ? ?(16) ? ? ? ? ? ? ? ? ? ? ? // Canvas update frequency #define CLR_CANV_NULL ? ? ? ? ? ? ? ? ?(0x00FFFFFF) ? ? ? ? ? ? ? // Zero for the canvas with the alpha channel #define OUTER_AREA_SIZE ? ? ? ? ? ? ? ?(16) ? ? ? ? ? ? ? ? ? ? ? // Size of one side of the outer area around the form workspace //--- Graphical object parameters #define PROGRAM_OBJ_MAX_ID ? ? ? ? ? ? (10000) ? ? ? ? ? ? ? ? ? ?// Maximum value of an ID of a graphical object belonging to a program #define CTRL_POINT_RADIUS ? ? ? ? ? ? ?(5) ? ? ? ? ? ? ? ? ? ? ? ?// Radius of the control point on the form for managing graphical object pivot points #define CTRL_POINT_COLOR ? ? ? ? ? ? ? (clrDodgerBlue) ? ? ? ? ? ?// Radius of the control point on the form for managing graphical object pivot points #define CTRL_FORM_SIZE ? ? ? ? ? ? ? ? (40) ? ? ? ? ? ? ? ? ? ? ? // Size of the control point form for managing graphical object pivot points //+------------------------------------------------------------------+ //| Enumerations ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | //+------------------------------------------------------------------+