Смекни!
smekni.com

Создание базы данных (стр. 9 из 13)

1815 OldX = x

1816 OldY = y

1817

1818 str_$ = CStr(DiagData(i - 1). Text)

1819 Chart. CurrentX = j * dWidth + (dWidth - Chart. TextWidth(str_)) \ 2

1820 Chart. CurrentY = ChartDown + Chart. TextHeight(str_) \ 10

1821 Chart. Print str_

1822

1823 str_ = CStr(Round(DiagData(i - 1). Val / Sum * 100)) + "%"

1824 Chart. CurrentX = j * dWidth + (dWidth - Chart. TextWidth(str_)) \ 2

1825 Chart. CurrentY = y - Chart. TextHeight(str_) * 1.2

1826 Chart. Print str_

1827

1828 ' значение слева с засечкой и линией

1829 str_ = CStr(DiagData(i - 1). Val)

1830 If UseLineLeftValues Then

1831 Chart. CurrentX = dWidth * 0.8 - Chart. TextWidth(str_)

1832 Chart. DrawStyle = 2

1833 Chart. Line (dWidth * 0.9, y) - (x, y), LineColor

1834 Chart. DrawStyle = 0

1835 End If

1836

1837 Chart. DrawWidth = 2

1838 Chart. Line (dWidth * 0.85, y) - (dWidth * 0.95, y), LineColor

1839 Chart. DrawWidth = 1

1840 x# = dWidth * 0.8 - Chart. TextWidth(str_)

1841 Chart. CurrentX = x

1842 Chart. CurrentY = y - Chart. TextHeight(str_) \ 2

1843 Chart. Print str_

1844

1845 Case 1 ' // // // // // // // // // // // // // // // // / КОЛОНКИ // // // // // // // // // // // // // // // // // // // /

1846 If (Not Use3D) Then

1847 Chart. Line (j * dWidth, y) - ((j + 1) * dWidth, ChartDown), DiagData(i - 1). Color, BF

1848 Chart. Line (j * dWidth, y) - ((j + 1) * dWidth, ChartDown), LineColor, B

1849

1850 str_ = CStr(DiagData(i - 1). Text)

1851 Chart. CurrentX = j * dWidth + (dWidth - Chart. TextWidth(str_)) \ 2

1852 Chart. CurrentY = ChartDown + Chart. TextHeight(str_) \ 10

1853 Chart. Print str_

1854

1855 str_ = CStr(Round(DiagData(i - 1). Val / Sum * 100)) + "%"

1856 Chart. CurrentX = j * dWidth + (dWidth - Chart. TextWidth(str_)) \ 2

1857 Chart. CurrentY = y - Chart. TextHeight(str_) * 1.2

1858 Chart. Print str_

1859

1860 ' значение слева с засечкой и линией

1861 str_ = CStr(DiagData(i - 1). Val)

1862 If UseLineLeftValues Then

1863 Chart. CurrentX = dWidth * 0.8 - Chart. TextWidth(str_)

1864 Chart. DrawStyle = 2

1865 Chart. Line (dWidth * 0.9, y) - (j * dWidth, y), LineColor

1866 Chart. DrawStyle = 0

1867 End If

1868

1869 x# = dWidth * 0.8 - Chart. TextWidth(str_)

1870 Chart. CurrentX = x

1871 Chart. CurrentY = y - Chart. TextHeight(str_) \ 2

1872 Chart. Print str_

1873 Chart. CurrentX = x

1874 Chart. CurrentY = y

1875 Chart. DrawWidth = 2

1876 Chart. Line (dWidth * 0.85, y) - (dWidth * 0.95, y), LineColor

1877 Chart. DrawWidth = 1

1878 Else

1879 For k% = 0 To d3D - 1

1880 Chart. Line (j * dWidth + k * d3DX, y - k * d3DY) - ((j + 1) * dWidth + k * d3DX, ChartDown - k * d3DY), DiagData(i - 1). Color, B

