14.05.2008, 17:33 | #19 |
Участник
|
X++: public class FormRun extends ObjectRun { #define.numOfShapes(7) #define.index1(1) #define.index2(2) #define.index3(3) #define.index4(4) #define.index5(5) #define.index6(6) #define.index7(7) //Scale Macroses #define.hourLengthInPixels(50) #define.scalePos(3) #define.scaleWidth(5) #define.hourBreakWidth(3) #define.hourBreakHeight(10) #define.scalePosY(10) #define.rightScaleBorder(10) #define.leftScaleBorder(10) // int shapecolors[#numOfShapes]; int white; WinGdi gdi; boolean redraw; } X++: void drawScale() { int i; int _shapeBrush; int _scaleColor = shapeColors[#index7], _breakColor = shapeColors[#index7]; WinGDI _gdi; ; GPane.width(12*#hourLengthInPixels+2*#scalePos+#rightScaleBorder); this.clearPane(); GPane.lockDC(); _gdi = new WinGDI(GPane.hDC()); _shapeBrush = _gdi.createSolidBrush(_scaleColor); _gdi.fillRect(0,#scalePosY,Gpane.widthValue()-#scalePos-#rightScaleBorder,#scaleWidth+#scalePosY,_shapeBrush); _shapeBrush = _gdi.createSolidBrush(_breakColor); for(i=1;i<=13;i++) { this.drawHourBreakLine(_shapeBrush,i); } for(i=1;i<=12;i++) { this.drawHalfHourBreakLine(_shapeBrush,i); } } X++: protected void drawHourBreakLine(int _brush,int hourNumber) { WinGDI _gdi; int left_x; ; left_x=(hourNumber-1)*#hourLengthInPixels; _gdi = new WinGDI(GPane.hDC()); _gdi.fillRect(left_x,#scaleWidth+#ScalePosY,left_x+#hourBreakWidth, #scaleWidth+#ScalePosY+#hourBreakHeight,_brush); _gdi.textOut(left_x,0,int2str(hourNumber)); } X++: void clearPane() { WinGdi _gdi; int _brush; ; GPane.lockDC(); _gdi = new WinGDI(GPane.hDC()); _brush = _gdi.createSolidBrush(white); _gdi.fillRect(0,0,GPane.widthValue(),GPane.heightValue(),_brush); _gdi.deleteObject(_brush); } X++: void init() { super(); white = WinAPI::RGB2int(0xff,0xff,0xff); shapeColors[#index1] = WinAPI::RGB2int(0x40,0x00,0x0bf); shapeColors[#index2] = WinAPI::RGB2int(0x00,0x7f,0x00); shapeColors[#index3] = WinAPI::RGB2int(0x7f,0x00,0x7f); shapeColors[#index4] = WinAPI::RGB2int(0x7f,0x00,0x00); shapeColors[#index5] = WinAPI::RGB2int(0x00,0x7f,0x7f); shapeColors[#index6] = WinAPI::RGB2int(0x7f,0x7f,0x00); shapeColors[#index7] = WinAPI::RGB2int(0x00,0x00,0x7f); //dobavit 8oj } X++: public int paint() { int ret; ret = super(); element.drawLiftOnScale(3,5); return ret; }
__________________
Axapta has seduced me deadly! |
|