public override void OnLoad() { base.OnLoad(); for (int i = 0; i < 10; i++) { GridColumn column = new GridColumn(); column.Width = 64; AddColumn(column); } Update(); GridRow row = null; for (int i = 0; i < 20; i++) { if (i == 0 || i == 10) { row = new GridRow(); row.Height = 64; AddRow(row); } int col = i; if (i >= 10) { col -= 10; } GridIconCell gridIconCell = new GridIconCell(); row.AddCell(col, gridIconCell); } ResourcePath = DataCenter.GetAppPath() + "\\config\\icons\\"; m_macroService = DataCenter.MacroService; m_macroService.RegisterListener(m_macroService.GetListRequestID, new ListenerMessageCallBack(MacroDatasCallBack)); m_macroService.RegisterListener(m_macroService.OperatorRequestID, new ListenerMessageCallBack(MacroDatasCallBack)); RegisterEvent(new ControlInvokeEvent(Invoke), EVENTID.INVOKE); }
/// <summary> /// 创建窗体 /// </summary> public WindowEx() { BackColor = COLOR.EMPTY; BorderColor = CDraw.PCOLORS_LINECOLOR3; CaptionHeight = 23; Font = new FONT("SimSun", 14, true, false, false); ForeColor = COLOR.EMPTY; Opacity = 0; ResourcePath = DataCenter.GetAppPath() + "\\config"; ShadowColor = CDraw.PCOLORS_BACKCOLOR5; }
/// <summary> /// 创建聊天窗体 /// </summary> /// <param name="native">方法库</param> /// <param name="indicator">指标</param> public ParametersWindow(INativeBase native, CIndicator indicator) { m_indicator = indicator; m_native = native; String xmlPath = DataCenter.GetAppPath() + "\\config\\ParametersWindow.xml"; Native = m_native; LoadFile(xmlPath, null); m_window = FindControl("windowParameters") as WindowEx; GetParameters(); //注册点击事件 RegisterEvents(m_window); }
/// <summary> /// 创建沙盘推演窗体 /// </summary> /// <param name="native">方法库</param> public SandBoxWindow(INativeBase native) { m_native = native; String xmlPath = DataCenter.GetAppPath() + "\\config\\SandBoxWindow.xml"; Native = m_native; LoadFile(xmlPath, null); m_window = FindControl("windowSB") as WindowEx; //注册秒表 m_timerEvent = new ControlTimerEvent(CallTimer); m_window.RegisterEvent(m_timerEvent, EVENTID.TIMER); //注册点击事件 RegisterEvents(m_window); }
/// <summary> /// 创建登录窗体 /// </summary> /// <param name="native">方法库</param> public LoginWindow(INativeBase native) { m_native = native; String xmlPath = DataCenter.GetAppPath() + "\\config\\LoginWindow.xml"; Native = m_native; LoadFile(xmlPath, null); m_window = FindControl("windowLogin") as WindowEx; m_invokeEvent = new ControlInvokeEvent(Invoke); m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE); //注册点击事件 RegisterEvents(m_window); m_loginService = DataCenter.LoginService; m_loginDataCallBackEvent = new ListenerMessageCallBack(LoginDataCallBack); m_loginService.RegisterListener(m_loginRequestID, m_loginDataCallBackEvent); }
/// <summary> /// 创建图形控件 /// </summary> public MainForm() { InitializeComponent(); m_chart = new OwChart(); m_chart.CreateNative(); m_native = m_chart.Native; m_native.Paint = new GdiPlusPaintEx(); m_host = new WinformControlHostEx(); m_host.Native = m_native; m_native.Host = m_host; m_host.HWnd = Handle; m_native.AllowScaleSize = true; m_native.DisplaySize = new SIZE(ClientSize.Width, ClientSize.Height); m_chart.ResetScaleSize(GetClientSize()); Invalidate(); m_chart.Load(DataCenter.GetAppPath() + "\\config\\MainFrame.xml"); m_native.Update(); //m_chart.ShowLoginWindow(); }
/// <summary> /// 创建条件选股界面 /// </summary> /// <param name="native">方法库</param> public IndicatorLayoutList(INativeBase native) { m_native = native; String xmlPath = DataCenter.GetAppPath() + "\\config\\IndicatorLayoutList.xml"; Native = m_native; LoadFile(xmlPath, null); m_window = FindControl("windowILL") as WindowEx; m_gridLayouts = GetGrid("gridLayouts"); m_gridSelectedRowsChangedEvent = new ControlEvent(GridSelectedRowsChanged); m_gridLayouts.RegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED); m_invokeEvent = new ControlInvokeEvent(Invoke); m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE); //注册点击事件 RegisterEvents(m_window); m_indicatorLayoutService = DataCenter.IndicatorLayoutService; m_indicatorLayoutDataCallBack = new ListenerMessageCallBack(IndicatorLayoutDataCallBack); m_indicatorLayoutService.RegisterListener(m_indicatorLayoutService.OperatorRequestID, m_indicatorLayoutDataCallBack); }
/// <summary> /// 创建选股结果界面 /// </summary> /// <param name="native">方法库</param> public SecurityFilterResult(INativeBase native) { m_native = native; String xmlPath = DataCenter.GetAppPath() + "\\config\\SecurityFilterResult.xml"; m_xml = new UIXmlEx(); m_xml.Native = m_native; m_xml.LoadFile(xmlPath, null); m_window = m_xml.FindControl("windowSFR") as WindowEx; m_gridFilterResult = m_xml.FindControl("gridFilterResult") as GridA; m_gridFilterResult.RowStyle.Font = new FONT("SimSun", 14, false, false, false); m_gridCellClick = new GridCellMouseEvent(GridCellClick); m_gridFilterResult.RegisterEvent(m_gridCellClick, EVENTID.GRIDCELLCLICK); //注册秒表 m_timerEvent = new ControlTimerEvent(CallTimer); m_window.RegisterEvent(m_timerEvent, EVENTID.TIMER); //注册点击事件 RegisterEvents(m_window); }
/// <summary> /// 创建连接设置窗体 /// </summary> /// <param name="native">方法库</param> /// <param name="order">主窗体</param> public ConnectWindow(INativeBase native) { m_native = native; String xmlPath = DataCenter.GetAppPath() + "\\config\\ConnectWindow.xml"; Native = native; LoadFile(xmlPath, null); m_window = GetWindow("windowConnect") as WindowEx; m_gridServers = GetGrid("gridServers"); m_gridSelectedRowsChangedEvent = new ControlEvent(GridSelectedRowsChanged); m_gridServers.RegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED); m_connectServer = DataCenter.ConnectService; m_proxyService = DataCenter.ProxyService; m_serverService = DataCenter.ServerService; m_cbMainServerIP = GetComboBox("cbMainServerIP"); m_cbType = GetComboBox("cbType"); m_spinPort = GetSpin("spinPort"); m_txtIP = GetTextBox("txtIP"); m_txtMainServerPort = GetSpin("spinMainServerPort"); //注册点击事件 RegisterEvents(m_window); }
/// <summary> /// 创建条件选股界面 /// </summary> /// <param name="native">方法库</param> public SecurityFilterList(INativeBase native) { m_native = native; String xmlPath = DataCenter.GetAppPath() + "\\config\\SecurityFilterList.xml"; Native = m_native; LoadFile(xmlPath, null); m_window = FindControl("windowSF") as WindowEx; m_gridTemplate = GetGrid("gridTemplates"); m_gridSelectedRowsChangedEvent = new ControlEvent(GridSelectedRowsChanged); m_gridTemplate.RegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED); m_invokeEvent = new ControlInvokeEvent(Invoke); m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE); //注册秒表 m_timerEvent = new ControlTimerEvent(CallTimer); m_window.RegisterEvent(m_timerEvent, EVENTID.TIMER); //注册点击事件 RegisterEvents(m_window); m_securityService = DataCenter.SecurityService; m_securityFilterService = DataCenter.SecurityFilterService; m_securityFilterDataCallBackEvent = new ListenerMessageCallBack(SecurityFilterDataCallBack); m_securityFilterService.RegisterListener(m_securityFilterService.OperatorRequestID, m_securityFilterDataCallBackEvent); }
/// <summary> /// 创建自选股界面 /// </summary> /// <param name="native">方法库</param> public UserSecurityList(INativeBase native) { m_native = native; String xmlPath = DataCenter.GetAppPath() + "\\config\\UserSecurityList.xml"; Native = m_native; LoadFile(xmlPath, null); m_window = FindControl("windowUS") as WindowEx; m_invokeEvent = new ControlInvokeEvent(Invoke); m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE); //注册秒表 m_timerEvent = new ControlTimerEvent(CallTimer); m_window.RegisterEvent(m_timerEvent, EVENTID.TIMER); //注册点击事件 RegisterEvents(m_window); m_gridCategory = GetGrid("gridCategory"); m_gridSelectedRowsChangedEvent = new ControlEvent(GridSelectedRowsChanged); m_gridCategory.RegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED); m_gridCellEditEndEvent = new GridCellEvent(CategoryGridCellEditEnd); m_gridCategory.RegisterEvent(m_gridCellEditEndEvent, EVENTID.GRIDCELLEDITEND); m_gridSecurities = GetGrid("gridSecurities"); m_gridCellClick = new GridCellMouseEvent(GridCellClick); m_gridSecurities.RegisterEvent(m_gridCellClick, EVENTID.GRIDCELLCLICK); //注册服务 m_securityService = DataCenter.SecurityService; m_userSecurityService = DataCenter.UserSecurityService; m_userSecurityDataCallBack = new ListenerMessageCallBack(UserSecurityDataCallBack); m_userSecurityService.RegisterListener(m_userSecurityService.OperatorRequestID, m_userSecurityDataCallBack); //注册行情 m_quoteService = DataCenter.QuoteService; m_latestDataCallBack = new ListenerMessageCallBack(LatestDataCallBack); m_quoteService.RegisterListener(m_latestDataRequestID, m_latestDataCallBack); //搜索文本框 m_txtSearch = GetTextBox("txtSearch"); m_searchTextBoxGotFocus = new ControlEvent(SearchTextBoxGotFocus); m_txtSearch.RegisterEvent(m_searchTextBoxGotFocus, EVENTID.GOTFOCUS); }
/// <summary> /// 加载图标 /// </summary> private void LoadIcons() { String dir = DataCenter.GetAppPath() + "\\config\\icons\\"; m_gridIcons.ResourcePath = dir; List <String> files = new List <String>(); CFileA.GetFiles(dir, files); int filesSize = files.Count; int columnsSize = m_gridIcons.GetColumns().Count; m_gridIcons.BeginUpdate(); GridRow row = null; for (int i = 0; i < filesSize; i++) { int col = i; if (i >= columnsSize) { col = i % columnsSize; } if (col == 0) { row = new GridRow(); row.Height = 64; m_gridIcons.AddRow(row); } String file = files[i]; file = file.Substring(file.LastIndexOf('\\') + 1); GridIconCell iconCell = new GridIconCell(); iconCell.SetString(file); row.AddCell(col, iconCell); } m_gridIcons.EndUpdate(); m_gridIcons.Invalidate(); }
/// <summary> /// 创建宏管理界面 /// </summary> /// <param name="native">方法库</param> public MacroList(INativeBase native) { m_native = native; String xmlPath = DataCenter.GetAppPath() + "\\config\\MacroList.xml"; Native = m_native; LoadFile(xmlPath, null); m_window = FindControl("windowMacro") as WindowEx; m_divIcon = GetDiv("divIcon"); m_divIcon.ResourcePath = DataCenter.GetAppPath() + "\\config\\icons\\"; m_gridIcons = GetGrid("gridIcons"); m_gridCellClickEvent = new GridCellMouseEvent(GridCellClick); m_gridIcons.RegisterEvent(m_gridCellClickEvent, EVENTID.GRIDCELLCLICK); m_gridMacros = GetGrid("gridMacros"); m_gridSelectedRowsChangedEvent = new ControlEvent(GridSelectedRowsChanged); m_gridMacros.RegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED); m_invokeEvent = new ControlInvokeEvent(Invoke); m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE); //注册点击事件 RegisterEvents(m_window); m_macroService = DataCenter.MacroService; m_macroDataCallBack = new ListenerMessageCallBack(MacroDataCallBack); m_macroService.RegisterListener(m_macroService.OperatorRequestID, m_macroDataCallBack); }
/// <summary> /// 创建单元格 /// </summary> public UserSecurityCellT2() { AllowDrag = true; BorderColor = COLOR.EMPTY; ResourcePath = DataCenter.GetAppPath() + "\\config\\images"; }