1881 Next k

1882 Chart. Line (j * dWidth, y) - ((j + 1) * dWidth, ChartDown), DiagData(i - 1). Color, BF

1883 ' верхняя левая в глубине

1884 ltdx% = j * dWidth + (d3D - 1) * d3DX

1885 ltdy% = y - (d3D - 1) * d3DY

1886 ' верхняя правая в глубине

1887 rtdx% = (j + 1) * dWidth + (d3D - 1) * d3DX

1888 rtdy% = y - (d3D - 1) * d3DY

1889 ' нижняя правая в глубине

1890 rddx% = (j + 1) * dWidth + (d3D - 1) * d3DX

1891 rddy% = ChartDown - (d3D - 1) * d3DY

1892 ' верхняя в глубине

1893 Chart. Line (rtdx, rtdy) - (rddx, rddy), LineColor

1894 ' правая в глубине

1895 Chart. Line (ltdx, ltdy) - (rtdx, rtdy), LineColor

1896

1897 ' леваяпереходная

1898 Chart. Line (ltdx, ltdy) - (ltdx - d3D * d3DX, ltdy + d3D * d3DY), LineColor

1899 ' правая верхняя переходная

1900 Chart. Line (rtdx, rtdy) - (rtdx - d3D * d3DX, rtdy + d3D * d3DY), LineColor

1901 ' правая нижняя переходная

1902 Chart. Line (rddx, rddy) - (rddx - d3D * d3DX, rddy + d3D * d3DY), LineColor

1903 Chart. Line (j * dWidth, y) - ((j + 1) * dWidth, ChartDown), LineColor, B

1904

1905 ' надписьвнизу

1906 str_ = CStr(DiagData(i - 1). Text)

1907 Chart. CurrentX = j * dWidth + (dWidth - Chart. TextWidth(str_)) \ 2

1908 Chart. CurrentY = ChartDown + Chart. TextHeight(str_) \ 10

1909 Chart. Print str_

1910 ' процентвверху

1911 str_ = CStr(Round(DiagData(i - 1). Val / Sum * 100)) + "%"

1912 Chart. CurrentX = d3D * d3DX + j * dWidth + (dWidth - Chart. TextWidth(str_)) \ 2

1913 Chart. CurrentY = y - d3D * d3DY - Chart. TextHeight(str_) * 1.2

1914 Chart. Print str_

1915 ' значение слева с засечкой и линией

1916 str_ = CStr(DiagData(i - 1). Val)

1917 If UseLineLeftValues Then

1918 Chart. CurrentX = dWidth * 0.8 - Chart. TextWidth(str_)

1919 Chart. DrawStyle = 2

1920 Chart. Line (dWidth * 0.9, y) - (j * dWidth, y), LineColor

1921 Chart. DrawStyle = 0

1922 End If

1923

1924 x# = dWidth * 0.8 - Chart. TextWidth(str_)

1925 Chart. CurrentX = x

1926 Chart. CurrentY = y - Chart. TextHeight(str_) \ 2

1927 Chart. Print str_

1928 Chart. CurrentX = x

1929 Chart. CurrentY = y

1930 Chart. DrawWidth = 2

1931 Chart. Line (dWidth * 0.85, y) - (dWidth * 0.95, y), LineColor

1932 Chart. DrawWidth = 1

1933 End If

1934

1935 Case 2 ' // // // // // // // // // // // // // // // // / ТОЧКИ // // // // // // // // // // // // // // // // // // // // /

1936 Chart. FillStyle = 0

1937 Chart. FillColor = DiagData(i - 1). Color

1938 x# = (j + 0.5) * dWidth

1939 Chart. Circle (x, y), PointRadius * d3DX, LineColor

1940 Chart. FillStyle = 1

1941 Chart. DrawStyle = 1

1942 Chart. Line (x, y) - (x, ChartDown), DiagData(i - 1). Color

1943 Chart. DrawStyle = 0

