Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  | Правила  

Компьютерный форум OSzone.net » Программирование, базы данных и автоматизация действий » AutoIt » [решено] Не видна вкладка на форме с Tab

Ответить
Настройки темы
[решено] Не видна вкладка на форме с Tab

Ветеран


Сообщения: 903
Благодарности: 161


Конфигурация

Профиль | Отправить PM | Цитировать


Изменения
Автор: saavaage
Дата: 09-08-2010
Есть код:

читать дальше »
Код: Выделить весь код
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <GIFAnimation.au3>

$Form1 = GUICreate("Диагностика и Настройка", 619, 442, 189, 122)
$Tab1 = GUICtrlCreateTab(8, 16, 601, 377)
$Network = GUICtrlCreateTabItem("Network")
$Group11 = GUICtrlCreateGroup("Статистика", 16, 48, 385, 233)
$Label26 = GUICtrlCreateLabel("Connected via DIAL-UP:", 24, 70, 121, 17)
$Edit33 = GUICtrlCreateEdit("", 36, 99, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label27 = GUICtrlCreateLabel("Connected via   LAN:", 153, 70, 106, 17)
$Edit34 = GUICtrlCreateEdit("", 164, 99, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label28 = GUICtrlCreateLabel("Connected via   PROXY:", 270, 70, 122, 17)
$Edit35 = GUICtrlCreateEdit("", 290, 99, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label29 = GUICtrlCreateLabel("Modem busy:", 24, 126, 67, 17)
$Edit36 = GUICtrlCreateEdit("", 34, 155, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label30 = GUICtrlCreateLabel("Connection RAS installed:", 132, 126, 127, 17)
$Edit37 = GUICtrlCreateEdit("", 164, 155, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label31 = GUICtrlCreateLabel("Connection is offline:", 270, 126, 102, 17)
$Edit38 = GUICtrlCreateEdit("", 288, 155, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Edit39 = GUICtrlCreateEdit("", 24, 200, 369, 73, $ES_WANTRETURN)
GUICtrlSetData(-1, "Edit39")
$Label32 = GUICtrlCreateLabel("Connection description:", 23, 180, 115, 17)
;GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group12 = GUICtrlCreateGroup("Текущая скорость адаптеров", 16, 288, 585, 97)
$Combo1 = GUICtrlCreateCombo("Combo1", 88, 307, 505, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Label34 = GUICtrlCreateLabel("Адаптер:", 32, 309, 49, 17)
$Group16 = GUICtrlCreateGroup("Трансфер (Bytes + MB):", 24, 333, 569, 44)
$Label35 = GUICtrlCreateLabel("Отдача:", 34, 353, 43, 17)
$Edit41 = GUICtrlCreateEdit("", 87, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Edit42 = GUICtrlCreateEdit("", 184, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label36 = GUICtrlCreateLabel("Отдача:", 346, 353, 43, 17)
$Edit43 = GUICtrlCreateEdit("", 399, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Edit44 = GUICtrlCreateEdit("", 496, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
;GUICtrlCreateGroup("", -99, -99, 1, 1)
;GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group13 = GUICtrlCreateGroup("Скорость работы провайдера", 408, 48, 193, 233)
$Button15 = GUICtrlCreateButton("Старт", 428, 120, 153, 23)
$Label33 = GUICtrlCreateLabel("Проверка скорости:", 429, 92, 150, 17)
Local $sResume, $pGIF, _
        $sFileGIF = @WindowsDir & "\pchealth\helpctr\System\images\progbar.gif", _
        $Group13, $Label33, $hGIF, $Button15, $nMsg, $hMenu
GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button15
            $hGIF = _GUICtrlCreateGIF($sFileGIF, "", 429, 160, $pGIF)
            GUICtrlSetState($Button15, $GUI_DISABLE)
            GUICtrlSetData($Label33, "Подождите, идет проверка.")
            Call("_SpeedInternet")
            _GIF_DeleteGIF($pGIF)
            GUICtrlSetData($Label33, $sResume)
            GUICtrlSetState($Button15, $GUI_ENABLE)
    EndSwitch
WEnd

Func _SpeedInternet()
    $sResume = 'Произошла ошибка.'
    Local $sPattern = '(?s).*?= (.*?)\r\n?.*', $sText
    Local $oIE = _IECreate("http://www.spbtlg.ru/stb.php", 0, 0)
    If Not IsObj($oIE) Then Return $sResume
    $sText = _IEBodyReadText($oIE)
    _IEQuit($oIE)
    If $sText Then
        $sText = StringRegExpReplace($sText, $sPattern, "\1")
        If Number($sText) Then $sResume = "Ваша скорость: " & $sText & ' Kbps'
    EndIf
    Return $sResume
EndFunc   ;==>_SpeedInternet
;GUICtrlCreateGroup("", -99, -99, 1, 1)
$TotalInfo = GUICtrlCreateTabItem("TotalInfo")
GUICtrlSetState(-1,$GUI_SHOW)
$Group1 = GUICtrlCreateGroup("Ошибки в работе системы", 24, 48, 281, 153)
$Label1 = GUICtrlCreateLabel("Журналы Событий", 40, 72, 99, 17)
$Edit3 = GUICtrlCreateEdit("", 212, 72, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label2 = GUICtrlCreateLabel("Ошибки обновлений", 40, 105, 107, 17)
$Edit4 = GUICtrlCreateEdit("", 212, 105, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label3 = GUICtrlCreateLabel("Проблемное оборудование", 40, 138, 142, 17)
$Edit5 = GUICtrlCreateEdit("", 212, 138, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label4 = GUICtrlCreateLabel("Наличие доступа в сеть", 40, 171, 125, 17)
$Edit6 = GUICtrlCreateEdit("", 212, 171, 81, 17)
GUICtrlSetData(-1, "Edit3")
;GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Информация о ПК", 321, 48, 273, 329)
$Group4 = GUICtrlCreateGroup("Разделы", 329, 246, 257, 120)
$ListView1 = GUICtrlCreateListView("Drive|TotalSpace(MB)|FreeSpace(MB)", 337, 262, 240, 95)
$DrivesArr = DriveGetDrive("Fixed") 
If IsArray($DrivesArr) Then 
    For $i = 1 To $DrivesArr[0] 
        $FreeSpace = DriveSpaceFree($DrivesArr[$i]) 
	 	$TotalSpace = DriveSpaceTotal($DrivesArr[$i])
        GUICtrlCreateListViewItem(StringUpper($DrivesArr[$i]) & "\|" & Round($TotalSpace, 1) & "|" & Round($FreeSpace, 1), $ListView1) 
    Next 
EndIf 
;GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group5 = GUICtrlCreateGroup("СисИнфо", 329, 64, 257, 177)
$Label9 = GUICtrlCreateLabel("Пользователь", 339, 90, 77, 17)
$Edit12 = GUICtrlCreateEdit("", 425, 90, 153, 17)
GUICtrlSetData(-1, "Edit3")
$Label10 = GUICtrlCreateLabel("Ось / разрядн.", 339, 149, 80, 17)
$Edit13 = GUICtrlCreateEdit("", 425, 149, 105, 17)
GUICtrlSetData(-1, "Edit3")
$Label11 = GUICtrlCreateLabel("CPU / Cores", 339, 178, 64, 17)
$Label12 = GUICtrlCreateLabel("Админ. права", 339, 119, 73, 17)
$Edit15 = GUICtrlCreateEdit("", 425, 119, 153, 17)
GUICtrlSetData(-1, "Edit3")
$Edit16 = GUICtrlCreateEdit("", 537, 149, 41, 17)
GUICtrlSetData(-1, "Edit3")
$Edit14 = GUICtrlCreateEdit("", 425, 178, 105, 17)
GUICtrlSetData(-1, "Edit3")
$Edit17 = GUICtrlCreateEdit("", 537, 178, 41, 17)
GUICtrlSetData(-1, "Edit3")
$Label13 = GUICtrlCreateLabel("RAM, MB", 339, 207, 50, 17)
$Edit18 = GUICtrlCreateEdit("", 425, 207, 153, 17)
GUICtrlSetData(-1, "Edit3")
;GUICtrlCreateGroup("", -99, -99, 1, 1)
;GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Доп. инфо", 23, 212, 281, 121)
$Label5 = GUICtrlCreateLabel("Переменные среды", 35, 229, 105, 17)
$Edit7 = GUICtrlCreateEdit("", 159, 229, 137, 17)
GUICtrlSetData(-1, "Edit3")
$Label6 = GUICtrlCreateLabel("Папка Temp", 35, 254, 66, 17)
$Edit8 = GUICtrlCreateEdit("", 159, 254, 137, 17)
GUICtrlSetData(-1, "Edit3")
$Label7 = GUICtrlCreateLabel("Файл подкачки", 35, 280, 83, 17)
$Edit9 = GUICtrlCreateEdit("", 159, 280, 137, 17)
GUICtrlSetData(-1, "Edit3")
$Label8 = GUICtrlCreateLabel("Мои документы", 35, 305, 84, 17)
$Edit10 = GUICtrlCreateEdit("", 159, 305, 137, 17)
GUICtrlSetData(-1, "Edit3")
;GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button7 = GUICtrlCreateButton("Разделы", 23, 344, 57, 33)
$Button8 = GUICtrlCreateButton("Службы", 98, 344, 57, 33)
$Button9 = GUICtrlCreateButton("Папки", 172, 344, 57, 33)
$Button10 = GUICtrlCreateButton("Автозагр", 247, 344, 57, 33)
GUICtrlCreateTabItem("")
GUICtrlSetState(-1,$GUI_SHOW)
$Button1 = GUICtrlCreateButton("Сохранить", 500, 400, 105, 33)
$Button2 = GUICtrlCreateButton("Печатать", 370, 400, 105, 33)
$Button3 = GUICtrlCreateButton("Настройка", 500, 7, 105, 25)
$Button17 = GUICtrlCreateButton("Обновить", 239, 400, 105, 33)
GUISetState()

    While 1
        $msg = GUIGetMsg()
        
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd


При просмотре полученной формы, почему-то не видна следующая за Network вкладка TotalInfo, а также общие для всей формы кнопки ($Button1, $Button2, $Button3, $Button17.

Отправлено: 20:06, 09-08-2010

 

Аватара для Creat0R

Must AutoIt


Сообщения: 3054
Благодарности: 1009

Профиль | Сайт | Отправить PM | Цитировать


Цитата saavaage:
Есть код: »
Нерабочий.

-------
“Сделай так просто, как возможно, но не проще этого.”... “Ты никогда не решишь проблему, если будешь думать так же, как те, кто её создал.”

Альберт Эйнштейн

P.S «Не оказываю техподдержку через ПМ/ICQ, и по email - для этого есть форум. ©»

http://creator-lab.ucoz.ru/Images/Icons/autoit_icon.png Русское сообщество AutoIt | http://creator-lab.ucoz.ru/Images/Ic...eator_icon.png CreatoR's Lab | http://creator-lab.ucoz.ru/Images/Icons/oac_icon.png Opera AC Community


Отправлено: 00:32, 10-08-2010 | #2



Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети.

Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля.


Ветеран


Сообщения: 903
Благодарности: 161

Профиль | Отправить PM | Цитировать


Creat0R, почему нерабочий? У меня открывается вкладка Network и при нажатии на кнопку "Старт", отрабатывает проверка "Скорость работы провайдера". Проблема в том, что не видна вкладка с TotalInfo...
Да и еще там необходима библиотека GIFAnimation.au3, на нее ссылка в посте
http://forum.oszone.net/post-1470156-5.html

Переместил TotalInfo вверх (поставил перед Network) стали видны все 2 вкладки. Видно что-то накосячил именно с Network...

Вот то, о чем я сказал:

читать дальше »
Код: Выделить весь код
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <GIFAnimation.au3>

$Form1 = GUICreate("Диагностика и Настройка", 619, 442, 189, 122)
$Tab1 = GUICtrlCreateTab(8, 16, 601, 377)
$TotalInfo = GUICtrlCreateTabItem("TotalInfo")
GUICtrlSetState(-1,$GUI_SHOW)
$Group1 = GUICtrlCreateGroup("Ошибки в работе системы", 24, 48, 281, 153)
$Label1 = GUICtrlCreateLabel("Журналы Событий", 40, 72, 99, 17)
$Edit3 = GUICtrlCreateEdit("", 212, 72, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label2 = GUICtrlCreateLabel("Ошибки обновлений", 40, 105, 107, 17)
$Edit4 = GUICtrlCreateEdit("", 212, 105, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label3 = GUICtrlCreateLabel("Проблемное оборудование", 40, 138, 142, 17)
$Edit5 = GUICtrlCreateEdit("", 212, 138, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label4 = GUICtrlCreateLabel("Наличие доступа в сеть", 40, 171, 125, 17)
$Edit6 = GUICtrlCreateEdit("", 212, 171, 81, 17)
GUICtrlSetData(-1, "Edit3")
;GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Информация о ПК", 321, 48, 273, 329)
$Group4 = GUICtrlCreateGroup("Разделы", 329, 246, 257, 120)
$ListView1 = GUICtrlCreateListView("Drive|TotalSpace(MB)|FreeSpace(MB)", 337, 262, 240, 95)
$DrivesArr = DriveGetDrive("Fixed") 
If IsArray($DrivesArr) Then 
    For $i = 1 To $DrivesArr[0] 
        $FreeSpace = DriveSpaceFree($DrivesArr[$i]) 
	 	$TotalSpace = DriveSpaceTotal($DrivesArr[$i])
        GUICtrlCreateListViewItem(StringUpper($DrivesArr[$i]) & "\|" & Round($TotalSpace, 1) & "|" & Round($FreeSpace, 1), $ListView1) 
    Next 
EndIf 
;GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group5 = GUICtrlCreateGroup("СисИнфо", 329, 64, 257, 177)
$Label9 = GUICtrlCreateLabel("Пользователь", 339, 90, 77, 17)
$Edit12 = GUICtrlCreateEdit("", 425, 90, 153, 17)
GUICtrlSetData(-1, "Edit3")
$Label10 = GUICtrlCreateLabel("Ось / разрядн.", 339, 149, 80, 17)
$Edit13 = GUICtrlCreateEdit("", 425, 149, 105, 17)
GUICtrlSetData(-1, "Edit3")
$Label11 = GUICtrlCreateLabel("CPU / Cores", 339, 178, 64, 17)
$Label12 = GUICtrlCreateLabel("Админ. права", 339, 119, 73, 17)
$Edit15 = GUICtrlCreateEdit("", 425, 119, 153, 17)
GUICtrlSetData(-1, "Edit3")
$Edit16 = GUICtrlCreateEdit("", 537, 149, 41, 17)
GUICtrlSetData(-1, "Edit3")
$Edit14 = GUICtrlCreateEdit("", 425, 178, 105, 17)
GUICtrlSetData(-1, "Edit3")
$Edit17 = GUICtrlCreateEdit("", 537, 178, 41, 17)
GUICtrlSetData(-1, "Edit3")
$Label13 = GUICtrlCreateLabel("RAM, MB", 339, 207, 50, 17)
$Edit18 = GUICtrlCreateEdit("", 425, 207, 153, 17)
GUICtrlSetData(-1, "Edit3")
;GUICtrlCreateGroup("", -99, -99, 1, 1)
;GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Доп. инфо", 23, 212, 281, 121)
$Label5 = GUICtrlCreateLabel("Переменные среды", 35, 229, 105, 17)
$Edit7 = GUICtrlCreateEdit("", 159, 229, 137, 17)
GUICtrlSetData(-1, "Edit3")
$Label6 = GUICtrlCreateLabel("Папка Temp", 35, 254, 66, 17)
$Edit8 = GUICtrlCreateEdit("", 159, 254, 137, 17)
GUICtrlSetData(-1, "Edit3")
$Label7 = GUICtrlCreateLabel("Файл подкачки", 35, 280, 83, 17)
$Edit9 = GUICtrlCreateEdit("", 159, 280, 137, 17)
GUICtrlSetData(-1, "Edit3")
$Label8 = GUICtrlCreateLabel("Мои документы", 35, 305, 84, 17)
$Edit10 = GUICtrlCreateEdit("", 159, 305, 137, 17)
GUICtrlSetData(-1, "Edit3")
;GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button7 = GUICtrlCreateButton("Разделы", 23, 344, 57, 33)
$Button8 = GUICtrlCreateButton("Службы", 98, 344, 57, 33)
$Button9 = GUICtrlCreateButton("Папки", 172, 344, 57, 33)
$Button10 = GUICtrlCreateButton("Автозагр", 247, 344, 57, 33)
GUICtrlCreateTabItem("")
GUICtrlSetState(-1,$GUI_SHOW)
$Button1 = GUICtrlCreateButton("Сохранить", 500, 400, 105, 33)
$Button2 = GUICtrlCreateButton("Печатать", 370, 400, 105, 33)
$Button3 = GUICtrlCreateButton("Настройка", 500, 7, 105, 25)
$Button17 = GUICtrlCreateButton("Обновить", 239, 400, 105, 33)

$Network = GUICtrlCreateTabItem("Network")
$Group11 = GUICtrlCreateGroup("Статистика", 16, 48, 385, 233)
$Label26 = GUICtrlCreateLabel("Connected via DIAL-UP:", 24, 70, 121, 17)
$Edit33 = GUICtrlCreateEdit("", 36, 99, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label27 = GUICtrlCreateLabel("Connected via   LAN:", 153, 70, 106, 17)
$Edit34 = GUICtrlCreateEdit("", 164, 99, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label28 = GUICtrlCreateLabel("Connected via   PROXY:", 270, 70, 122, 17)
$Edit35 = GUICtrlCreateEdit("", 290, 99, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label29 = GUICtrlCreateLabel("Modem busy:", 24, 126, 67, 17)
$Edit36 = GUICtrlCreateEdit("", 34, 155, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label30 = GUICtrlCreateLabel("Connection RAS installed:", 132, 126, 127, 17)
$Edit37 = GUICtrlCreateEdit("", 164, 155, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label31 = GUICtrlCreateLabel("Connection is offline:", 270, 126, 102, 17)
$Edit38 = GUICtrlCreateEdit("", 288, 155, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Edit39 = GUICtrlCreateEdit("", 24, 200, 369, 73, $ES_WANTRETURN)
GUICtrlSetData(-1, "Edit39")
$Label32 = GUICtrlCreateLabel("Connection description:", 23, 180, 115, 17)
;GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group12 = GUICtrlCreateGroup("Текущая скорость адаптеров", 16, 288, 585, 97)
$Combo1 = GUICtrlCreateCombo("Combo1", 88, 307, 505, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Label34 = GUICtrlCreateLabel("Адаптер:", 32, 309, 49, 17)
$Group16 = GUICtrlCreateGroup("Трансфер (Bytes + MB):", 24, 333, 569, 44)
$Label35 = GUICtrlCreateLabel("Отдача:", 34, 353, 43, 17)
$Edit41 = GUICtrlCreateEdit("", 87, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Edit42 = GUICtrlCreateEdit("", 184, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label36 = GUICtrlCreateLabel("Отдача:", 346, 353, 43, 17)
$Edit43 = GUICtrlCreateEdit("", 399, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Edit44 = GUICtrlCreateEdit("", 496, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
;GUICtrlCreateGroup("", -99, -99, 1, 1)
;GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group13 = GUICtrlCreateGroup("Скорость работы провайдера", 408, 48, 193, 233)
$Button15 = GUICtrlCreateButton("Старт", 428, 120, 153, 23)
$Label33 = GUICtrlCreateLabel("Проверка скорости:", 429, 92, 150, 17)
Local $sResume, $pGIF, _
        $sFileGIF = @WindowsDir & "\pchealth\helpctr\System\images\progbar.gif", _
        $Group13, $Label33, $hGIF, $Button15, $nMsg, $hMenu
GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button15
            $hGIF = _GUICtrlCreateGIF($sFileGIF, "", 429, 160, $pGIF)
            GUICtrlSetState($Button15, $GUI_DISABLE)
            GUICtrlSetData($Label33, "Подождите, идет проверка.")
            Call("_SpeedInternet")
            _GIF_DeleteGIF($pGIF)
            GUICtrlSetData($Label33, $sResume)
            GUICtrlSetState($Button15, $GUI_ENABLE)
    EndSwitch
WEnd

Func _SpeedInternet()
    $sResume = 'Произошла ошибка.'
    Local $sPattern = '(?s).*?= (.*?)\r\n?.*', $sText
    Local $oIE = _IECreate("http://www.spbtlg.ru/stb.php", 0, 0)
    If Not IsObj($oIE) Then Return $sResume
    $sText = _IEBodyReadText($oIE)
    _IEQuit($oIE)
    If $sText Then
        $sText = StringRegExpReplace($sText, $sPattern, "\1")
        If Number($sText) Then $sResume = "Ваша скорость: " & $sText & ' Kbps'
    EndIf
    Return $sResume
EndFunc   ;==>_SpeedInternet
;GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState()

    While 1
        $msg = GUIGetMsg()
        
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd


Если можно, поясните, как правильно д.б. или, хотя бы, где я неправ .... или где можно посмотреть.

Последний раз редактировалось saavaage, 10-08-2010 в 01:30.


Отправлено: 01:06, 10-08-2010 | #3


Аватара для Creat0R

Must AutoIt


Сообщения: 3054
Благодарности: 1009

Профиль | Сайт | Отправить PM | Цитировать


Цитата saavaage:
почему нерабочий? »
Цитата saavaage:
и еще там необходима библиотека GIFAnimation.au3 »
Именно поэтому.

Цитата saavaage:
как правильно д.б »
Что такое д.б?

-------
“Сделай так просто, как возможно, но не проще этого.”... “Ты никогда не решишь проблему, если будешь думать так же, как те, кто её создал.”

Альберт Эйнштейн

P.S «Не оказываю техподдержку через ПМ/ICQ, и по email - для этого есть форум. ©»

http://creator-lab.ucoz.ru/Images/Icons/autoit_icon.png Русское сообщество AutoIt | http://creator-lab.ucoz.ru/Images/Ic...eator_icon.png CreatoR's Lab | http://creator-lab.ucoz.ru/Images/Icons/oac_icon.png Opera AC Community


Отправлено: 01:37, 10-08-2010 | #4


Ветеран


Сообщения: 903
Благодарности: 161

Профиль | Отправить PM | Цитировать


Цитата Creat0R:
Что такое д.б? »
должно быть

ПопробЫвал удалять из скрипта кусок кода (про интернет) - отражаются все вкладки правильно. Видно вставил его некорректно....

удалял это:
читать дальше »
Код: Выделить весь код
Local $sResume, $pGIF, _
 $sFileGIF = @WindowsDir & "\pchealth\helpctr\System\images\progbar.gif", _
 $Group13, $Label33, $hGIF, $Button15, $nMsg, $hMenu
GUISetState(@SW_SHOW)
While 1
 $nMsg = GUIGetMsg()
 Switch $nMsg
 Case $GUI_EVENT_CLOSE
 Exit
 Case $Button15
 $hGIF = _GUICtrlCreateGIF($sFileGIF, "", 429, 160, $pGIF)
 GUICtrlSetState($Button15, $GUI_DISABLE)
 GUICtrlSetData($Label33, "Подождите, идет проверка.")
 Call("_SpeedInternet")
 _GIF_DeleteGIF($pGIF)
 GUICtrlSetData($Label33, $sResume)
 GUICtrlSetState($Button15, $GUI_ENABLE)
 EndSwitch
WEnd
Func _SpeedInternet()
 $sResume = 'Произошла ошибка.'
 Local $sPattern = '(?s).*?= (.*?)\r\n?.*', $sText
 Local $oIE = _IECreate("http://www.spbtlg.ru/stb.php", 0, 0)
 If Not IsObj($oIE) Then Return $sResume
 $sText = _IEBodyReadText($oIE)
 _IEQuit($oIE)
 If $sText Then
 $sText = StringRegExpReplace($sText, $sPattern, "\1")
 If Number($sText) Then $sResume = "Ваша скорость: " & $sText & ' Kbps'
 EndIf
 Return $sResume
EndFunc ;==>_SpeedInternet

Последний раз редактировалось saavaage, 10-08-2010 в 16:52.


Отправлено: 01:43, 10-08-2010 | #5


Аватара для Creat0R

Must AutoIt


Сообщения: 3054
Благодарности: 1009

Профиль | Сайт | Отправить PM | Цитировать


saavaage,
В справке написано:

Цитата:
To create a new control on an existing tabitem use GUISwitch($hWin,$tabitem) to select it and just create your new control. Don't forget to close your tabitem creation with GUICtrlCreateTabItem("").
его нужно ставить после создания последнего таба.
В первом коде проблема в том что цикл начинается до создания дополнительных элементов, поэтому до них дело не доходит.

Я бы так сделал:
читать дальше »
Код: Выделить весь код
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GIFAnimation.au3>
#include <IE.au3>

Global $pGIF, $sFileGIF = @WindowsDir & "\pchealth\helpctr\System\images\progbar.gif", $Group13, $Label33, $hGIF, $Button15, $nMsg, $hMenu

$Form1 = GUICreate("Диагностика и Настройка", 619, 442, 189, 122)

$Tab1 = GUICtrlCreateTab(8, 16, 601, 377)

$Network = GUICtrlCreateTabItem("Network")
$Group11 = GUICtrlCreateGroup("Статистика", 16, 48, 385, 233)
$Label26 = GUICtrlCreateLabel("Connected via DIAL-UP:", 24, 70, 121, 17)
$Edit33 = GUICtrlCreateEdit("", 36, 99, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label27 = GUICtrlCreateLabel("Connected via   LAN:", 153, 70, 106, 17)
$Edit34 = GUICtrlCreateEdit("", 164, 99, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label28 = GUICtrlCreateLabel("Connected via   PROXY:", 270, 70, 122, 17)
$Edit35 = GUICtrlCreateEdit("", 290, 99, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label29 = GUICtrlCreateLabel("Modem busy:", 24, 126, 67, 17)
$Edit36 = GUICtrlCreateEdit("", 34, 155, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label30 = GUICtrlCreateLabel("Connection RAS installed:", 132, 126, 127, 17)
$Edit37 = GUICtrlCreateEdit("", 164, 155, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label31 = GUICtrlCreateLabel("Connection is offline:", 270, 126, 102, 17)
$Edit38 = GUICtrlCreateEdit("", 288, 155, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Edit39 = GUICtrlCreateEdit("", 24, 200, 369, 73, $ES_WANTRETURN)
GUICtrlSetData(-1, "Edit39")
$Label32 = GUICtrlCreateLabel("Connection description:", 23, 180, 115, 17)

$Group12 = GUICtrlCreateGroup("Текущая скорость адаптеров", 16, 288, 585, 97)
$Combo1 = GUICtrlCreateCombo("Combo1", 88, 307, 505, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Label34 = GUICtrlCreateLabel("Адаптер:", 32, 309, 49, 17)
$Group16 = GUICtrlCreateGroup("Трансфер (Bytes + MB):", 24, 333, 569, 44)
$Label35 = GUICtrlCreateLabel("Отдача:", 34, 353, 43, 17)
$Edit41 = GUICtrlCreateEdit("", 87, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Edit42 = GUICtrlCreateEdit("", 184, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label36 = GUICtrlCreateLabel("Отдача:", 346, 353, 43, 17)
$Edit43 = GUICtrlCreateEdit("", 399, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Edit44 = GUICtrlCreateEdit("", 496, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")

$Group13 = GUICtrlCreateGroup("Скорость работы провайдера", 408, 48, 193, 233)
$Button15 = GUICtrlCreateButton("Старт", 428, 120, 153, 23)
$Label33 = GUICtrlCreateLabel("Проверка скорости:", 429, 92, 150, 17)

$hGIF = _GUICtrlCreateGIF($sFileGIF, "", 429, 160, $pGIF)
_GIF_PauseAnimation($pGIF)
GUICtrlSetState($hGIF, $GUI_HIDE)

$TotalInfo = GUICtrlCreateTabItem("TotalInfo")
GUICtrlSetState(-1,$GUI_SHOW)
$Group1 = GUICtrlCreateGroup("Ошибки в работе системы", 24, 48, 281, 153)
$Label1 = GUICtrlCreateLabel("Журналы Событий", 40, 72, 99, 17)
$Edit3 = GUICtrlCreateEdit("", 212, 72, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label2 = GUICtrlCreateLabel("Ошибки обновлений", 40, 105, 107, 17)
$Edit4 = GUICtrlCreateEdit("", 212, 105, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label3 = GUICtrlCreateLabel("Проблемное оборудование", 40, 138, 142, 17)
$Edit5 = GUICtrlCreateEdit("", 212, 138, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label4 = GUICtrlCreateLabel("Наличие доступа в сеть", 40, 171, 125, 17)
$Edit6 = GUICtrlCreateEdit("", 212, 171, 81, 17)
GUICtrlSetData(-1, "Edit3")

$Group2 = GUICtrlCreateGroup("Информация о ПК", 321, 48, 273, 329)
$Group4 = GUICtrlCreateGroup("Разделы", 329, 246, 257, 120)
$ListView1 = GUICtrlCreateListView("Drive|TotalSpace(MB)|FreeSpace(MB)", 337, 262, 240, 95)
$DrivesArr = DriveGetDrive("Fixed") 

For $i = 1 To UBound($DrivesArr)-1
	$FreeSpace = DriveSpaceFree($DrivesArr[$i]) 
	$TotalSpace = DriveSpaceTotal($DrivesArr[$i])
	GUICtrlCreateListViewItem(StringUpper($DrivesArr[$i]) & "\|" & Round($TotalSpace, 1) & "|" & Round($FreeSpace, 1), $ListView1) 
Next

$Group5 = GUICtrlCreateGroup("СисИнфо", 329, 64, 257, 177)
$Label9 = GUICtrlCreateLabel("Пользователь", 339, 90, 77, 17)
$Edit12 = GUICtrlCreateEdit("", 425, 90, 153, 17)
GUICtrlSetData(-1, "Edit3")
$Label10 = GUICtrlCreateLabel("Ось / разрядн.", 339, 149, 80, 17)
$Edit13 = GUICtrlCreateEdit("", 425, 149, 105, 17)
GUICtrlSetData(-1, "Edit3")
$Label11 = GUICtrlCreateLabel("CPU / Cores", 339, 178, 64, 17)
$Label12 = GUICtrlCreateLabel("Админ. права", 339, 119, 73, 17)
$Edit15 = GUICtrlCreateEdit("", 425, 119, 153, 17)
GUICtrlSetData(-1, "Edit3")
$Edit16 = GUICtrlCreateEdit("", 537, 149, 41, 17)
GUICtrlSetData(-1, "Edit3")
$Edit14 = GUICtrlCreateEdit("", 425, 178, 105, 17)
GUICtrlSetData(-1, "Edit3")
$Edit17 = GUICtrlCreateEdit("", 537, 178, 41, 17)
GUICtrlSetData(-1, "Edit3")
$Label13 = GUICtrlCreateLabel("RAM, MB", 339, 207, 50, 17)
$Edit18 = GUICtrlCreateEdit("", 425, 207, 153, 17)
GUICtrlSetData(-1, "Edit3")

$Group3 = GUICtrlCreateGroup("Доп. инфо", 23, 212, 281, 121)
$Label5 = GUICtrlCreateLabel("Переменные среды", 35, 229, 105, 17)
$Edit7 = GUICtrlCreateEdit("", 159, 229, 137, 17)
GUICtrlSetData(-1, "Edit3")
$Label6 = GUICtrlCreateLabel("Папка Temp", 35, 254, 66, 17)
$Edit8 = GUICtrlCreateEdit("", 159, 254, 137, 17)
GUICtrlSetData(-1, "Edit3")
$Label7 = GUICtrlCreateLabel("Файл подкачки", 35, 280, 83, 17)
$Edit9 = GUICtrlCreateEdit("", 159, 280, 137, 17)
GUICtrlSetData(-1, "Edit3")
$Label8 = GUICtrlCreateLabel("Мои документы", 35, 305, 84, 17)
$Edit10 = GUICtrlCreateEdit("", 159, 305, 137, 17)
GUICtrlSetData(-1, "Edit3")

$Button7 = GUICtrlCreateButton("Разделы", 23, 344, 57, 33)
$Button8 = GUICtrlCreateButton("Службы", 98, 344, 57, 33)
$Button9 = GUICtrlCreateButton("Папки", 172, 344, 57, 33)
$Button10 = GUICtrlCreateButton("Автозагр", 247, 344, 57, 33)

GUICtrlCreateTabItem("")

$Button1 = GUICtrlCreateButton("Сохранить", 500, 400, 105, 33)
$Button2 = GUICtrlCreateButton("Печатать", 370, 400, 105, 33)
$Button3 = GUICtrlCreateButton("Настройка", 500, 7, 105, 25)
$Button17 = GUICtrlCreateButton("Обновить", 239, 400, 105, 33)

GUISetState()

While 1
    $nMsg = GUIGetMsg()
	
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button15
			GUICtrlSetState($hGIF, $GUI_SHOW)
			_GIF_ResumeAnimation($pGIF)
            GUICtrlSetState($Button15, $GUI_DISABLE)
            GUICtrlSetData($Label33, "Подождите, идет проверка.")
			$sResume = _SpeedInternet()
			GUICtrlSetState($hGIF, $GUI_HIDE)
            _GIF_PauseAnimation($pGIF)
            GUICtrlSetData($Label33, $sResume)
            GUICtrlSetState($Button15, $GUI_ENABLE)
    EndSwitch
WEnd

Func _SpeedInternet()
    Local $sResume = 'Произошла ошибка.'
    Local $sPattern = '(?s).*?= (.*?)\r\n?.*', $sText
    Local $oIE = _IECreate("http://www.spbtlg.ru/stb.php", 0, 0)
    If Not IsObj($oIE) Then Return $sResume
    $sText = _IEBodyReadText($oIE)
    _IEQuit($oIE)
    If $sText Then
		$sText = StringRegExpReplace($sText, $sPattern, "\1")
		If Number($sText) Then $sResume = "Ваша скорость: " & $sText & ' Kbps'
    EndIf
    Return $sResume
EndFunc

-------
“Сделай так просто, как возможно, но не проще этого.”... “Ты никогда не решишь проблему, если будешь думать так же, как те, кто её создал.”

Альберт Эйнштейн

P.S «Не оказываю техподдержку через ПМ/ICQ, и по email - для этого есть форум. ©»

http://creator-lab.ucoz.ru/Images/Icons/autoit_icon.png Русское сообщество AutoIt | http://creator-lab.ucoz.ru/Images/Ic...eator_icon.png CreatoR's Lab | http://creator-lab.ucoz.ru/Images/Icons/oac_icon.png Opera AC Community

Это сообщение посчитали полезным следующие участники:

Отправлено: 03:36, 10-08-2010 | #6


Ветеран


Сообщения: 903
Благодарности: 161

Профиль | Отправить PM | Цитировать


Creat0R, огромное спасибо за помощь.
Последние 3 вопроса на эту тему:
1.
Цитата Creat0R:
Global $pGIF, $sFileGIF = @WindowsDir & "\pchealth\helpctr\System\images\progbar.gif", $Group13, $Label33, $hGIF, $Button15, $nMsg »
Обязательно ли использовать Global или достаточно будет local (со смещением к соответствующей вкладке). Дело в том, что я не совсем понимаю трактовку справки на эту тему:
"Global принудительно создает переменную в глобальной области видимости
Local принудительно создает переменную в локальной (функциональной) области видимости."
Я так понимаю, что Global заявляет переменные на всю форму, а local - только на определенную функцию/вкладку в табе? Если я планирую использовать указанные выше переменные только применительно к конкретной группе вкладки Network ($Group13), как я тогда должен заявить их?
2. у меня также заявлены переменные $Group13, $Label33, $Button15, $hMenu (последняя осталась в коде случайно). Насколько это надо было делать? Я думаю, что немного погорячился. Что скажете?
3. переменная $sResume используется в вычислениях скорости. Надо ли ее заявлять вместе с основными через Local или достаточно того, что она уже заявлена в Func _SpeedInternet()?

Вот мой вариант измененного кода (жирным выделил измененную область). Все работает, но не уверен, что чисто:

читать дальше »
Код: Выделить весь код
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GIFAnimation.au3>
#include <IE.au3>

$Form1 = GUICreate("Диагностика и Настройка", 619, 442, 189, 122)

$Tab1 = GUICtrlCreateTab(8, 16, 601, 377)

$Network = GUICtrlCreateTabItem("Network")
$Group11 = GUICtrlCreateGroup("Статистика", 16, 48, 385, 233)
$Label26 = GUICtrlCreateLabel("Connected via DIAL-UP:", 24, 70, 121, 17)
$Edit33 = GUICtrlCreateEdit("", 36, 99, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label27 = GUICtrlCreateLabel("Connected via   LAN:", 153, 70, 106, 17)
$Edit34 = GUICtrlCreateEdit("", 164, 99, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label28 = GUICtrlCreateLabel("Connected via   PROXY:", 270, 70, 122, 17)
$Edit35 = GUICtrlCreateEdit("", 290, 99, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label29 = GUICtrlCreateLabel("Modem busy:", 24, 126, 67, 17)
$Edit36 = GUICtrlCreateEdit("", 34, 155, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label30 = GUICtrlCreateLabel("Connection RAS installed:", 132, 126, 127, 17)
$Edit37 = GUICtrlCreateEdit("", 164, 155, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label31 = GUICtrlCreateLabel("Connection is offline:", 270, 126, 102, 17)
$Edit38 = GUICtrlCreateEdit("", 288, 155, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Edit39 = GUICtrlCreateEdit("", 24, 200, 369, 73, $ES_WANTRETURN)
GUICtrlSetData(-1, "Edit39")
$Label32 = GUICtrlCreateLabel("Connection description:", 23, 180, 115, 17)

$Group12 = GUICtrlCreateGroup("Текущая скорость адаптеров", 16, 288, 585, 97)
$Combo1 = GUICtrlCreateCombo("Combo1", 88, 307, 505, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Label34 = GUICtrlCreateLabel("Адаптер:", 32, 309, 49, 17)
$Group16 = GUICtrlCreateGroup("Трансфер (Bytes + MB):", 24, 333, 569, 44)
$Label35 = GUICtrlCreateLabel("Отдача:", 34, 353, 43, 17)
$Edit41 = GUICtrlCreateEdit("", 87, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Edit42 = GUICtrlCreateEdit("", 184, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label36 = GUICtrlCreateLabel("Отдача:", 346, 353, 43, 17)
$Edit43 = GUICtrlCreateEdit("", 399, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Edit44 = GUICtrlCreateEdit("", 496, 353, 81, 17)
GUICtrlSetData(-1, "Edit3")

$Group13 = GUICtrlCreateGroup("Скорость работы провайдера", 408, 48, 193, 233)
$Button15 = GUICtrlCreateButton("Старт", 428, 120, 153, 23)
$Label33 = GUICtrlCreateLabel("Проверка скорости:", 429, 92, 150, 17)
Local $sResume, $pGIF, $sFileGIF = @WindowsDir & "\pchealth\helpctr\System\images\progbar.gif", $hGIF, $nMsg
$hGIF = _GUICtrlCreateGIF($sFileGIF, "", 429, 160, $pGIF)
_GIF_PauseAnimation($pGIF)
GUICtrlSetState($hGIF, $GUI_HIDE)

$TotalInfo = GUICtrlCreateTabItem("TotalInfo")
GUICtrlSetState(-1,$GUI_SHOW)
$Group1 = GUICtrlCreateGroup("Ошибки в работе системы", 24, 48, 281, 153)
$Label1 = GUICtrlCreateLabel("Журналы Событий", 40, 72, 99, 17)
$Edit3 = GUICtrlCreateEdit("", 212, 72, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label2 = GUICtrlCreateLabel("Ошибки обновлений", 40, 105, 107, 17)
$Edit4 = GUICtrlCreateEdit("", 212, 105, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label3 = GUICtrlCreateLabel("Проблемное оборудование", 40, 138, 142, 17)
$Edit5 = GUICtrlCreateEdit("", 212, 138, 81, 17)
GUICtrlSetData(-1, "Edit3")
$Label4 = GUICtrlCreateLabel("Наличие доступа в сеть", 40, 171, 125, 17)
$Edit6 = GUICtrlCreateEdit("", 212, 171, 81, 17)
GUICtrlSetData(-1, "Edit3")

$Group2 = GUICtrlCreateGroup("Информация о ПК", 321, 48, 273, 329)
$Group4 = GUICtrlCreateGroup("Разделы", 329, 246, 257, 120)
$ListView1 = GUICtrlCreateListView("Drive|TotalSpace(MB)|FreeSpace(MB)", 337, 262, 240, 95)
$DrivesArr = DriveGetDrive("Fixed") 

For $i = 1 To UBound($DrivesArr)-1
	$FreeSpace = DriveSpaceFree($DrivesArr[$i]) 
	$TotalSpace = DriveSpaceTotal($DrivesArr[$i])
	GUICtrlCreateListViewItem(StringUpper($DrivesArr[$i]) & "\|" & Round($TotalSpace, 1) & "|" & Round($FreeSpace, 1), $ListView1) 
Next

$Group5 = GUICtrlCreateGroup("СисИнфо", 329, 64, 257, 177)
$Label9 = GUICtrlCreateLabel("Пользователь", 339, 90, 77, 17)
$Edit12 = GUICtrlCreateEdit("", 425, 90, 153, 17)
GUICtrlSetData(-1, "Edit3")
$Label10 = GUICtrlCreateLabel("Ось / разрядн.", 339, 149, 80, 17)
$Edit13 = GUICtrlCreateEdit("", 425, 149, 105, 17)
GUICtrlSetData(-1, "Edit3")
$Label11 = GUICtrlCreateLabel("CPU / Cores", 339, 178, 64, 17)
$Label12 = GUICtrlCreateLabel("Админ. права", 339, 119, 73, 17)
$Edit15 = GUICtrlCreateEdit("", 425, 119, 153, 17)
GUICtrlSetData(-1, "Edit3")
$Edit16 = GUICtrlCreateEdit("", 537, 149, 41, 17)
GUICtrlSetData(-1, "Edit3")
$Edit14 = GUICtrlCreateEdit("", 425, 178, 105, 17)
GUICtrlSetData(-1, "Edit3")
$Edit17 = GUICtrlCreateEdit("", 537, 178, 41, 17)
GUICtrlSetData(-1, "Edit3")
$Label13 = GUICtrlCreateLabel("RAM, MB", 339, 207, 50, 17)
$Edit18 = GUICtrlCreateEdit("", 425, 207, 153, 17)
GUICtrlSetData(-1, "Edit3")

$Group3 = GUICtrlCreateGroup("Доп. инфо", 23, 212, 281, 121)
$Label5 = GUICtrlCreateLabel("Переменные среды", 35, 229, 105, 17)
$Edit7 = GUICtrlCreateEdit("", 159, 229, 137, 17)
GUICtrlSetData(-1, "Edit3")
$Label6 = GUICtrlCreateLabel("Папка Temp", 35, 254, 66, 17)
$Edit8 = GUICtrlCreateEdit("", 159, 254, 137, 17)
GUICtrlSetData(-1, "Edit3")
$Label7 = GUICtrlCreateLabel("Файл подкачки", 35, 280, 83, 17)
$Edit9 = GUICtrlCreateEdit("", 159, 280, 137, 17)
GUICtrlSetData(-1, "Edit3")
$Label8 = GUICtrlCreateLabel("Мои документы", 35, 305, 84, 17)
$Edit10 = GUICtrlCreateEdit("", 159, 305, 137, 17)
GUICtrlSetData(-1, "Edit3")

$Button7 = GUICtrlCreateButton("Разделы", 23, 344, 57, 33)
$Button8 = GUICtrlCreateButton("Службы", 98, 344, 57, 33)
$Button9 = GUICtrlCreateButton("Папки", 172, 344, 57, 33)
$Button10 = GUICtrlCreateButton("Автозагр", 247, 344, 57, 33)

GUICtrlCreateTabItem("")

$Button1 = GUICtrlCreateButton("Сохранить", 500, 400, 105, 33)
$Button2 = GUICtrlCreateButton("Печатать", 370, 400, 105, 33)
$Button3 = GUICtrlCreateButton("Настройка", 500, 7, 105, 25)
$Button17 = GUICtrlCreateButton("Обновить", 239, 400, 105, 33)

GUISetState()

While 1
    $nMsg = GUIGetMsg()
	
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button15
			GUICtrlSetState($hGIF, $GUI_SHOW)
			_GIF_ResumeAnimation($pGIF)
            GUICtrlSetState($Button15, $GUI_DISABLE)
            GUICtrlSetData($Label33, "Подождите, идет проверка.")
			$sResume = _SpeedInternet()
			GUICtrlSetState($hGIF, $GUI_HIDE)
            _GIF_PauseAnimation($pGIF)
            GUICtrlSetData($Label33, $sResume)
            GUICtrlSetState($Button15, $GUI_ENABLE)
    EndSwitch
WEnd

Func _SpeedInternet()
    Local $sResume = 'Произошла ошибка.'
    Local $sPattern = '(?s).*?= (.*?)\r\n?.*', $sText
    Local $oIE = _IECreate("http://www.spbtlg.ru/stb.php", 0, 0)
    If Not IsObj($oIE) Then Return $sResume
    $sText = _IEBodyReadText($oIE)
    _IEQuit($oIE)
    If $sText Then
		$sText = StringRegExpReplace($sText, $sPattern, "\1")
		If Number($sText) Then $sResume = "Ваша скорость: " & $sText & ' Kbps'
    EndIf
    Return $sResume
EndFunc

Последний раз редактировалось saavaage, 10-08-2010 в 16:53.


Отправлено: 09:44, 10-08-2010 | #7


Аватара для Creat0R

Must AutoIt


Сообщения: 3054
Благодарности: 1009

Профиль | Сайт | Отправить PM | Цитировать


Цитата saavaage:
Я так понимаю, что Global заявляет переменные на всю форму, а local - только на определенную функцию/вкладку в табе? »
Нет, Local используется только в функций, если переменная объявлена вне функций (неважно где), то она в любом случае будет глобальной, т.ч нет смысла её использовать.

Цитата saavaage:
Насколько это надо было делать? »
Если в дальнейшем они не будут использоваться, то в приципе и не нужны. Хотя рекомендуют объявлять все переменные.

Цитата saavaage:
Вот мой вариант измененного кода »
Это не удобно, используемые переменные лучше объявлять в начале скрипта, чтобы сразу было видно их значение.

-------
“Сделай так просто, как возможно, но не проще этого.”... “Ты никогда не решишь проблему, если будешь думать так же, как те, кто её создал.”

Альберт Эйнштейн

P.S «Не оказываю техподдержку через ПМ/ICQ, и по email - для этого есть форум. ©»

http://creator-lab.ucoz.ru/Images/Icons/autoit_icon.png Русское сообщество AutoIt | http://creator-lab.ucoz.ru/Images/Ic...eator_icon.png CreatoR's Lab | http://creator-lab.ucoz.ru/Images/Icons/oac_icon.png Opera AC Community

Это сообщение посчитали полезным следующие участники:

Отправлено: 16:40, 10-08-2010 | #8


Ветеран


Сообщения: 903
Благодарности: 161

Профиль | Отправить PM | Цитировать


Creat0R, спасибо за подробные ответы. Тема закрыта (решена).

-------
мы рождены, чтоб сказку сделать былью


Отправлено: 16:50, 10-08-2010 | #9



Компьютерный форум OSzone.net » Программирование, базы данных и автоматизация действий » AutoIt » [решено] Не видна вкладка на форме с Tab

Участник сейчас на форуме Участник сейчас на форуме Участник вне форума Участник вне форума Автор темы Автор темы Шапка темы Сообщение прикреплено

Похожие темы
Название темы Автор Информация о форуме Ответов Последнее сообщение
Как настроить вкладки в IE? Лина Хочу все знать 3 31-01-2011 12:52
7 / 2008 R2 - Пропали вкладки в IE8 Vitaliy21 Автоматическая установка Windows 11 / 10 / 8 / 7 / Vista 13 24-05-2010 09:45
Прочее - [решено] На XP Pro видны не все общие папки sasha-lav Сетевые технологии 9 23-11-2009 14:45
[решено] Поле для ввода IP просвечивает сквозь все вкладки GUI окна FlatX007 AutoIt 1 22-06-2009 17:32
WINS/Browse - Не видны все компьютеры рабочей группы Сталин Сетевые технологии 1 27-05-2008 16:12




 
Переход