废话不说,在主程序里有调用了一个pythong的脚本graphts.py,调试的时候很容易搜索到这字串,那么实际我们可以见到的是编译过的字节编译文件graphts.pyc
这里提供反编译出来的原文件,文件中数字后面的 L 是指长整形的意思,更新到用中文字串同时2楼给出呈现的界面图形让大家有更直观的感受,
python语句不是太难,只要主意下缩进格式就行了
反编译于graphts.pyc
- def RGB(r, g, b):
- return b * 2L ** 16L + g * 2L ** 8L + r
- nWndIDTitle_Stock = 0L
- nWndIDTitle_CurGrade = 0L
- nWndIDPie_CurGrade = 0L
- nWndIDGrid_CurGrade = 0L
- nWndIDSwitch_CurGrade = 0L
- nWndIDTitle_DynGrade = 0L
- nWndIDChart_DynGrade = 0L
- nWndIDEdit_CollGrade = 0L
- nWndIDTitle_Prifit = 0L
- nWndIDGrid_Prifit = 0L
- nWndIDTitle_Detail = 0L
- nWndIDEdit_Desc = 0L
- nWndIDGrid_Detail = 0L
- CLR_BACK = RGB(0L, 0L, 0L)
- CLR_WHITE = RGB(255L, 255L, 255L)
- CLR_GRAY = RGB(128L, 128L, 128L)
- CLR_GRAY2 = RGB(192L, 192L, 192L)
- CLR_BLUE = RGB(0L, 0L, 255L)
- CLR_BLUE_LIGHT = RGB(0L, 0L, 128L)
- CLR_YELLOW = RGB(255L, 255L, 0L)
- CLR_RED = RGB(255L, 0L, 0L)
- CLR_RED_LIGHT = RGB(128L, 0L, 0L)
- CLR_GREEN = RGB(0L, 255L, 0L)
- CLR_QING = RGB(0L, 255L, 255L)
- GRID_COL_WIDTH = 100L
- GRID_ROW_HEIGHT = 25L
- GRID_MAX_HEIGHT = 192L
- nFrameWidth = 790L
- nChartHigh = 240L
- nInterval = 10L
- nPieHigh = 240L
- nTitleHigh = 20L
- nComboHigh = 18L
- nEditWidth = 780L
- g_StockCode = ''
- g_StockName = ''
- g_bFlag = 0L
- g_nErrCode = 0L
- nWndIDEdit_Error = 0L
- g_listCurGrade = []
- g_dictDynGrade = {}
- g_dictGradeReport = {}
- def FormatDecimal(sDecimal):
- if sDecimal == '':
- sRet = '--'
- return sRet
- try:
- fDecimal = float(sDecimal)
- except:
- fDecimal = 0.0
- if fDecimal != 0.0:
- fDecimal = '%5.2f' % fDecimal
- sRet = str(fDecimal)
- else:
- sRet = '--'
- return sRet
- def DivideHundred(sValue):
- if sValue == '':
- sRet = '--'
- return sRet
- try:
- fValue = float(sValue)
- except:
- fValue = 0.0
- if fValue != 0.0:
- fValue = fValue / 100L
- fValue = '%5.2f' % fValue
- sRet = str(fValue)
- else:
- sRet = '--'
- return sRet
- def MultiHundred(sValue):
- if sValue == '':
- sRet = '--'
- return sRet
- try:
- fValue = float(sValue)
- except:
- fValue = 0.0
- if fValue != 0.0:
- fValue = fValue * 100L
- fValue = '%5.2f' % fValue
- sRet = str(fValue)
- else:
- sRet = '--'
- return sRet
- def FormatInt(sValue):
- try:
- iValue = int(sValue)
- except:
- iValue = 0L
- sInt = str(iValue)
- if sInt == '' or sInt == '0':
- sInt = '--'
- return sInt
- def FormatMonth(sMonth):
- nLen = len(sMonth)
- if nLen == 0L:
- sRet = '--'
- return sRet
- if nLen != 6L:
- return sMonth
- else:
- sRet = sMonth[4L:6L]
- sRet += '/'
- sRet += sMonth[0L:4L]
- return sRet
- def FormatStr(sStr):
- if sStr == '' or len(sStr) == 0L:
- sRet = '--'
- else:
- sRet = sStr
- return sRet
- def FormatReport(sReport):
- nLen = len(sReport)
- if nLen == 0L:
- sRet = '--'
- return sRet
- if nLen != 8L:
- return sReport
- else:
- sRet = sReport[0L:4L]
- sRet += '-'
- sRet += sReport[4L:6L]
- sRet += '-'
- sRet += sReport[6L:8L]
- return sRet
- def InitWndSize():
- globDict = globals()
- if globDict['g_nErrCode'] == 0L and globDict['g_bFlag'] == 1L:
- pyContainer.MoveWndRect(globDict['nWndIDGrid_CurGrade'], 0L, 0L, 0L, 0L, 0L)
- pyContainer.MoveWndRect(globDict['nWndIDGrid_Prifit'], 0L, 0L, 0L, 0L, 0L)
- pyContainer.MoveWndRect(globDict['nWndIDGrid_Detail'], 0L, 0L, 0L, 0L, 0L)
- def OnSize(sCx, sCy):
- ReSize(sCx, sCy, 1L)
- def ReSize(sCx, sCy, bRepaint):
- nFrameLeft = 0L
- globDict = globals()
- InitWndSize()
- containersize = pyContainer.GetContainerSize()
- conWidth = containersize[0L]
- conHight = containersize[1L]
- if conWidth > nFrameWidth:
- nFrameLeft = (conWidth - nFrameWidth) / 2L - 1L
- ntop = nInterval / 2L
- if globDict['g_nErrCode'] == 0L:
- if globDict['g_bFlag'] == 1L:
- pyContainer.MoveWndRect(globDict['nWndIDTitle_Stock'], nFrameLeft, ntop, 180L, 22L, 0L)
- tup = pyContainer.Edit_GetReqSize(globDict['nWndIDEdit_CollGrade'])
- pyContainer.MoveWndRect(globDict['nWndIDEdit_CollGrade'], nFrameLeft + 185L, ntop + 3L, 400L, tup[1L], 0L)
- ntop += 22L
- ntop += nInterval / 2L
- pyContainer.MoveWndRect(globDict['nWndIDTitle_DynGrade'], nFrameLeft + 5L, ntop, nFrameWidth / 2L + 15L, nTitleHigh, 0L)
- pyContainer.MoveWndRect(globDict['nWndIDTitle_CurGrade'], nFrameLeft + nFrameWidth / 2L + 15L, ntop, nFrameWidth / 2L - 20L, nTitleHigh, 0L)
- ntop += nTitleHigh
- pyContainer.MoveWndRect(globDict['nWndIDChart_DynGrade'], nFrameLeft + 5L, ntop, nFrameWidth / 2L + 15L, nChartHigh, 0L)
- pyContainer.MoveWndRect(globDict['nWndIDPie_CurGrade'], nFrameLeft + nFrameWidth / 2L + 15L, ntop + 10L, nPieHigh, nPieHigh, 0L)
- pyContainer.MoveWndRect(globDict['nWndIDSwitch_CurGrade'], nFrameLeft + nFrameWidth / 2L + nPieHigh + 15L, ntop + 15L, 70L, nTitleHigh, 0L)
- GridSize = pyContainer.Grid_GetTotalSize(globDict['nWndIDGrid_CurGrade'])
- pyContainer.MoveWndRect(globDict['nWndIDGrid_CurGrade'], nFrameLeft + nFrameWidth / 2L + nPieHigh + 15L, ntop + 15L + nTitleHigh, GridSize[0L], GridSize[1L], 0L)
- ntop += nChartHigh
- ntop += nInterval / 2L
- pyContainer.MoveWndRect(globDict['nWndIDTitle_Prifit'], nFrameLeft + 5L, ntop, nFrameWidth - 10L, nTitleHigh, 0L)
- ntop += nTitleHigh
- ntop += nInterval / 2L
- GridSize = pyContainer.Grid_GetTotalSize(globDict['nWndIDGrid_Prifit'])
- pyContainer.MoveWndRect(globDict['nWndIDGrid_Prifit'], nFrameLeft + 5L, ntop, GridSize[0L], GridSize[1L], 0L)
- ntop += GridSize[1L]
- ntop += nInterval
- pyContainer.MoveWndRect(globDict['nWndIDTitle_Detail'], nFrameLeft + 5L, ntop, nFrameWidth - 10L, nTitleHigh, 0L)
- ntop += nTitleHigh
- ntop += nInterval / 2L
- GridSize = pyContainer.Grid_GetTotalSize(globDict['nWndIDGrid_Detail'])
- pyContainer.MoveWndRect(globDict['nWndIDGrid_Detail'], nFrameLeft + 5L, ntop, nFrameWidth - 10L, GRID_MAX_HEIGHT, 0L)
- ntop += GRID_MAX_HEIGHT
- ntop += nInterval
- tup = pyContainer.Edit_GetReqSize(globDict['nWndIDEdit_Desc'])
- pyContainer.MoveWndRect(globDict['nWndIDEdit_Desc'], nFrameLeft + 5L, ntop, nEditWidth, tup[1L], 0L)
- ntop += tup[1L]
- ntop += nInterval / 2L
- else:
- if globDict['g_nErrCode'] == 1L or globDict['g_nErrCode'] == 2L:
- tup = pyContainer.Edit_GetReqSize(globDict['nWndIDEdit_Error'])
- pyContainer.MoveWndRect(globDict['nWndIDEdit_Error'], nFrameLeft, ntop, nEditWidth, tup[1L], 0L)
- pyContainer.SetFocusWnd(-1L)
- if bRepaint:
- bRepaint
- pyContainer.InvalidateWnd(1L)
- else:
- bRepaint
- def OnSwitchChanged(sWndID, sCurLabelID):
- globDict = globals()
- def OnGridSelChanged(sWndID, sRow, sCol):
- globDict = globals()
- def OnGridLButClick(sWndID, sRow, sCol):
- if int(sCol) == 20L and int(sRow) >= 2L:
- strtext = pyContainer.Grid_GetHideStr(int(sWndID), int(sRow), int(sCol))
- pyContainer.DlgShowText('报告摘要', strtext, RGB(0L, 0L, 0L), CLR_YELLOW)
- if int(sCol) == 19L and int(sRow) >= 2L:
- strtext = pyContainer.Grid_GetHideStr(int(sWndID), int(sRow), int(sCol))
- pyContainer.FetchFile('', strtext)
- def OnGridLButDblClick(sWndID, sRow, sCol):
- globDict = globals()
- def OnPieSelChanged(sWndID, sElementID, szElement):
- a = 1L
- def OnComboSelChanged(sWndID, sSelItem, szSelItem):
- globDict = globals()
- def AddChart(sWndID):
- globDict = globals()
- globDict[sWndID] = pyContainer.Chart_AddWnd(0L, 0L, 0L, 0L, '')
- pyContainer.Chart_EnableRefresh(globDict[sWndID], 0L)
- pyContainer.Chart_SetBackColor(globDict[sWndID], CLR_BACK)
- pyContainer.Chart_SetZoomEnabled(globDict[sWndID], 0L)
- pyContainer.Chart_SetPanEnabled(globDict[sWndID], 0L)
- pyContainer.Chart_SetTitleColor(globDict[sWndID], CLR_GRAY)
- pyContainer.Chart_LegendDockSide(globDict[sWndID], 3L)
- pyContainer.Chart_SetLegendBackColor(globDict[sWndID], CLR_GRAY)
- pyContainer.Chart_SetLegendVisable(globDict[sWndID], 0L)
- pyContainer.Chart_SetLegendHorizontalMode(globDict[sWndID], 1L)
- pyContainer.Chart_SetLegendShadowDepth(globDict[sWndID], 2L)
- pyContainer.Chart_SetLegendShadowColor(globDict[sWndID], CLR_BACK)
- pyContainer.Chart_SetLegendFont(globDict[sWndID], 100L, '宋体')
- pyContainer.Chart_CreateAxis(globDict[sWndID], 0L, 0L)
- pyContainer.Chart_SetAxisColor(globDict[sWndID], 0L, CLR_GRAY)
- pyContainer.Chart_SetAxisTextColor(globDict[sWndID], 0L, CLR_GRAY)
- pyContainer.Chart_SetGridVisable(globDict[sWndID], 0L, 1L)
- pyContainer.Chart_CreateAxis(globDict[sWndID], 1L, 0L)
- pyContainer.Chart_SetAxisColor(globDict[sWndID], 1L, CLR_GRAY)
- pyContainer.Chart_SetGridVisable(globDict[sWndID], 1L, 0L)
- pyContainer.Chart_SetAxisTextColor(globDict[sWndID], 1L, CLR_GRAY)
- pyContainer.Chart_SetAxisFont(globDict[sWndID], 1L, 100L, '宋体')
- pyContainer.Chart_EnableRefresh(globDict[sWndID], 1L)
- def AddPie(sWndID):
- globDict = globals()
- globDict[sWndID] = pyContainer.Pie_AddWnd(0L, 0L, nPieHigh, nPieHigh, '')
- pyContainer.Pie_EnableBkColorGradient(globDict[sWndID], 0L)
- pyContainer.Pie_SetPieChartStyle(globDict[sWndID], 2L)
- pyContainer.Pie_SetBackgrndColor(globDict[sWndID], CLR_BACK)
- pyContainer.Pie_SetTitleColor(globDict[sWndID], CLR_YELLOW)
- pyContainer.Pie_DockTitle(globDict[sWndID], 0L)
- pyContainer.Pie_SetTitleFont(globDict[sWndID], 100L, '宋体', 0L)
- pyContainer.Pie_ShowPieLable(globDict[sWndID], 0L)
- def FillPie_CurGrade():
- globDict = globals()
- pyContainer.Pie_SetPieChartTitle(globDict['nWndIDPie_CurGrade'], '评级分布')
- pyContainer.Pie_RemoveAllItem(globDict['nWndIDPie_CurGrade'])
- list = []
- list = globDict['g_listCurGrade']
- if len(list) != 0L:
- pyContainer.Pie_InsertItem(globDict['nWndIDPie_CurGrade'], '买入', 'Lable1', float(list[3L]), RGB(255L, 0L, 0L))
- pyContainer.Pie_InsertItem(globDict['nWndIDPie_CurGrade'], '增持', 'Lable2', float(list[4L]), RGB(255L, 85L, 0L))
- pyContainer.Pie_InsertItem(globDict['nWndIDPie_CurGrade'], '中性', 'Lable2', float(list[5L]), RGB(255L, 170L, 0L))
- pyContainer.Pie_InsertItem(globDict['nWndIDPie_CurGrade'], '减持', 'Lable3', float(list[6L]), RGB(120L, 255L, 0L))
- pyContainer.Pie_InsertItem(globDict['nWndIDPie_CurGrade'], '卖出', 'Lable4', float(list[7L]), RGB(0L, 255L, 0L))
- pyContainer.Pie_InsertItem(globDict['nWndIDPie_CurGrade'], '无评级', 'Lable4', float(list[8L]), RGB(192L, 192L, 192L))
- del list
- pyContainer.Pie_SetElementTransparencyAll(globDict['nWndIDPie_CurGrade'], 50L)
- pyContainer.Pie_SetDistanceIndexAll(globDict['nWndIDPie_CurGrade'], 4L)
- pyContainer.Pie_SetInclineAngle(globDict['nWndIDPie_CurGrade'], 10L)
- pyContainer.Pie_SetItemHighlightColor(globDict['nWndIDPie_CurGrade'], CLR_QING)
- def AddGrid_CurGrade():
- globDict = globals()
- globDict['nWndIDGrid_CurGrade'] = pyContainer.Grid_AddWnd(0L, 0L, 0L, 0L, '')
- pyContainer.Grid_SetGridBkColor(globDict['nWndIDGrid_CurGrade'], CLR_BACK)
- pyContainer.Grid_SetGridLines(globDict['nWndIDGrid_CurGrade'], 3L)
- pyContainer.Grid_SetGridLineColor(globDict['nWndIDGrid_CurGrade'], CLR_GRAY)
- pyContainer.Grid_SetRowCount(globDict['nWndIDGrid_CurGrade'], 7L)
- pyContainer.Grid_SetColumnCount(globDict['nWndIDGrid_CurGrade'], 2L)
- pyContainer.Grid_SetFixedTextColor(globDict['nWndIDGrid_CurGrade'], CLR_GRAY)
- pyContainer.Grid_SetFixedRowCount(globDict['nWndIDGrid_CurGrade'], 1L)
- pyContainer.Grid_SetFixedColumnCount(globDict['nWndIDGrid_CurGrade'], 1L)
- pyContainer.Grid_SetListMode(globDict['nWndIDGrid_CurGrade'], 1L)
- pyContainer.Grid_SetColumnResize(globDict['nWndIDGrid_CurGrade'], 0L)
- pyContainer.Grid_SetHeaderSort(globDict['nWndIDGrid_CurGrade'], 0L)
- pyContainer.Grid_SetSingleRowSelection(globDict['nWndIDGrid_CurGrade'], 1L)
- pyContainer.Grid_SetFixedBkColor(globDict['nWndIDGrid_CurGrade'], CLR_BACK)
- pyContainer.Grid_SetTextBkColor(globDict['nWndIDGrid_CurGrade'], CLR_BACK)
- pyContainer.Grid_SetFixedRowFont(globDict['nWndIDGrid_CurGrade'], 100L, '宋体')
- pyContainer.Grid_SetNonFixedRowFont(globDict['nWndIDGrid_CurGrade'], 100L, '宋体')
- pyContainer.Grid_SetNonSortColWidth(globDict['nWndIDGrid_CurGrade'], 0L)
- pyContainer.Grid_EnableSelectFixedColumn(globDict['nWndIDGrid_CurGrade'], 0L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 0L, 0L, CLR_BACK, CLR_GRAY, '合计', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 1L, 0L, CLR_BACK, CLR_GRAY, '买入', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 2L, 0L, CLR_BACK, CLR_GRAY, '增持', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 3L, 0L, CLR_BACK, CLR_GRAY, '中性', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 4L, 0L, CLR_BACK, CLR_GRAY, '减持', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 5L, 0L, CLR_BACK, CLR_GRAY, '卖出', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 6L, 0L, CLR_BACK, CLR_GRAY, '无评级', 1L)
- for row in range(0L, 7L):
- pyContainer.Grid_SetRowHeight(globDict['nWndIDGrid_CurGrade'], row, GRID_ROW_HEIGHT)
- pyContainer.Grid_SetColumnWidth(globDict['nWndIDGrid_CurGrade'], 0L, 70L)
- pyContainer.Grid_SetColumnWidth(globDict['nWndIDGrid_CurGrade'], 1L, 65L)
- def FillGrid_CurGrade():
- globDict = globals()
- T001 = ''
- T003 = ''
- T004 = ''
- T005 = ''
- T006 = ''
- T007 = ''
- T008 = ''
- list = []
- list = globDict['g_listCurGrade']
- if len(list) != 0L:
- T003 = list[3L]
- T004 = list[4L]
- T005 = list[5L]
- T006 = list[6L]
- T007 = list[7L]
- T008 = list[8L]
- nTotal = int(T003)
- nTotal += int(T004)
- nTotal += int(T005)
- nTotal += int(T006)
- nTotal += int(T007)
- nTotal += int(T008)
- T001 = str(nTotal)
- del list
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 0L, 1L, CLR_BACK, CLR_GRAY, FormatInt(T001), 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 1L, 1L, CLR_BACK, CLR_YELLOW, FormatInt(T003), 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 2L, 1L, CLR_BACK, CLR_YELLOW, FormatInt(T004), 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 3L, 1L, CLR_BACK, CLR_YELLOW, FormatInt(T005), 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 4L, 1L, CLR_BACK, CLR_YELLOW, FormatInt(T006), 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 5L, 1L, CLR_BACK, CLR_YELLOW, FormatInt(T007), 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 6L, 1L, CLR_BACK, CLR_YELLOW, FormatInt(T008), 1L)
- pyContainer.Grid_InvalidateWnd(globDict['nWndIDGrid_CurGrade'], 1L)
- def FillChart_DynGrade():
- globDict = globals()
- pyContainer.Chart_EnableRefresh(globDict['nWndIDChart_DynGrade'], 0L)
- pyContainer.Chart_RemoveAllSeries(globDict['nWndIDChart_DynGrade'])
- nSeriesID = pyContainer.Chart_CreateXYPointSeries(globDict['nWndIDChart_DynGrade'], 2L, 0L, 0L)
- dict = {}
- dict = globDict['g_dictDynGrade']
- list = []
- for sKey in dict:
- list.append(sKey)
- list.sort(None, None, 0L)
- for i in range(0L, len(list)):
- sKey = list[i]
- T001 = dict[sKey][0L]
- pyContainer.Chart_AddXYPointAttUserData(globDict['nWndIDChart_DynGrade'], nSeriesID, i, float(T001), FormatReport(sKey))
- pyContainer.Chart_EnableAxisCustomTick(globDict['nWndIDChart_DynGrade'], 1L, 1L)
- pyContainer.Chart_SetAxisActiveSeries(globDict['nWndIDChart_DynGrade'], 1L, nSeriesID)
- pyContainer.Chart_SetSeriesColor(globDict['nWndIDChart_DynGrade'], nSeriesID, CLR_BLUE)
- pyContainer.Chart_EnableAxisSlopeFont(globDict['nWndIDChart_DynGrade'], 1L, 1L)
- pyContainer.Chart_SetAxisSlopeDegree(globDict['nWndIDChart_DynGrade'], 1L, 28L)
- pyContainer.Chart_SetLineWidth(globDict['nWndIDChart_DynGrade'], nSeriesID, 2L)
- pyContainer.Chart_SetFixedPointSize(globDict['nWndIDChart_DynGrade'], nSeriesID, 6L, 6L)
- pyContainer.Chart_SetFixedBorderColor(globDict['nWndIDChart_DynGrade'], nSeriesID, CLR_BLUE_LIGHT)
- pyContainer.Chart_SetFixedPointType(globDict['nWndIDChart_DynGrade'], nSeriesID, 1L)
- pyContainer.Chart_SetAxisLableColor(globDict['nWndIDChart_DynGrade'], 0L, CLR_GRAY)
- pyContainer.Chart_SetAxisLableVisable(globDict['nWndIDChart_DynGrade'], 0L, 1L)
- pyContainer.Chart_SetAxisLableText(globDict['nWndIDChart_DynGrade'], 0L, '动态综合评级分')
- pyContainer.Chart_SetAxisLableFont(globDict['nWndIDChart_DynGrade'], 0L, 100L, '宋体')
- pyContainer.Chart_SetAxisAutomatic(globDict['nWndIDChart_DynGrade'], 0L, 1L)
- tup = pyContainer.Chart_GetAxisMinMax(globDict['nWndIDChart_DynGrade'], 0L)
- inc = pyContainer.Chart_GetAxisTickIncrement(globDict['nWndIDChart_DynGrade'], 0L)
- dMin = tup[0L] - inc / 4L
- if tup[0L] < tup[1L]:
- pyContainer.Chart_SetAxisAutomatic(globDict['nWndIDChart_DynGrade'], 0L, 0L)
- pyContainer.Chart_SetAxisMinMax(globDict['nWndIDChart_DynGrade'], 0L, dMin, tup[1L] + inc / 4L)
- else:
- if tup[0L] == tup[1L]:
- pyContainer.Chart_SetNormalTickIncrement(globDict['nWndIDChart_DynGrade'], 0L, 0L, 0.01)
- pyContainer.Chart_SetAxisAutomatic(globDict['nWndIDChart_DynGrade'], 1L, 1L)
- tup = pyContainer.Chart_GetAxisMinMax(globDict['nWndIDChart_DynGrade'], 1L)
- pyContainer.Chart_SetNormalTickIncrement(globDict['nWndIDChart_DynGrade'], 1L, 0L, 1L)
- pyContainer.Chart_SetAxisMinMax(globDict['nWndIDChart_DynGrade'], 1L, tup[0L] - 0.1, tup[1L] + 0.1)
- pyContainer.Chart_EnableRefresh(globDict['nWndIDChart_DynGrade'], 1L)
- return None
- def AddGrid_Profit(xmlnode, sWndID):
- globDict = globals()
- globDict[sWndID] = pyContainer.Grid_AddWnd(0L, 0L, 0L, 0L, '')
- pyContainer.Grid_SetGridBkColor(globDict[sWndID], CLR_BACK)
- pyContainer.Grid_SetGridLines(globDict[sWndID], 3L)
- pyContainer.Grid_SetGridLineColor(globDict[sWndID], CLR_GRAY)
- pyContainer.Grid_SetRowCount(globDict[sWndID], 8L)
- pyContainer.Grid_SetColumnCount(globDict[sWndID], 7L)
- pyContainer.Grid_SetFixedTextColor(globDict[sWndID], CLR_GRAY)
- pyContainer.Grid_SetFixedRowCount(globDict[sWndID], 1L)
- pyContainer.Grid_SetFixedColumnCount(globDict[sWndID], 1L)
- pyContainer.Grid_SetListMode(globDict[sWndID], 1L)
- pyContainer.Grid_SetColumnResize(globDict[sWndID], 0L)
- pyContainer.Grid_SetHeaderSort(globDict[sWndID], 0L)
- pyContainer.Grid_SetSingleRowSelection(globDict[sWndID], 1L)
- pyContainer.Grid_SetFixedBkColor(globDict[sWndID], CLR_BACK)
- pyContainer.Grid_SetTextBkColor(globDict[sWndID], CLR_BACK)
- pyContainer.Grid_SetFixedRowFont(globDict[sWndID], 100L, '宋体')
- pyContainer.Grid_SetNonFixedRowFont(globDict[sWndID], 100L, '宋体')
- pyContainer.Grid_SetItem(globDict[sWndID], 0L, 0L, CLR_BACK, CLR_GRAY, '指标 ', 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 0L, 1L, CLR_BACK, CLR_GRAY, '2007A', 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 0L, 2L, CLR_BACK, CLR_GRAY, '2008A', 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 0L, 3L, CLR_BACK, CLR_GRAY, '2009A', 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 0L, 4L, CLR_BACK, CLR_GRAY, '2010E', 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 0L, 5L, CLR_BACK, CLR_GRAY, '2011E', 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 0L, 6L, CLR_BACK, CLR_GRAY, '2012E', 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 1L, 0L, CLR_BACK, CLR_GRAY, '营业总收入(百万元)', 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 2L, 0L, CLR_BACK, CLR_GRAY, '营业总收入增长率(%)', 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 3L, 0L, CLR_BACK, CLR_GRAY, '归属母公司净利润(百万元)', 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 4L, 0L, CLR_BACK, CLR_GRAY, '净利润增长率(%)', 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 5L, 0L, CLR_BACK, CLR_GRAY, '摊薄每股收益(元)', 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 6L, 0L, CLR_BACK, CLR_GRAY, '市盈率(倍)', 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 7L, 0L, CLR_BACK, CLR_GRAY, 'PEG ', 2L)
- cIndex = 1L
- sValue = ''
- while xmlnode:
- xmlnode
- pyContainer.Grid_SetItem(globDict[sWndID], 1L, cIndex, CLR_BACK, CLR_YELLOW, DivideHundred(pyTinyXml.Attribute(xmlnode, 'col1')), 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 2L, cIndex, CLR_BACK, CLR_YELLOW, MultiHundred(pyTinyXml.Attribute(xmlnode, 'col2')), 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 3L, cIndex, CLR_BACK, CLR_YELLOW, DivideHundred(pyTinyXml.Attribute(xmlnode, 'col3')), 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 4L, cIndex, CLR_BACK, CLR_YELLOW, MultiHundred(pyTinyXml.Attribute(xmlnode, 'col4')), 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 5L, cIndex, CLR_BACK, CLR_YELLOW, FormatDecimal(pyTinyXml.Attribute(xmlnode, 'col5')), 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 6L, cIndex, CLR_BACK, CLR_YELLOW, FormatDecimal(pyTinyXml.Attribute(xmlnode, 'col6')), 2L)
- pyContainer.Grid_SetItem(globDict[sWndID], 7L, cIndex, CLR_BACK, CLR_YELLOW, FormatDecimal(pyTinyXml.Attribute(xmlnode, 'col7')), 2L)
- cIndex += 1L
- xmlnode = pyTinyXml.NextSiblingElement(xmlnode)
- else:
- xmlnode
- pyContainer.Grid_SelectRows(globDict[sWndID], 1L)
- for row in range(0L, 8L):
- pyContainer.Grid_SetRowHeight(globDict[sWndID], row, GRID_ROW_HEIGHT)
- for col in range(1L, 7L):
- pyContainer.Grid_SetColumnWidth(globDict[sWndID], col, 100L)
- pyContainer.Grid_SetColumnWidth(globDict[sWndID], 0L, 180L)
- def AddGrid_Detail():
- globDict = globals()
- nMaxRow = len(globDict['g_dictGradeReport'])
- globDict['nWndIDGrid_Detail'] = pyContainer.Grid_AddWnd(0L, 0L, 0L, 0L, '')
- pyContainer.Grid_IsAppendFrame(globDict['nWndIDGrid_Detail'], 1L)
- pyContainer.Grid_Frame_SetStaticColor(globDict['nWndIDGrid_Detail'], CLR_BACK)
- pyContainer.Grid_SetGridBkColor(globDict['nWndIDGrid_Detail'], CLR_BACK)
- pyContainer.Grid_SetGridLines(globDict['nWndIDGrid_Detail'], 3L)
- pyContainer.Grid_SetGridLineColor(globDict['nWndIDGrid_Detail'], CLR_GRAY)
- pyContainer.Grid_SetRowCount(globDict['nWndIDGrid_Detail'], 2L + nMaxRow)
- pyContainer.Grid_SetColumnCount(globDict['nWndIDGrid_Detail'], 21L)
- pyContainer.Grid_SetFixedTextColor(globDict['nWndIDGrid_Detail'], CLR_GRAY)
- pyContainer.Grid_SetFixedRowCount(globDict['nWndIDGrid_Detail'], 2L)
- pyContainer.Grid_SetFixedColumnCount(globDict['nWndIDGrid_Detail'], 4L)
- pyContainer.Grid_SetListMode(globDict['nWndIDGrid_Detail'], 1L)
- pyContainer.Grid_SetColumnResize(globDict['nWndIDGrid_Detail'], 0L)
- pyContainer.Grid_SetHeaderSort(globDict['nWndIDGrid_Detail'], 1L)
- pyContainer.Grid_SetSingleRowSelection(globDict['nWndIDGrid_Detail'], 1L)
- pyContainer.Grid_SetFixedBkColor(globDict['nWndIDGrid_Detail'], CLR_BACK)
- pyContainer.Grid_SetArrowDisplayRow(globDict['nWndIDGrid_Detail'], 1L)
- pyContainer.Grid_SetTextBkColor(globDict['nWndIDGrid_Detail'], CLR_BACK)
- pyContainer.Grid_SetFixedRowFont(globDict['nWndIDGrid_Detail'], 100L, '宋体')
- pyContainer.Grid_SetNonFixedRowFont(globDict['nWndIDGrid_Detail'], 100L, '宋体')
- pyContainer.Grid_SetNonSortColWidth(globDict['nWndIDGrid_Detail'], 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 0L, CLR_BACK, CLR_GRAY, '序号', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 1L, CLR_BACK, CLR_GRAY, '发布时间', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 2L, CLR_BACK, CLR_GRAY, '机构', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 3L, CLR_BACK, CLR_GRAY, '分析师', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 4L, CLR_BACK, CLR_GRAY, '最新评级', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 5L, CLR_BACK, CLR_GRAY, '目标价', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 6L, CLR_BACK, CLR_GRAY, '前次评级', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 19L, CLR_BACK, CLR_GRAY, '原文', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 20L, CLR_BACK, CLR_GRAY, '报告摘要', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 0L, 4L, CLR_BACK, CLR_GRAY, '评级', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 0L, 7L, CLR_BACK, CLR_GRAY, '摊薄每股收益(元)', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 0L, 10L, CLR_BACK, CLR_GRAY, '市盈率', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 0L, 13L, CLR_BACK, CLR_GRAY, '营业总收入(百万元)', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 0L, 16L, CLR_BACK, CLR_GRAY, '归属母公司的净利润(百万元)', 1L)
- pyContainer.Grid_MergeFixedCells(globDict['nWndIDGrid_Detail'], 0L, 4L, 0L, 6L, 0L, 4L)
- for i in range(0L, 4L):
- pyContainer.Grid_MergeFixedCells(globDict['nWndIDGrid_Detail'], 0L, i, 1L, i, 1L, i)
- pyContainer.Grid_MergeFixedCells(globDict['nWndIDGrid_Detail'], 0L, 19L, 1L, 19L, 1L, 19L)
- pyContainer.Grid_MergeFixedCells(globDict['nWndIDGrid_Detail'], 0L, 20L, 1L, 20L, 1L, 20L)
- for i in range(0L, 4L):
- pyContainer.Grid_MergeFixedCells(globDict['nWndIDGrid_Detail'], 0L, i * 3L + 7L, 0L, i * 3L + 9L, 0L, i * 3L + 7L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, i * 3L + 7L, CLR_BACK, CLR_GRAY, '2010E', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, i * 3L + 8L, CLR_BACK, CLR_GRAY, '2011E', 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, i * 3L + 9L, CLR_BACK, CLR_GRAY, '2011E', 1L)
- dict = {}
- dict = globDict['g_dictGradeReport']
- for rindex in range(0L, nMaxRow):
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 0L, CLR_BACK, CLR_YELLOW, str(rindex + 1L), 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 1L, CLR_BACK, CLR_YELLOW, FormatReport(dict[rindex][0L]), 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 2L, CLR_BACK, CLR_YELLOW, dict[rindex][1L], 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 3L, CLR_BACK, CLR_YELLOW, dict[rindex][2L], 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 4L, CLR_BACK, CLR_YELLOW, FormatStr(dict[rindex][3L]), 1L)
- sValue = FormatDecimal(dict[rindex][4L])
- sValue += '/'
- sValue += FormatDecimal(dict[rindex][5L])
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 5L, CLR_BACK, CLR_YELLOW, sValue, 1L)
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 6L, CLR_BACK, CLR_YELLOW, FormatStr(dict[rindex][6L]), 1L)
- for cIndex in range(7L, 19L):
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, cIndex, CLR_BACK, CLR_YELLOW, FormatDecimal(dict[rindex][cIndex]), 1L)
- nlen = len(dict[rindex][19L])
- strtype = dict[rindex][19L][nlen - 3L:nlen]
- strtype2 = dict[rindex][19L][nlen - 4L:nlen]
- if strtype == 'doc' or strtype2 == 'docx':
- pyContainer.Grid_SetImage(globDict['nWndIDGrid_Detail'], rindex + 2L, 19L, 2L)
- else:
- pyContainer.Grid_SetImage(globDict['nWndIDGrid_Detail'], rindex + 2L, 19L, 1L)
- pyContainer.Grid_SetHideStr(globDict['nWndIDGrid_Detail'], rindex + 2L, 19L, dict[rindex][19L])
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 19L, CLR_BACK, CLR_YELLOW, '', 1L)
- pyContainer.Grid_SetImage(globDict['nWndIDGrid_Detail'], rindex + 2L, 20L, 0L)
- pyContainer.Grid_SetHideStr(globDict['nWndIDGrid_Detail'], rindex + 2L, 20L, dict[rindex][20L])
- pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 20L, CLR_BACK, CLR_YELLOW, '', 1L)
- for row in range(0L, 2L + nMaxRow):
- pyContainer.Grid_SetRowHeight(globDict['nWndIDGrid_Detail'], row, GRID_ROW_HEIGHT)
- if nMaxRow == 0L:
- pyContainer.Grid_SetRowCount(globDict['nWndIDGrid_Detail'], 3L)
- pyContainer.Grid_SetRowHeight(globDict['nWndIDGrid_Detail'], 2L, 0L)
- pyContainer.Grid_SetColumnWidth(globDict['nWndIDGrid_Detail'], 0L, 43L)
- for col in range(1L, 21L):
- pyContainer.Grid_SetColumnWidth(globDict['nWndIDGrid_Detail'], col, 80L)
- pyContainer.Grid_SetColumnWidth(globDict['nWndIDGrid_Detail'], 19L, 0L)
- for cIndex in range(7L, 19L):
- pyContainer.Grid_SetColumnType(globDict['nWndIDGrid_Detail'], cIndex, 1L)
- def InitContainer(datafile):
- #[NODE: 2151]
- xmlelement_0 = pyTinyXml.FirstChildElement(xmlelement)
- #[NODE: 2176]
- xmlelement_0
- sKey = pyTinyXml.Attribute(xmlelement_0, 'col0')
- T001 = pyTinyXml.Attribute(xmlelement_0, 'col1')
- globDict['g_dictDynGrade'][sKey] = [T001]
- xmlelement_0 = pyTinyXml.NextSiblingElement(xmlelement_0)
- #[NODE: 2248]
- xmlelement_0
- #[NODE: 2257]
- xmlelement
- #[NODE: 2258]
- FillChart_DynGrade()
- globDict['nWndIDTitle_Prifit'] = pyContainer.Title_AddWnd(0L, 0L, 0L, 0L, '')
- pyContainer.Title_SetBkColor(globDict['nWndIDTitle_Prifit'], CLR_BACK)
- pyContainer.Title_HideGoBack(globDict['nWndIDTitle_Prifit'], 1L)
- pyContainer.Title_SetFont(globDict['nWndIDTitle_Prifit'], 13L, '宋体', 1L)
- pyContainer.Title_SetTextColor(globDict['nWndIDTitle_Prifit'], CLR_QING, 1L)
- pyContainer.Title_SetTipText(globDict['nWndIDTitle_Prifit'], '盈利预测综合值(一致预期)')
- xmlProfit = 0L
- if xmlelement:
- xmlelement
- xmlelement = pyTinyXml.NextSiblingElement(xmlelement)
- if pyTinyXml.Attribute(xmlelement, 'id') == '1':
- xmlProfit = pyTinyXml.FirstChildElement(xmlelement)
- else:
- xmlelement
- AddGrid_Profit(xmlProfit, 'nWndIDGrid_Prifit')
- globDict['nWndIDTitle_Detail'] = pyContainer.Title_AddWnd(0L, 0L, 0L, 0L, '')
- pyContainer.Title_SetBkColor(globDict['nWndIDTitle_Detail'], CLR_BACK)
- pyContainer.Title_HideGoBack(globDict['nWndIDTitle_Detail'], 1L)
- pyContainer.Title_SetFont(globDict['nWndIDTitle_Detail'], 13L, '宋体', 1L)
- pyContainer.Title_SetTextColor(globDict['nWndIDTitle_Detail'], CLR_QING, 1L)
- pyContainer.Title_SetTipText(globDict['nWndIDTitle_Detail'], '机构评级与预测明细表')
- #[NODE: 2640]
- xmlelement
- xmlelement = pyTinyXml.NextSiblingElement(xmlelement)
- #[NODE: 2680]
- xmlelement_0 = pyTinyXml.FirstChildElement(xmlelement)
- rindex = 0L
- #[NODE: 2711]
- xmlelement_0
- T001 = pyTinyXml.Attribute(xmlelement_0, 'col0')
- T002 = pyTinyXml.Attribute(xmlelement_0, 'col1')
- T003 = pyTinyXml.Attribute(xmlelement_0, 'col2')
- T004 = pyTinyXml.Attribute(xmlelement_0, 'col3')
- T005 = pyTinyXml.Attribute(xmlelement_0, 'col4')
- T006 = pyTinyXml.Attribute(xmlelement_0, 'col5')
- T007 = pyTinyXml.Attribute(xmlelement_0, 'col6')
- T008 = pyTinyXml.Attribute(xmlelement_0, 'col7')
- T009 = pyTinyXml.Attribute(xmlelement_0, 'col8')
- T010 = pyTinyXml.Attribute(xmlelement_0, 'col9')
- T011 = pyTinyXml.Attribute(xmlelement_0, 'col10')
- T012 = pyTinyXml.Attribute(xmlelement_0, 'col11')
- T013 = pyTinyXml.Attribute(xmlelement_0, 'col12')
- T014 = DivideHundred(pyTinyXml.Attribute(xmlelement_0, 'col13'))
- T015 = DivideHundred(pyTinyXml.Attribute(xmlelement_0, 'col14'))
- T016 = DivideHundred(pyTinyXml.Attribute(xmlelement_0, 'col15'))
- T017 = DivideHundred(pyTinyXml.Attribute(xmlelement_0, 'col16'))
- T018 = DivideHundred(pyTinyXml.Attribute(xmlelement_0, 'col17'))
- T019 = DivideHundred(pyTinyXml.Attribute(xmlelement_0, 'col18'))
- T020 = pyTinyXml.Attribute(xmlelement_0, 'col19')
- T021 = pyTinyXml.Attribute(xmlelement_0, 'col20')
- globDict['g_dictGradeReport'][rindex] = [T001, T002, T003, T004, T005, T006, T007, T008, T009, T010, T011, T012, T013, T014, T015, T016, T017, T018, T019, T020, T021]
- rindex += 1L
- xmlelement_0 = pyTinyXml.NextSiblingElement(xmlelement_0)
- #[NODE: 3231]
- xmlelement_0
- #[NODE: 3240]
- xmlelement
- #[NODE: 3241]
- AddGrid_Detail()
- globDict['nWndIDEdit_Desc'] = pyContainer.Edit_AddWnd(0L, 0L, nEditWidth, 0L, '')
- pyContainer.Edit_SetBkColor(globDict['nWndIDEdit_Desc'], CLR_BACK)
- pyContainer.Edit_AddText(globDict['nWndIDEdit_Desc'], '使用说明:\r\n', CLR_RED, 10L, '宋体', 1L, 0L, 0L)
- pyContainer.Edit_AddText(globDict['nWndIDEdit_Desc'], '\t1、投资综合评级:我们将来自证券研究机构的投资评级进行1-5档标准化,给予最高5分最低1分的标准分值。买入=5、增持=4、中性=3、减持=2、卖出=1。投资评级综合值根据各机构投资评级得分简单平均获得,计算时段为近三个月。按照上速赋值计算,四舍五入确定综合评级:[1.0, 1.5) 卖出;[1.5, 2.5) 减持;[2.5, 3.5) 中性;[3.5, 4.5) 增持;[4.5, 5.0] 买入。r\n', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
- pyContainer.Edit_AddText(globDict['nWndIDEdit_Desc'], '\t2、盈利预测综合值:我们共收录包括营业总收入、归属母公司的净利润、摊薄每股收益、市盈率和PEG共5项盈利预测指标,相应的盈利预测综合值是根据各分析师预测值进行简单平均获得,计算时段为近三个月。\r\n', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
- pyContainer.Edit_AddText(globDict['nWndIDEdit_Desc'], '\t3、目标价(一致预期):目标价的计算是根据各个分析师预测数据的算数平均而来,计算时段为近三个月。\r\n', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
- pyContainer.Edit_AddText(globDict['nWndIDEdit_Desc'], '\t4、PEG:预测市盈率 / 未来1年归属母公司净利润增长率*100。\r\n', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
- pyContainer.Edit_SetLineSpacing(globDict['nWndIDEdit_Desc'], 9L)
- globDict['g_bFlag'] = 1L
- pyContainer.SetBottomInterval(0L)
- ReSize('', '', 0L)
- #[NODE: 0&93]
- globDict = globals()
- pyContainer.SetBkClr(CLR_BACK)
- globDict['g_nErrCode'] = 0L
- globDict['g_bFlag'] = 0L
- nPos = datafile.find('nojy.xml')
- nLen = len('nojy.xml')
- nPathLen = len(datafile)
- if nPos != -1L and nPathLen == nPos + nLen:
- globDict['g_nErrCode'] = 1L
- nPos = datafile.find('noright.xml')
- nLen = len('noright.xml')
- if nPos != -1L and nPathLen == nPos + nLen:
- globDict['g_nErrCode'] = 2L
- if globDict['g_nErrCode'] != 0L:
- globDict['nWndIDEdit_Error'] = pyContainer.Edit_AddWnd(0L, 0L, nEditWidth, 0L, '')
- pyContainer.Edit_SetBkColor(globDict['nWndIDEdit_Error'], CLR_BACK)
- pyContainer.Edit_SetLineSpacing(globDict['nWndIDEdit_Error'], 9L)
- if globDict['g_nErrCode'] == 1L:
- pyContainer.Edit_AddText(globDict['nWndIDEdit_Error'], '您尚未登陆交易', CLR_WHITE, 9L, '宋体', 0L, 0L, 0L)
- pyContainer.Edit_DoExtraAttribute(globDict['nWndIDEdit_Error'], 1L, 0L, 0L)
- else:
- if globDict['g_nErrCode'] == 2L:
- pyContainer.Edit_AddText(globDict['nWndIDEdit_Error'], '\t您目前尚不能使用该产品或服务。请到定制中心查看是否拥有该产品或服务的权限。有权限的情况:即可进行定制;没有权限的情况:如想享用本产品或服务,具体获取方式和途径请咨询客服热线(全国:4008888818 四川省内95584)。\r\n', CLR_WHITE, 9L, '宋体', 0L, 0L, 0L)
- pyContainer.SetBottomInterval(50L)
- ReSize('', '', 1L)
- pyTinyXml.LoadFile(datafile)
- pyContainer.SetBottomInterval(900L)
- ReSize('', '', 1L)
- xmlroot = pyTinyXml.RootElement()
- if xmlroot:
- xmlroot
- globDict['g_StockCode'] = pyTinyXml.Attribute(xmlroot, 'code')
- globDict['g_StockName'] = pyTinyXml.Attribute(xmlroot, 'name')
- T001 = pyTinyXml.Attribute(xmlroot, 'rate')
- T002 = pyTinyXml.Attribute(xmlroot, 'value')
- T003 = pyTinyXml.Attribute(xmlroot, 'price')
- T004 = pyTinyXml.Attribute(xmlroot, 'buy')
- T005 = pyTinyXml.Attribute(xmlroot, 'inc')
- T006 = pyTinyXml.Attribute(xmlroot, 'neutral')
- T007 = pyTinyXml.Attribute(xmlroot, 'reduce')
- T008 = pyTinyXml.Attribute(xmlroot, 'sell')
- T009 = pyTinyXml.Attribute(xmlroot, 'none')
- globDict['g_listCurGrade'] = [T001, T002, T003, T004, T005, T006, T007, T008, T009]
- else:
- xmlroot
- globDict['nWndIDTitle_Stock'] = pyContainer.Title_AddWnd(0L, 0L, 0L, 0L, '')
- pyContainer.Title_SetBkColor(globDict['nWndIDTitle_Stock'], CLR_BACK)
- pyContainer.Title_HideGoBack(globDict['nWndIDTitle_Stock'], 1L)
- pyContainer.Title_SetFont(globDict['nWndIDTitle_Stock'], 17L, '宋体', 1L)
- pyContainer.Title_SetTextColor(globDict['nWndIDTitle_Stock'], CLR_RED, 1L)
- pyContainer.Title_SetTipText(globDict['nWndIDTitle_Stock'], FormatStr(globDict['g_StockCode']) + '\t' + FormatStr(globDict['g_StockName']))
- globDict['nWndIDEdit_CollGrade'] = pyContainer.Edit_AddWnd(0L, 0L, 400L, 0L, '')
- pyContainer.Edit_SetBkColor(globDict['nWndIDEdit_CollGrade'], CLR_BACK)
- pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], '综合评级:', CLR_QING, 10L, '宋体', 1L, 0L, 0L)
- if len(globDict['g_listCurGrade']) == 0L:
- pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], '--', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
- else:
- list = []
- list = globDict['g_listCurGrade']
- if len(list) != 0L:
- T003 = list[3L]
- T004 = list[4L]
- T005 = list[5L]
- T006 = list[6L]
- T007 = list[7L]
- T008 = list[8L]
- nTotal = int(T003)
- nTotal += int(T004)
- nTotal += int(T005)
- nTotal += int(T006)
- nTotal += int(T007)
- nTotal += int(T008)
- del list
- if nTotal != 0L:
- pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], globDict['g_listCurGrade'][0L] + '[' + FormatDecimal(globDict['g_listCurGrade'][1L]) + ']', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
- else:
- pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], '--', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
- pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], ' 目标价(一致预期):', CLR_QING, 10L, '宋体', 1L, 0L, 0L)
- if len(globDict['g_listCurGrade']) != 0L:
- pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], FormatDecimal(globDict['g_listCurGrade'][2L]) + ' 元', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
- else:
- pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], '-- 元', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
- pyContainer.Edit_EnableWindow(globDict['nWndIDEdit_CollGrade'], 0L)
- globDict['nWndIDTitle_DynGrade'] = pyContainer.Title_AddWnd(0L, 0L, 0L, 0L, '')
- pyContainer.Title_SetBkColor(globDict['nWndIDTitle_DynGrade'], CLR_BACK)
- pyContainer.Title_HideGoBack(globDict['nWndIDTitle_DynGrade'], 1L)
- pyContainer.Title_SetFont(globDict['nWndIDTitle_DynGrade'], 13L, '宋体', 1L)
- pyContainer.Title_SetTextColor(globDict['nWndIDTitle_DynGrade'], CLR_QING, 1L)
- pyContainer.Title_SetTipText(globDict['nWndIDTitle_DynGrade'], '动态综合评级变化')
- globDict['nWndIDTitle_CurGrade'] = pyContainer.Title_AddWnd(0L, 0L, 0L, 0L, '')
- pyContainer.Title_SetBkColor(globDict['nWndIDTitle_CurGrade'], CLR_BACK)
- pyContainer.Title_HideGoBack(globDict['nWndIDTitle_CurGrade'], 1L)
- pyContainer.Title_SetFont(globDict['nWndIDTitle_CurGrade'], 13L, '宋体', 1L)
- pyContainer.Title_SetTextColor(globDict['nWndIDTitle_CurGrade'], CLR_QING, 1L)
- pyContainer.Title_SetTipText(globDict['nWndIDTitle_CurGrade'], '当前机构评级分布')
- globDict['nWndIDSwitch_CurGrade'] = pyContainer.Switch_AddWnd(0L, 0L, 0L, 0L, '')
- pyContainer.Switch_SetFontColorSchema(globDict['nWndIDSwitch_CurGrade'], CLR_BACK, CLR_GRAY, CLR_GRAY, CLR_BACK, CLR_GRAY, CLR_BACK, CLR_QING, CLR_BACK, CLR_GRAY, 13L, '宋体')
- pyContainer.Switch_InsertLabel(globDict['nWndIDSwitch_CurGrade'], 0L, '评级分布', '')
- pyContainer.Switch_SetStyle(globDict['nWndIDSwitch_CurGrade'], 3L)
- pyContainer.Switch_SetCurLabel(globDict['nWndIDSwitch_CurGrade'], 0L)
- AddChart('nWndIDChart_DynGrade')
- AddPie('nWndIDPie_CurGrade')
- AddGrid_CurGrade()
- FillGrid_CurGrade()
- FillPie_CurGrade()
- xmlelement = 0L
- if xmlroot:
- xmlroot
- xmlelement = pyTinyXml.FirstChildElement(xmlroot)
- else:
- xmlroot
- #[NODE: 2101&2126]
- xmlelement
[ 本帖最后由 股票初学12 于 2011-10-12 21:27 编辑 ]