#include <GuiConstantsEx.au3>
#include <GuiConstants.au3>
#include <GUIComboBox.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <String.au3>
#Include <Array.au3>
#include "..\MPDF_UDF.au3"
Local $zapros
Global $dp
$zapros=guicreate ("Запрос данных", 500,310)
$dp = GuiCtrlCreateInput("", 20, 20, 60, 20) ; создали поле для ввода
$b_Enter = GuiCtrlCreateButton("Далее", 280, 20, 60, 20) ; создали кнопку "Далее"
GUICtrlCreateLabel('Введите число', 90, 20)
GuiSetState() ; показали окно ввода
While 3
Switch GUIGetMsg()
Case $b_Enter
;GuiSetState(@SW_HIDE)
_331()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
func _331()
;set the properties for the pdf
_SetTitle("Demo Table PDF in AutoIt")
_SetSubject("Demo Table PDF in AutoIt, with formating")
_SetKeywords("pdf, demo, table, AutoIt")
_OpenAfter(True);open after generation
_SetUnit($PDF_UNIT_CM)
_SetPaperSize("A4"); A4 landscape
_SetZoomMode($PDF_ZOOM_FULLPAGE)
_SetOrientation($PDF_ORIENTATION_PORTRAIT)
_SetLayoutMode($PDF_LAYOUT_CONTINOUS)
;initialize the pdf
_InitPDF(@ScriptDir & "\Дано.pdf")
;=== load used font(s) ===
;fonts: Garamond
_LoadFontTT("_Arial", $PDF_FONT_ARIAL)
_LoadFontTT("_TimesT", $PDF_FONT_TIMES)
_LoadFontTT("_Calibri", $PDF_FONT_CALIBRI)
_LoadFontTT("_Garamond", $PDF_FONT_GARAMOND)
;start a page
_BeginPage()
;put some graphics, text etc (see the rest)
_SetColourFill(0xA000FFFF)
_DrawText(3, 28, "Искомое число", "_Arial", 12, $PDF_ALIGN_LEFT, 0)
_EndPage()
_ClosePDFFile()
endfunc
#include <GuiConstantsEx.au3>
#include <GuiConstants.au3>
#include <GUIComboBox.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <String.au3>
#include <Array.au3>
; #include <MPDF_UDF.au3>
#include "..\MPDF_UDF.au3"
Global $dp, $zapros
$zapros = GUICreate('Запрос данных', 500, 310)
$dp = GUICtrlCreateInput('', 20, 20, 60, 20) ; создали поле для ввода
$b_Enter = GUICtrlCreateButton('Далее', 280, 20, 60, 20) ; создали кнопку 'Далее'
GUICtrlCreateLabel('Введите число', 90, 20)
GUISetState() ; показали окно ввода
While 3
Switch GUIGetMsg()
Case $b_Enter
;GuiSetState(@SW_HIDE)
_331()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _331()
;set the properties for the pdf
_SetTitle('Demo Table PDF in AutoIt')
_SetSubject('Demo Table PDF in AutoIt, with formating')
_SetKeywords('pdf, demo, table, AutoIt')
_OpenAfter(True);open after generation
_SetUnit($PDF_UNIT_CM)
_SetPaperSize('A4'); A4 landscape
_SetZoomMode($PDF_ZOOM_FULLPAGE)
_SetOrientation($PDF_ORIENTATION_PORTRAIT)
_SetLayoutMode($PDF_LAYOUT_CONTINOUS)
;initialize the pdf
_InitPDF(@ScriptDir & '\Дано.pdf')
;=== load used font(s) ===
;fonts: Garamond
_LoadFontTT('_Arial', $PDF_FONT_ARIAL)
_LoadFontTT('_TimesT', $PDF_FONT_TIMES)
_LoadFontTT('_Calibri', $PDF_FONT_CALIBRI)
_LoadFontTT('_Garamond', $PDF_FONT_GARAMOND)
;start a page
_BeginPage()
;put some graphics, text etc (see the rest)
_SetColourFill(0xA000FFFF)
_DrawText(3, 28, 'Число: ' & GUICtrlRead($dp), '_Arial', 12, $PDF_ALIGN_LEFT, 0)
_EndPage()
_ClosePDFFile()
EndFunc ;==>_331
#include <GuiConstantsEx.au3>
#include <GuiConstants.au3>
#include <GUIComboBox.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <String.au3>
#include <Array.au3>
#include 'printMGv2.au3'
Global $dp, $zapros
Global $hp, $mmssgg, $marginx, $marginy
$zapros = GUICreate('Запрос данных', 500, 310)
$dp = GUICtrlCreateInput('', 20, 20, 60, 20) ; создали поле для ввода
$b_Enter = GUICtrlCreateButton('Далее', 280, 20, 60, 20) ; создали кнопку 'Далее'
GUICtrlCreateLabel('Введите число', 90, 20)
GUISetState() ; показали окно ввода
While 3
Switch GUIGetMsg()
Case $b_Enter
;GuiSetState(@SW_HIDE)
_331()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _331()
$hp = _PrintDllStart($mmssgg);this must always be called first
If $hp = 0 Then
ConsoleWrite("Error from dllstart = " & $mmssgg & @CRLF)
Exit
EndIf
;choose the printer if you don't want the default printer
;If _PrintSetPrinter($hp) = 0 then Exit Msgbox(0,"","Action Cancled");see also _PrinterSelectPrinter
_PrintSelectPrinter($hp, "24x16") ;Automatically choose the printer 24x16
_PrintPageOrientation($hp, 1);set landscape printing
_PrintSetDocTitle($hp, "24x16")
_PrintStartPrint($hp)
$pght = _PrintGetpageheight($hp) - _PrintGetYOffset($hp)
$pgwd = _PrintGetpageWidth($hp) - _PrintGetXOffset($hp)
_PrintSetFont($hp, 'Arial', 20, 0, '') ; шрифт печати - имя, размер(сейчас 20), цвет(0-черный), эффект(сейчас нет) - может быть 'bold' (полужирный), 'underline', 'italic', 'strikeout' и т.д.
$sText = GUICtrlRead($dp) ; читаем текст из элемента $dp
_PrintText($hp, $sText, 100, 200) ; печать текста с координатами в точках (судя по всему, 0.1 миллиметра)
;_PrintImage($hp, "24x16.jpg", _PrintGetXOffset($hp), _PrintGetYOffset($hp), $pgwd, $pght)
_PrintEndPrint($hp)
_PrintNewPage($hp);Not really needed if no more pages to be printed
_printDllClose($hp)
EndFunc ;==>_331
#include <GuiConstantsEx.au3>
#include <GuiConstants.au3>
#include <GUIComboBox.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <String.au3>
#include <Array.au3>
#include 'printMGv2.au3'
Local $sCombo, $dalee3
Local $mmssgg,$marginx,$marginy
global $s1,$s2, $index, $dp
$Debug_CB = False ; Проверяет ClassName передаваемый в ComboBox/ComboBoxEx функции. Установите True и используйте дескриптор от другого элемента, чтобы увидеть как это работает
GUICreate("Окно", 700, 296, -1, -1, $WS_OVERLAPPEDWINDOW)
$sCombo = GUICtrlCreateCombo("", 20, 40, 200, 296)
$dalee3=GuictrlcreateButton("Далее", 20, 200,60, 20)
GUISetState()
$s1=_GUICtrlComboBox_AddString($sCombo,"Определить число автоматически")
$s2=_GUICtrlComboBox_AddString($sCombo,"Определить число самостоятельно")
GuiSetState() ; показали окно ввода
While 3
Switch GUIGetMsg()
Case $dalee3
local $index = GUICtrlSendMsg($sCombo, $CB_GETCURSEL, 0, 0);получаем индекс того что выбрали в комбо
If $index = 0 then
$dp = 777
EndIf
If $index = 0 then
GuiSetState(@SW_HIDE)
_331()
ElseIf $index = 1 then
GuiSetState(@SW_HIDE);================================================================= СКРЫТЬ ОКНО (работает на последнем открытом окне)
_1()
EndIf
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _1()
Global $dp, $zapros
Global $hp
Local $mmssgg,$marginx,$marginy
$zapros = GUICreate('Запрос данных', 500, 310)
$dp = GUICtrlCreateInput('', 20, 20, 60, 20) ; создали поле для ввода
$b_Enter = GUICtrlCreateButton('Далее', 280, 20, 60, 20) ; создали кнопку 'Далее'
GUICtrlCreateLabel('Введите число', 90, 20)
GUISetState() ; показали окно ввода
While 3
Switch GUIGetMsg()
Case $b_Enter
;GuiSetState(@SW_HIDE)
_331()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
EndFunc
Func _331()
$hp = _PrintDllStart($mmssgg);this must always be called first
if $hp = 0 then
consolewrite("Error from dllstart = " & $mmssgg & @CRLF)
Exit
endif
;choose the printer if you don't want the default printer
;If _PrintSetPrinter($hp) = 0 then Exit Msgbox(0,"","Action Cancled");see also _PrinterSelectPrinter
_printsetfont($hp,'Times New Roman',25,0,'')
_PrintSelectPrinter($hp,"24x16");Automatically choose the printer 24x16
_PrintPageOrientation($hp,1);set landscape printing
_PrintSetDocTitle($hp,"24x16")
_PrintStartPrint($hp)
$pght = _PrintGetpageheight($hp) - _PrintGetYOffset($hp)
$pgwd = _PrintGetpageWidth($hp) - _PrintGetXOffset($hp)
_printtext($hp,"Искомое число: " & GUICtrlRead($dp),50,300,0)
_PrintImage($hp,"24x16.jpg",_PrintGetXOffset($hp),_PrintGetYOffset($hp),$pgwd,$pght)
_PrintEndPrint($hp)
_PrintNewPage($hp);Not really needed if no more pages to be printed
_printDllClose($hp)
EndFunc ;==>_331
#include <GuiConstantsEx.au3>
#include <GuiConstants.au3>
#include <GUIComboBox.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <String.au3>
#include <Array.au3>
#include 'printMGv2.au3'
Local $sCombo, $dalee3
Local $mmssgg, $marginx, $marginy
Global $dp = ''
$Debug_CB = False ; Проверяет ClassName передаваемый в ComboBox/ComboBoxEx функции. Установите True и используйте дескриптор от другого элемента, чтобы увидеть как это работает
GUICreate("Окно", 500, 296, -1, -1, $WS_OVERLAPPEDWINDOW)
$dalee3 = GUICtrlCreateButton("Далее", 20, 200, 60, 20)
$sCombo = GUICtrlCreateCombo("Определить число автоматически", 20, 40, 300, 296)
GUICtrlSetData($sCombo, "Определить число самостоятельно") ; добавляем пункт в комбо
GUISetState() ; показали окно ввода
While 3
Switch GUIGetMsg()
Case $dalee3
If GUICtrlRead($sCombo) = "Определить число автоматически" Then ; получаем текст пункта, что выбрали в комбо, сравниваем его
$dp = 777 ; указываем число по умолчанию
_331()
Else
$dp = InputBox("Вопрос", "Введите число", "", "") ; вопросительное сообщение для ввода числа
If $dp <> "" And MsgBox(1, 'Продолжение работы', 'Печатать?') = 1 Then _331(); если число было введено и выбрано подтверждение, печать продолжена
EndIf
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _331()
$hp = _PrintDllStart($mmssgg);this must always be called first
If $hp = 0 Then
ConsoleWrite("Error from dllstart = " & $mmssgg & @CRLF)
Exit
EndIf
;choose the printer if you don't want the default printer
;If _PrintSetPrinter($hp) = 0 then Exit Msgbox(0,"","Action Cancled");see also _PrinterSelectPrinter
_printsetfont($hp, 'Times New Roman', 25, 0, '')
_PrintSelectPrinter($hp, "doPDF v7");Automatically choose the printer 24x16
_PrintPageOrientation($hp, 1);set landscape printing
_PrintSetDocTitle($hp, "24x16")
_PrintStartPrint($hp)
$pght = _PrintGetpageheight($hp) - _PrintGetYOffset($hp)
$pgwd = _PrintGetpageWidth($hp) - _PrintGetXOffset($hp)
_printtext($hp, "Искомое число: " & $dp, 50, 300, 0)
_PrintImage($hp, "24x16.jpg", _PrintGetXOffset($hp), _PrintGetYOffset($hp), $pgwd, $pght)
_PrintEndPrint($hp)
_PrintNewPage($hp);Not really needed if no more pages to be printed
_printDllClose($hp)
EndFunc ;==>_331