1944

1945 str_ = CStr(DiagData(i - 1). Text)

1946 Chart. CurrentX = j * dWidth + (dWidth - Chart. TextWidth(str_)) \ 2

1947 Chart. CurrentY = ChartDown + Chart. TextHeight(str_) \ 10

1948 Chart. Print str_

1949

1950 str_ = CStr(Round(DiagData(i - 1). Val / Sum * 100)) + "%"

1951 Chart. CurrentX = j * dWidth + (dWidth - Chart. TextWidth(str_)) \ 2

1952 Chart. CurrentY = y - PointRadius * d3D - Chart. TextHeight(str_) * 1.2

1953 Chart. Print str_

1954

1955 ' значение слева с засечкой и линией

1956 str_ = CStr(DiagData(i - 1). Val)

1957 Chart. CurrentX = dWidth * 0.8 - Chart. TextWidth(str_)

1958 Chart. DrawStyle = 2

1959 Chart. Line (dWidth * 0.9, y) - (x, y), LineColor

1960 Chart. DrawStyle = 0

1961

1962 Chart. DrawWidth = 2

1963 Chart. Line (dWidth * 0.85, y) - (dWidth * 0.95, y), LineColor

1964 Chart. DrawWidth = 1

1965 x# = dWidth * 0.8 - Chart. TextWidth(str_)

1966 Chart. CurrentX = x

1967 Chart. CurrentY = y - Chart. TextHeight(str_) \ 2

1968 Chart. Print str_

1969 End Select

1970 Next i

1971

1972 End With

1973End Sub

1974

1975Sub DrawDiagram()

1976 If (Chart. Height > Screen. TwipsPerPixelX * 5) And (UseColorFill) Then

1977 Call ColorFill(Chart, StartFillColor, EndFillColor)

1978 Else

1979 Chart. Line (0, 0) - (Chart. Width, Chart. Height), StartFillColor, BF

1980 End If

1981

1982 Select Case DrawingMode

1983 Case 3: Call DrawCircle

1984 Case Else: Call DrawPoint

1985 End Select

1986End Sub

1987

1988Private Sub Chart_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)

1989 If (DrawingMode <> 3) Then

1990 y = Round((ChartDown - y) * Max / (ChartDown - ChartTop))

1991 Label3. Caption = CStr(y)

1992 End If

1993End Sub

1994

1995Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

1996 If (KeyCode = vbKeyF5) Then Call DrawDiagram

1997End Sub

1998

1999Private Sub Form_Load()

2000 dW = Width - Chart. Width

2001 dH = Height - Chart. Height

2002 dX = Width - VScroll. Left

2003 dH2 = Height - VScroll. Height

2004 DrawingMode = 0

2005 Use3D = False

2006 LineCount = 100

2007 d3D = 15

2008 StartFillColor = RGB(255, 255, 128)

2009 EndFillColor = RGB(0, 128, 255)

2010 LineColor = 0

2011 LineWidth = 1

2012 Ellipce = 2 / 5

2013 PointRadius = 15

2014

2015 UseColorFill = True

2016 UseCircleLegend = True

2017 UseLineLeftValues = True

2018

2019 ChartHeight = Chart. Height * 0.85

2020 ChartWidth = Chart. Width * 0.85

2021 ChartTop = Chart. Height * 0.075

2022 ChartDown = Chart. Height * 0.925

2023 If (ChartWidth < ChartHeight) Then Radius = ChartWidth Else Radius = ChartHeight

2024 Radius = Radius * 0.5

2025 InRad = 0.1 * Radius

2026End Sub

2027

2028Private Sub Form_Resize()

2029 Min% = Width - dW + 5 * Screen. TwipsPerPixelX

2030 If (Min < 0) Then Min = 0

2031 Chart. Width = Min

2032

2033 Min% = Height - dH + Screen. TwipsPerPixelY

2034 If (Min < 0) Then Min = 0

2035 Chart. Height = Min

2036

2037 VScroll. Left = Width - dX

2038

2039 Min% = Height - dH2 + Screen. TwipsPerPixelY

2040 If (Min < 0) Then Min = 0

2041 VScroll. Height = Min

2042

2043 Call DrawDiagram

2044End Sub

2045

2046Private Sub Image1_Click()

2047 CD. FileName = ""

2048 CD. ShowSave

2049 If (CD. FileName <> "") Then

2050 Call SavePicture(Chart. Image, CD. FileName)

2051 End If

2052End Sub

2053

2054Private Sub Image2_Click()

2055 With DiagOptForm

2056 ' цвета

2057. Frame2(0). BackColor = StartFillColor

2058. Frame2(1). BackColor = EndFillColor

2059. Frame2(2). BackColor = Chart. ForeColor

2060. Frame2(3). BackColor = LineColor

2061 ' размеры

2062. UpDown1. value = LineWidth

2063. UpDown2. value = d3D

2064. UpDown3. value = PointRadius

2065. UpDown4. value = LineCount

2066. UpDown5. value = Round(Ellipce * 100)

2067

2068. UpDown6. Max = Chart. Width

2069 If (Chart. Height < Chart. Width) Then. UpDown6. Max = Chart. Width

2070. UpDown6. Max = Round(. UpDown6. Max / Screen. TwipsPerPixelX)

2071. UpDown6. value = Round(Radius / Screen. TwipsPerPixelX)

2072

2073. UpDown7. Max =. UpDown6. Max * 0.9

2074. UpDown7. value = Round(InRad / Screen. TwipsPerPixelX)

2075

2076 ' цвета и надписи

2077. List1. Clear

2078 For i% = 1 To ItemCount

2079. List1. AddItem (DiagData(i - 1). Text)

2080. List1. ItemData(i - 1) = DiagData(i - 1). Color

2081 Next i

2082 If (. List1. ListCount > 0) Then. List1. ListIndex = 0

2083

2084 ' флаги

2085. Check1. value = - CInt(UseColorFill)

2086. Check3. value = - CInt(UseCircleLegend)

2087. Check2. value = - CInt(UseLineLeftValues)

2088

2089. Show vbModal

2090 If (. res = 1) Then

2091 ' цвета

2092 StartFillColor =. Frame2(0). BackColor

2093 EndFillColor =. Frame2(1). BackColor

2094 Chart. ForeColor =. Frame2(2). BackColor

2095 LineColor =. Frame2(3). BackColor

2096 ' размеры

2097 LineWidth =. UpDown1. value

2098 d3D =. UpDown2. value

2099 PointRadius =. UpDown3. value

2100 LineCount =. UpDown4. value

2101 Ellipce =. UpDown5. value / 100

2102 Radius =. UpDown6. value * Screen. TwipsPerPixelX

2103 InRad =. UpDown7. value * Screen. TwipsPerPixelX

2104 ' цветаинадписи

2105 For i% = 1 To ItemCount

2106 DiagData(i - 1). Text =. List1. List(i - 1)

2107 DiagData(i - 1). Color =. List1. ItemData(i - 1)

2108 Next i

2109 ' флаги

2110 UseColorFill = (. Check1. value = 1)

2111 UseCircleLegend = (. Check3. value = 1)

2112 UseLineLeftValues = (. Check2. value = 1)

2113 Call DrawDiagram

2114 End If

2115 End With

2116End Sub

2117

2118Private Sub Image3_Click()

2119 Hide

2120End Sub

2121

2122Private Sub VScroll_Change()

2123 Ellipce = VScroll. value / 100

2124 Call DrawDiagram

2125End Sub

Форма: InputForm. frm

2126Dim res%

2127

2128Private Sub CancelBut_Click()

2129 Call SoundClick

2130 Hide

2131End Sub

2132

2133Private Sub Form_Activate()

2134 Text1. SetFocus

2135End Sub

2136

2137Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

2138 Select Case KeyCode

2139 Case 13: Call YesBut_Click

2140 Case 27: Call CancelBut_Click

2141 End Select

2142End Sub

2143

2144Private Sub Form_Load()

2145 Call ButEnabled(YesImg, YesBut, True)

2146 Call ButEnabled(CancelImg, CancelBut, True)

2147End Sub

2148

2149Public Function InputVal(str$) As String

2150 Label1. Caption = str

2151 Text1. Text = ""

2152 res = 0

2153 Me. Show vbModal

2154 If (res = 1) Then InputVal = Text1. Text

2155 Unload Me

2156End Function

2157

2158Private Sub YesBut_Click()

2159 Call SoundClick

2160 res = 1

2161 Hide

2162End Sub

Форма: DiagOpt. frm

2163Public res%

2164

2165Private Sub Form_Load()

2166 res = 0

2167 Call ButEnabled(SelectImg, SelectBut, True)

2168 Call ButEnabled(CancelImg, CancelBut, True)

2169End Sub

2170

2171Private Sub Form_Paint()

2172 Call DiagResForm. ColorFill(Picture1, Frame2(0). BackColor, Frame2(1). BackColor)

2173End Sub

2174

2175Private Sub Frame2_Click(Index As Integer)

2176 ColorDlg. Color = Frame2(Index). BackColor

2177 ColorDlg. ShowColor

2178 Frame2(Index). BackColor = ColorDlg. Color

2179 If (Index < 2) Then Call DiagResForm. ColorFill(Picture1, Frame2(0). BackColor, Frame2(1). BackColor)

2180 If (Index = 4) Then List1. ItemData(List1. ListIndex) = Frame2(4). BackColor

2181End Sub

2182

2183Private Sub Label10_Click()

2184 res = 1

2185 Hide

2186End Sub

2187

2188Private Sub Label15_Click()

2189 Hide

2190End Sub

2191

2192Private Sub List1_Click()

2193 If (List1. ListIndex > - 1) Then

2194 Text1. Text = List1. List(List1. ListIndex)

2195 Frame2(4). BackColor = List1. ItemData(List1. ListIndex)

2196 End If

2197End Sub

2198

2199Private Sub List1_KeyPress(KeyAscii As Integer)

2200 Call List1_Click

2201End Sub

2202

2203Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)

2204 If (KeyCode = 13) Then

2205 List1. List(List1. ListIndex) = Text1. Text

2206 List1. ItemData(List1. ListIndex) = Frame2(4). BackColor

2207 End If

2208End Sub

Форма: SplashScreenForm. frm

2209Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

2210 If (KeyCode = 27) Or (KeyCode = 13) Then

2211 MainForm. Show

2212 Unload Me

2213 End If

2214End Sub

2215

2216Private Sub Form_Load()

2217 Label2. Caption = "v. " + CStr(App. Major) + ". " + CStr(App. Minor)

2218End Sub

2219

2220Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

2221 Call MDown(x, y)

2222End Sub

2223

2224Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)

2225 Call MMove(hwnd, x, y)

2226End Sub

2227

2228Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)

2229 Call MUp

2230End Sub

Форма: MonthForm. frm

2231Public res%

2232

2233Private Sub CancelBut_Click()

2234 Hide

2235End Sub

2236

2237Private Sub EditBut_Click()

2238 res = - 1

2239 Hide

2240End Sub

2241

2242Private Sub Form_Load()

2243 Call ButEnabled(YesImg, YesBut, True)

2244 Call ButEnabled(EditImg, EditBut, True)

2245 Call ButEnabled(CancelImg, CancelBut, True)

2246 res = 0

2247End Sub

2248

2249Private Sub YesBut_Click()

2250 res = 1

2251 Hide

2252End Sub

Модуль: DBTypes. bas

2253'************************************

2254' модуль DBTypes. bas

2255' всяработасфайломБД

2256'************************************

2257

2258'************************************** Описание типов **************************************