1

Тема: AHK: Изменение текста с помощью GUI

Здравствуйте, столкнулся с проблемой что не могу сделать универсальный редактор текста с помощью GUI.
Суть его такова что я вписываю в строки ввода текст он его отправляет в другую вкладку и вставляет в соответствующие для этого текста места.
Вот мой GUI код

+ GUI

;Gui, Tab, work
Gui, Add, Tab, x3 y6 w1030 h610 , work|end
Gui, Add, GroupBox, x13 y86 w1010 h520 , main obl
Gui, Add, GroupBox, x23 y116 w950 h100 , obl 1
Gui, Add, Edit, x43 y146 w290 h20 , image 1
Gui, Add, Edit, x43 y176 w290 h20 , name 1
Gui, Add, Edit, x353 y146 w290 h20 , image 2
Gui, Add, Edit, x353 y176 w290 h20 , name 2
Gui, Add, Edit, x663 y146 w290 h20 , image 3
Gui, Add, Edit, x663 y176 w290 h20 , name 3
Gui, Add, Button, x983 y116 w30 h100 , +
Gui, Tab, end
Gui, Add, Edit, x13 y36 w1010 h570 , ПЛАНШЕТ ТЕКСТА
Gui, Tab, work
Gui, Add, Edit, x13 y46 w570 h20 , main image
Gui, Show, x129 y84 h629 w1044, New GUI Window
Return

GuiClose:
ExitApp

Вот планшет текста, что бы не мусорить и не отвлекать внимание я заменил ненужный текст на "!"

+ планшет текста

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! main image !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! main image !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

main obl (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

obl 1 (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!               
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  3. name 1   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                                                                       
                                                                                                                                                                   
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 2  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  name 2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 3  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! image 3 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  name 3   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl 1 (конец)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (конец)

  • 1. Как в вкладке END сделать планшет текста, чтобы при запуске скрипта он уже был там, а не вставлять его каждый раз?

  • 2. Как привязать строки ввода в вкладке WORK  к тексту в вкладке END, тоесть я пишу в строке ввода, а оно отправляет текст в другую вкладку и вставляет текст в нужное место?

  • 3. И самое сложное для меня это чтобы при нажатии кнопки "+" добавлявся еще один блок "obl 1" и с ним вместе добавлявся текст в вкладке END сразу после конца obl 1 и чтобы строки ввода соответствовали тексту.

Пример GUI  и текста после добавления блока:

+ пример GUI

http://cs7057.vk.me/c624931/v624931742/38a93/chDHh42yEWU.jpg

+ пример ТЕКСТА

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! main image !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! main image !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

main obl (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

obl 1 (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!               
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  name 1   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                                                                       
                                                                                                                                                                   
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 2  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   image 2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  name 2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 3  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! image 3 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  name 3   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl 1 (конец)

obl 2 (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!               
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   name 4   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                                                                       
                                                                                                                                                                   
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 5  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 5 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   name 5  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    image 6  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! image 6 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  name 6   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl 1 (конец)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (конец)

И забыл добавить кнопку в каждый блок чтобы можно было его удалить как и текст соответствующий ему.

2

Re: AHK: Изменение текста с помощью GUI

Ничего не понял. Объясните понятней: что, зачем, и для чего, и почему именно так, а не иначе.

3 (изменено: niceice, 2015-07-14 20:52:12)

Re: AHK: Изменение текста с помощью GUI

Доктор ТуамОсес, есть окно WORK, в нем есть строки ввода стоящие 2 по вертикали, сверху я вписываю айди картинки, а снизу название, то есть то, что я вписал отсылается в вкладку в текст и в определенное место текста, то есть предложение: Я пишу ...... своему другу . Когда я пишу в строке ввода слово: стихотворение. Получается предложение: Я пишу стихотворение своему другу. Аналогично с GUI я пишу в строке Image 1 нужный мне текст он отсылается в текст в вкладке END и в то место, где надо (привел в примере).

Вот в рисунке.
http://cs7057.vk.me/c624931/v624931742/38ab8/QEHdhxPS6FA.jpg

4 (изменено: niceice, 2015-07-14 20:40:56)

Re: AHK: Изменение текста с помощью GUI

Доктор ТуамОсес, выше я описал как оно функционирует или как должна функционировать, если вы это поймете то опишу главные проблемы. Если непонятно прошу переспросить у меня.

5

Re: AHK: Изменение текста с помощью GUI

Перевожу:
1. Во второй вкладке GUI (которая именуется "End") в текстовое поле вставить текст. Текст берётся то ли из файла, то ли из переменной под названием "планшет текста"
2. Когда заполняем текстовые поля в первой вкладке, скрипт должен считывать их и в определённом формате заносить информацию во вкладку "End".
3. При нажатии кнопки "+" должен появиться новый блок (аналог obl1), также заносящий информацию во вкладку "End", но в свой отдельный абзац.
При нажатии кнопки "-" этот блок должен удалиться.

Всё это жутко напоминает элемент управления "Дерево".

6

Re: AHK: Изменение текста с помощью GUI

ypppu пишет:

Перевожу:
1. Во второй вкладке GUI (которая именуется "End") в текстовое поле вставить текст. Текст берётся то ли из файла, то ли из переменной под названием "планшет текста"

А нельзя чтобы в том текстовом поле уже присутствовал тот текст "планшет"?

7

Re: AHK: Изменение текста с помощью GUI

Ну впишите его в код скрипта - будет "сразу".

8

Re: AHK: Изменение текста с помощью GUI

ypppu пишет:

Ну впишите его в код скрипта - будет "сразу".

Я не знаю как. Пробовал вставить вместо теперешнего ПЛАНШЕТ ТЕКСТА, но выдает ерор.

9

Re: AHK: Изменение текста с помощью GUI

Так что-ли?

;Gui, Tab, work
Gui, Add, Tab, x3 y6 w1030 h610 , work|end
Gui, Add, GroupBox, x13 y86 w1010 h520 , main obl
Gui, Add, GroupBox, x23 y116 w950 h100 , obl 1
Gui, Add, Edit, x43 y146 w290 h20 vimage_1 gsubmit, image 1
Gui, Add, Edit, x43 y176 w290 h20 vname_1 gsubmit, name 1
Gui, Add, Edit, x353 y146 w290 h20 vimage_2 gsubmit, image 2
Gui, Add, Edit, x353 y176 w290 h20 vname_2 gsubmit, name 2
Gui, Add, Edit, x663 y146 w290 h20 vimage_3 gsubmit, image 3
Gui, Add, Edit, x663 y176 w290 h20 vname_3 gsubmit, name 3
Gui, Add, Button, x983 y116 w30 h100 gAdd, +
Gui, Tab, end
Gui, Add, Edit, x13 y36 w1010 h570 vEndText gsubmit, ПЛАНШЕТ ТЕКСТА
Gui, Tab, work
Gui, Add, Edit, x13 y46 w570 h20 vmain_image gsubmit, main image
Gui, Show, x129 y84 h629 w1044, New GUI Window
Return
GuiClose:
ExitApp


submit:
gui,submit,nohide
EndText=
(
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %main_image% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %main_image% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl 1 (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_1%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_2%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   %image_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_3%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %image_3% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_3%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl 1 (конец)
obl 2 (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_4% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_4% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   %name_4%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_5%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_5% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   %name_5%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_6%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %image_6% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_6%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl 1 (конец)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (конец)
)
GuiControl,,EndText,%EndText%


return



Add:
;underconstruct
return
Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

10 (изменено: Alectric, 2015-07-14 21:11:12)

Re: AHK: Изменение текста с помощью GUI

Подозреваю, что нужно еще чтобы остальной текст, который "!!!!!!!!!!!!!!!", редактировался во вкладке End? Это будет очень проблематично.

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

11

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:

Так что-ли?

Да все так, только вот как сделать чтобы добавлять блок?

12

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:

Подозреваю, что нужно еще чтобы остальной текст, который "!!!!!!!!!!!!!!!", редактировался во вкладке End? Это будет очень проблематично.

Нет, редактировать его не нужно, только частично. То есть только когда будет добавляться новый блок.

13

Re: AHK: Изменение текста с помощью GUI

niceice пишет:

что бы не мусорить и не отвлекать внимание я заменил ненужный текст на "!"

А этот текст всегда разный? Он имеет одинаковое количество символов?

14 (изменено: niceice, 2015-07-14 21:19:33)

Re: AHK: Изменение текста с помощью GUI

yalanne пишет:

А этот текст всегда разный? Он имеет одинаковое количество символов?

Он всегда одинаковый, за исключением того когда будет добавляться еще 1 блок.
Если нужно могу показать этот текст.

15

Re: AHK: Изменение текста с помощью GUI

niceice пишет:
ypppu пишет:

Ну впишите его в код скрипта - будет "сразу".

Я не знаю как. Пробовал вставить вместо теперешнего ПЛАНШЕТ ТЕКСТА, но выдает ерор.


GUI, Add, Text, ,
(
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
)
GUI, Show

16

Re: AHK: Изменение текста с помощью GUI

Думаю тут лучше подойдет контрол "List". Но он довольно сложен в освоении, я до сих пор его не освоил.

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

17

Re: AHK: Изменение текста с помощью GUI

ypppu, спасибо за пример.

18 (изменено: Alectric, 2015-07-14 21:33:08)

Re: AHK: Изменение текста с помощью GUI

"Добавлять блок", имелось в виду так?:

blockNum=1
;Gui, Tab, work
Gui, Add, Tab, x3 y6 w1030 h610 , work|end
Gui, Add, GroupBox, x13 y86 w1010 h520 , main obl
Gui, Add, GroupBox, x23 y116 w950 h100 , obl 1
Gui, Add, Edit, x43 y146 w290 h20 vimage_1 gsubmit, image 1
Gui, Add, Edit, x43 y176 w290 h20 vname_1 gsubmit, name 1
Gui, Add, Edit, x353 y146 w290 h20 vimage_2 gsubmit, image 2
Gui, Add, Edit, x353 y176 w290 h20 vname_2 gsubmit, name 2
Gui, Add, Edit, x663 y146 w290 h20 vimage_3 gsubmit, image 3
Gui, Add, Edit, x663 y176 w290 h20 vname_3 gsubmit, name 3
Gui, Add, Button, x983 y116 w30 h100 gAdd, +
Gui, Tab, end
Gui, Add, Edit, x13 y36 w1010 h570 vEndText gsubmit, ПЛАНШЕТ ТЕКСТА
Gui, Tab, work
Gui, Add, Edit, x13 y46 w570 h20 vmain_image gsubmit, main image
Gui, Show, x129 y84 h629 w1044, New GUI Window
Return
GuiClose:
ExitApp


submit:
gui,submit,nohide

loop,% blockNum
{

block=
(
obl 1 (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_1%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_2%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   %image_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_3%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %image_3% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_3%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl 1 (конец)
)


blocks.=

}

EndText=
(
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %main_image% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %main_image% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
%blocks%
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (конец)
)
GuiControl,,EndText,%EndText%


return



Add:
blockNum++
Gui, Tab, work
Gui, Add, Edit, xm+30 y+10 w290 h20 vimage%blockNum%_1 gsubmit, %blockNum%image 1
Gui, Add, Edit, x+20 yp w290 h20 vimage%blockNum%_2 gsubmit, %blockNum%image 2
Gui, Add, Edit, x+20 yp w290 h20 vimage%blockNum%_3 gsubmit, %blockNum%image 3
Gui, Add, Edit, xm+30 y+5 w290 h20 vname%blockNum%_1 gsubmit, %blockNum%name 1
Gui, Add, Edit, x+20 yp w290 h20 vname%blockNum%_2 gsubmit, %blockNum%name 2
Gui, Add, Edit, x+20 yp w290 h20 vname%blockNum%_3 gsubmit, %blockNum%name 3

GUI, Show
return




Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

19 (изменено: niceice, 2015-07-14 21:40:39)

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:

"Добавлять блок", имелось в виду так?:

Так, но текст не добавляется. Да и не корректно они добавляются, но вы возможно имели в виду самую суть.

20

Re: AHK: Изменение текста с помощью GUI

Я еще не делал чтобы текст добавлялся, я только добавил контролы.

blockNum=0
;Gui, Tab, work
Gui, Add, Tab, x3 y6 w1030 h610 , work|end
Gui, Add, GroupBox, x13 y70 w1010 h520 , main obl
Gui, Add, Button, x983 y116 w30 h100 gAdd, +
Gui, Tab, end
Gui, Add, Edit, x13 y36 w1010 h570 vEndText gsubmit, ПЛАНШЕТ ТЕКСТА
Gui, Tab, work
Gui, Add, Edit, x13 y46 w570 h20 vmain_image gsubmit, main image
Gui, Show, x129 y84 h629 w1044, New GUI Window
Return
GuiClose:
ExitApp


submit:
gui,submit,nohide

loop,% blockNum
{

block=
(
obl 1 (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_1%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_2%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   %image_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_3%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %image_3% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_3%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl 1 (конец)
)


blocks.=

}

EndText=
(
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %main_image% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %main_image% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
%blocks%
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (конец)
)
GuiControl,,EndText,%EndText%


return



Add:
blockNum++
Gui, Tab, work
Gui, Add, GroupBox, x23 y+20 w950 h100 , obl %blockNum%
Gui, Add, Edit, xm+30 yp+30 w290 h20 vimage%blockNum%_1 gsubmit, %blockNum%image 1
Gui, Add, Edit, x+20 yp w290 h20 vimage%blockNum%_2 gsubmit, %blockNum%image 2
Gui, Add, Edit, x+20 yp w290 h20 vimage%blockNum%_3 gsubmit, %blockNum%image 3
Gui, Add, Edit, xm+30 y+5 w290 h20 vname%blockNum%_1 gsubmit, %blockNum%name 1
Gui, Add, Edit, x+20 yp w290 h20 vname%blockNum%_2 gsubmit, %blockNum%name 2
Gui, Add, Edit, x+20 yp w290 h20 vname%blockNum%_3 gsubmit, %blockNum%name 3

;GUI, Show
return




Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

21

Re: AHK: Изменение текста с помощью GUI

Теперь добавляет текст:

blockNum=0
;Gui, Tab, work
Gui, Add, Tab, x3 y6 w1030 h610 , work|end
Gui, Add, GroupBox, x13 y70 w1010 h520 , main obl
Gui, Add, Button, x983 y116 w30 h100 gAdd, +
Gui, Tab, end
Gui, Add, Edit, x13 y36 w1010 h570 vEndText gsubmit, ПЛАНШЕТ ТЕКСТА
Gui, Tab, work
Gui, Add, Edit, x13 y46 w570 h20 vmain_image gsubmit, main image
Gui, Show, x129 y84 h629 w1044, New GUI Window
Return
GuiClose:
ExitApp


submit:
gui,submit,nohide

loop,% blockNum
{

image_1:=%blockNum%image_1
name_1:=%blockNum%name_1
image_2:=%blockNum%image_2
name_2:=%blockNum%name_2
image_3:=%blockNum%image_3
name_3:=%blockNum%name_3

block=
(
obl %blockNum% (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_1%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_2%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   %image_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_3%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %image_3% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_3%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl %blockNum% (конец)
)

blocks.=block "`n"

}

EndText=
(
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %main_image% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %main_image% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
%blocks%
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (конец)
)
GuiControl,,EndText,%EndText%


return



Add:
blockNum++
Gui, Tab, work
Gui, Add, GroupBox, x23 y+20 w950 h100 , obl %blockNum%
Gui, Add, Edit, xm+30 yp+30 w290 h20 vimage%blockNum%_1 gsubmit, %blockNum%image 1
Gui, Add, Edit, x+20 yp w290 h20 vimage%blockNum%_2 gsubmit, %blockNum%image 2
Gui, Add, Edit, x+20 yp w290 h20 vimage%blockNum%_3 gsubmit, %blockNum%image 3
Gui, Add, Edit, xm+30 y+5 w290 h20 vname%blockNum%_1 gsubmit, %blockNum%name 1
Gui, Add, Edit, x+20 yp w290 h20 vname%blockNum%_2 gsubmit, %blockNum%name 2
Gui, Add, Edit, x+20 yp w290 h20 vname%blockNum%_3 gsubmit, %blockNum%name 3

;GUI, Show
return
Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

22

Re: AHK: Изменение текста с помощью GUI

Alectric, второй вариант идеален, как можно будет прокрутку вниз сделать?

23 (изменено: Alectric, 2015-07-14 22:07:27)

Re: AHK: Изменение текста с помощью GUI

Исправил критическую ошибку:

blockNum=0
;Gui, Tab, work
Gui, Add, Tab, x3 y6 w1030 h610 , work|end
Gui, Add, GroupBox, x13 y70 w1010 h520 , main obl
Gui, Add, Button, x983 y116 w30 h100 gAdd, +
Gui, Tab, end
Gui, Add, Edit, x13 y36 w1010 h570 vEndText gsubmit, ПЛАНШЕТ ТЕКСТА
Gui, Tab, work
Gui, Add, Edit, x13 y46 w570 h20 vmain_image gsubmit, main image
Gui, Show, x129 y84 h629 w1044, New GUI Window
Return
GuiClose:
ExitApp


submit:
gui,submit,nohide

blocks=
loop,% blockNum
{

image_1:=image%a_index%_1
name_1:=name%a_index%_1
image_2:=image%a_index%_2
name_2:=name%a_index%_2
image_3:=image%a_index%_3
name_3:=name%a_index%_3

block=
(
obl %a_index% (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_1%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_2%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   %image_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_3%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %image_3% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_3%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl %a_index% (конец)
)

blocks.=block "`n"

}

EndText=
(
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %main_image% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %main_image% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
%blocks%
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (конец)
)
GuiControl,,EndText,%EndText%


return



Add:
blockNum++
Gui, Tab, work
Gui, Add, GroupBox, x23 y+20 w950 h100 , obl %blockNum%
Gui, Add, Edit, xm+30 yp+30 w290 h20 vimage%blockNum%_1 gsubmit, %blockNum%image 1
Gui, Add, Edit, x+20 yp w290 h20 vimage%blockNum%_2 gsubmit, %blockNum%image 2
Gui, Add, Edit, x+20 yp w290 h20 vimage%blockNum%_3 gsubmit, %blockNum%image 3
Gui, Add, Edit, xm+30 y+5 w290 h20 vname%blockNum%_1 gsubmit, %blockNum%name 1
Gui, Add, Edit, x+20 yp w290 h20 vname%blockNum%_2 gsubmit, %blockNum%name 2
Gui, Add, Edit, x+20 yp w290 h20 vname%blockNum%_3 gsubmit, %blockNum%name 3

gui,submit,nohide
gosub,submit
return




Прокрутку я не знаю как сделать, сразу говорю.
Наверное как-то контрол внутрь контрола добавлять нужно... ну или изучать "List", что, мне кажется, меньше времени займет.

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

24 (изменено: Alectric, 2015-07-14 22:11:31)

Re: AHK: Изменение текста с помощью GUI

В качестве альтернативы скрола:

;Gui, Tab, 1
work=1
Gui, Add, Tab, x3 y6 w1030 h610 , 1|2|3|4|5|6|7|8|9|10|end
Gui, Add, GroupBox, x13 y70 w1010 h520 , main obl
Gui, Add, Button, x983 y116 w30 h100 gAdd, +
Gui, Tab, end
Gui, Add, Edit, x13 y36 w1010 h570 vEndText gsubmit, ПЛАНШЕТ ТЕКСТА
Gui, Tab, 1
Gui, Add, Edit, x13 y46 w570 h20 vmain_image gsubmit, main image
Gui, Show, x129 y84 h629 w1044, New GUI Window
Return
GuiClose:
ExitApp


submit:
gui,submit,nohide

blocks=
loop,% blockNum
{

image_1:=image%a_index%_1
name_1:=name%a_index%_1
image_2:=image%a_index%_2
name_2:=name%a_index%_2
image_3:=image%a_index%_3
name_3:=name%a_index%_3

block=
(
obl %a_index% (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_1%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_2%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   %image_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_3%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %image_3% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_3%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl %a_index% (конец)
)

blocks.=block "`n"

}

EndText=
(
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %main_image% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %main_image% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
%blocks%
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
main obl (конец)
)
GuiControl,,EndText,%EndText%


return



Add:
Num++
if num>5
{
  work++
  Num=1
}
blockNum++
tooltip,Блоков - %blockNum%`nСтраниц - %work%
Gui, Tab, %work%
Gui, Add, GroupBox, x23 y+20 w950 h100 , obl %blockNum%
Gui, Add, Edit, xm+30 yp+30 w290 h20 vimage%blockNum%_1 gsubmit, %blockNum%image 1
Gui, Add, Edit, x+20 yp w290 h20 vimage%blockNum%_2 gsubmit, %blockNum%image 2
Gui, Add, Edit, x+20 yp w290 h20 vimage%blockNum%_3 gsubmit, %blockNum%image 3
Gui, Add, Edit, xm+30 y+5 w290 h20 vname%blockNum%_1 gsubmit, %blockNum%name 1
Gui, Add, Edit, x+20 yp w290 h20 vname%blockNum%_2 gsubmit, %blockNum%name 2
Gui, Add, Edit, x+20 yp w290 h20 vname%blockNum%_3 gsubmit, %blockNum%name 3

gui,submit,nohide
gosub,submit
return




Здесь добавляй страницы заранее (на каждой 5 блоков):

Gui, Add, Tab, x3 y6 w1030 h610 , 1|2|3|4|5|6|7|8|9|10|end

"End" всегда в конце должен быть.

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

25

Re: AHK: Изменение текста с помощью GUI

Alectric, большое вам спасибо! Может можно вас как-то поблагодарить?

26

Re: AHK: Изменение текста с помощью GUI

Можешь и поблагодарить - изучи "list" чтобы я мог у тебя совет спросить, а то у меня на него мозгов не хватает.

А если серьезно - нет спасибо.

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

27

Re: AHK: Изменение текста с помощью GUI

Столкнулся с проблемой.
http://cs7057.vk.me/c624931/v624931742/38afb/ZY2jgjD7i_Y.jpg
Как можно исправить?

28

Re: AHK: Изменение текста с помощью GUI

Вот весь текст который должен быть:

+ текст

EndText=
(
<p>
<style type="text/css">
.all p {
font-family:trebuchet ms,helvetica,sans-serif !important;
color: #444 !important;
font-size: 16px;
}

.hr {
border: 0px !important;
height: 2px !important;
background-color: #888 !important;
}

.big {
object-fit: contain !important;
width: 500px !important;
height: 500px !important;
overflow:hidden !important;
display: block !important;
margin-left: 190px !important;
margin-right: 190px !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}

.strong {
color: rgb(0,0,0) !important;
font-size: 18px !important;
}

.alt {
font-style: oblique !important;
text-align: right !important;
font-size: 18px !important;
font-family: 'Times New Roman' !important;
}

.pri {
color: rgb(0,0,0) !important;
font-size: 36px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 10px !important;
margin-top: 40px !important;
}

.sec {
font-size: 28px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 6px !important;
margin-top: 40px !important;
}

.all a {
color: blue !important;
text-decoration: underline !important;
}

.order {
color: #f11 !important;
font-size: 24px !important;
font-family:trebuchet ms,helvetica,sans-serif !important;
text-decoration: underline !important;
text-transform: uppercase !important;
text-align: center !important;
margin: 30px !important;
}

.order a {
color: red !important;
}

.all table tbody tr td {
vertical-align: top !important;
}

.med {
width: 100% !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 40px !important;
}

.med img {
object-fit: contain !important;
width: 250px !important;
height: 250px !important;
overflow:hidden !important;
display: block !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 0px !important;
margin-top: 14px !important;
vertical-align: top !important;
}

.med p {
text-align: center !important;
font-size:18px !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 14px !important;
margin-top: 7px !important;
width: 250px !important;
}

.small {
width: 100% !important;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}

.small img {
object-fit: contain;
width: 195px !important;
height: 195px !important;
overflow:hidden;
display: block;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 0px;
margin-top: 15px;
vertical-align: top;
border-width: 0px;
border-style: solid;
border-color: black;
}

.small p {
text-align: center !important;
font-size:16px !important;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 10px;
margin-top: 5px;
width: 195px;
font-family:trebuchet ms,helvetica,sans-serif;
color: #444;
} </style>
</p>
<div class="all">
<p>
&nbsp;</p>
</div>
<p>
&nbsp;</p>
<p>
<a href="http://postach.com.ua/image/data/_pro/Zeus/robur.jpg" target="_blank"><img alt="" class="big" src="http://postach.com.ua/image/data/_pro/Zeus/robur.jpg" /></a></p>
<h1 class="order">
<a href="http://postach.com.ua/information/contact" target="_blank">Заказ +380673136554</a></h1>
<table border="0" cellpadding="1" cellspacing="1" class="med" style="width: 500px;">
<tbody>
%blocks%  ; /////////////////////////////////////////////////////БЛОКИ//////////////////////////////////////////////
</tbody>
</table>
</div>
<p>
&nbsp;</p>
)
GuiControl,,EndText,%EndText%


return

29

Re: AHK: Изменение текста с помощью GUI

Слишком длинная переменная, её или разбить на части, или из файла читать.

По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui

30

Re: AHK: Изменение текста с помощью GUI

serzh82saratov пишет:

Слишком длинная переменная, её или разбить на части, или из файла читать.


А как это на части?

31

Re: AHK: Изменение текста с помощью GUI

Вот мой вариант кода:

Gui, Add, Tab, x3 y6 w1030 h665 , work|end
Gui, Tab, end
Gui, Add, Edit, x13 y36 w1010 h570 vtablet 
Gui, Tab, work
    Gui, Add, Edit, x13 y46 w570 h20 vMImage, main image
    Gui, Add, GroupBox, x13 y86 w1010 h580 , main obl
loop 5
{
oblnum++
Gui, Add, GroupBox, x23 y%A_Index%00 w960 h80,obl %A_Index%
    try Gui, Add, Edit,xp+10 yp+20 w290 h20 vObl%A_Index%_img1 gObl , image 1
    try Gui, Add, Edit,xp+300 yp w290 h20 vObl%A_Index%_img2 gObl , image 2
    try Gui, Add, Edit,xp+300 yp w290 h20 vObl%A_Index%_img3 gObl , image 3
    
    try Gui, Add, Edit,xp-600 yp+25 w290 h20 vObl%A_Index%_name1 gObl , name 1
    try Gui, Add, Edit,xp+300 yp w290 h20 vObl%A_Index%_name2 gObl , name 2
    try Gui, Add, Edit,xp+300 yp w290 h20 vObl%A_Index%_name3 gObl , name 3
    
    try Gui, Add, Checkbox,% "xp+300 yp-10 vCheck" A_Index " gObl " ((A_Index=1)? "Checked" : "") , obl %A_Index%
}
Gui, Show, x129 y0 h679 w1044, New GUI Window

Obl:
text:=""
loop % oblnum
{
    Index_p := A_Index
    loop 3
        GuiControlGet,Obl%Index_p%_img%A_Index%
    loop 3
        GuiControlGet,Obl%Index_p%_name%A_Index%
    GuiControlGet,Check%A_Index%
}
GuiControlGet, MImage
Unit := "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
BigUnit := Unit Unit Unit Unit Unit Unit Unit Unit Unit
loop 14
    text.=Unit "`n"
text.="`n" Unit " " MImage " " Unit " " MImage " " Unit
    . "`nmain obl (начало)"
    . "`n" BigUnit "`n" BigUnit "`n"
    
loop % oblnum
    if Check%A_index%
        text.="obl " A_index " (начало)`n"
            . Unit "    " Obl%A_index%_img1 " " Unit "    " Obl%A_index%_img1 " " Unit "`n"
            . Unit "    " Obl%A_index%_name1 " " Unit "    " Obl%A_index%_name1 " " Unit "`n"
            . Unit "    " Obl%A_index%_img2 " " Unit "    " Obl%A_index%_img2 " " Unit "`n"
            . Unit "    " Obl%A_index%_name2 " " Unit "    " Obl%A_index%_name2 " " Unit "`n"
            . Unit "    " Obl%A_index%_img3 " " Unit "    " Obl%A_index%_img3 " " Unit "`n"
            . Unit "    " Obl%A_index%_name3 " " Unit "    " Obl%A_index%_name3 " " Unit "`n"
            . "obl " A_index " (конец)`n"

text.=Unit "`n" BigUnit "`n" BigUnit "`nmain obl (конец)"
GuiControl,,tablet,
GuiControl,,tablet,% text

return
GuiClose:
ExitApp

32

Re: AHK: Изменение текста с помощью GUI

yalanne, спасибо, но нужно более 180 форм.

33 (изменено: yalanne, 2015-07-15 01:19:58)

Re: AHK: Изменение текста с помощью GUI

Ну в принципе мой скрипт их с легкостью создаст. В 7ой строке 5 на 180 заменить. Вот только надо к окну скролинг прикрутить.

34

Re: AHK: Изменение текста с помощью GUI

yalanne пишет:

Ну в принципе мой скрипт их с легкостью создаст. В 7ой строке 5 на 180 заменить. Вот только надо к окну скролинг прикрутить.

Ну, а как скролинг прикрутить никто не знает
Незнаете как решить проблему с EROR?

35 (изменено: yalanne, 2015-07-15 02:38:41)

Re: AHK: Изменение текста с помощью GUI

lengthScroll := 10000

OnMessage(0x115, "WM_VSCROLL")
Gui +0x200000 +Resize +hwndhGui
Gui, Add, Tab,% "x3 y6 w1030 h" lengthScroll + 100 , work|end
Gui, Tab, end
Gui, Add, Edit, x13 y36 w1010 h570 vtablet 
Gui, Tab, work
    Gui, Add, Edit, x13 y46 w570 h20 vMImage gObl, main image
    Gui, Add, GroupBox, x13 y86 w1010 h%lengthScroll% , main obl
loop 100
{
oblnum++
Gui, Add, GroupBox, x23 y%A_Index%00 w960 h80,obl %A_Index%
    try Gui, Add, Edit,xp+10 yp+20 w290 h20 vObl%A_Index%_img1 gObl , image 1
    try Gui, Add, Edit,xp+300 yp w290 h20 vObl%A_Index%_img2 gObl , image 2
    try Gui, Add, Edit,xp+300 yp w290 h20 vObl%A_Index%_img3 gObl , image 3
    
    try Gui, Add, Edit,xp-600 yp+25 w290 h20 vObl%A_Index%_name1 gObl , name 1
    try Gui, Add, Edit,xp+300 yp w290 h20 vObl%A_Index%_name2 gObl , name 2
    try Gui, Add, Edit,xp+300 yp w290 h20 vObl%A_Index%_name3 gObl , name 3
    
    try Gui, Add, Checkbox,% "xp+300 yp-10 vCheck" A_Index " gObl Checked" , obl %A_Index%
}
Gui, Show, x129 y0 h679 w1044, New GUI Window
UpdateScrollBar(hGui, lengthScroll, 400)

Obl:
text:=""
loop % oblnum
{
    Index_p := A_Index
    loop 3
        GuiControlGet,Obl%Index_p%_img%A_Index%
    loop 3
        GuiControlGet,Obl%Index_p%_name%A_Index%
    GuiControlGet,Check%A_Index%
}
GuiControlGet, MImage
Unit := "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
BigUnit := Unit Unit Unit Unit Unit Unit Unit Unit Unit
loop 14
    text.=Unit "`n"
text.="`n" Unit " " MImage " " Unit " " MImage " " Unit
    . "`nmain obl (начало)"
    . "`n" BigUnit "`n" BigUnit "`n"
    
loop % oblnum
    if Check%A_index%
        text.="obl " A_index " (начало)`n"
            . Unit "    " Obl%A_index%_img1 " " Unit "    " Obl%A_index%_img1 " " Unit "`n"
            . Unit "    " Obl%A_index%_name1 " " Unit "    " Obl%A_index%_name1 " " Unit "`n"
            . Unit "    " Obl%A_index%_img2 " " Unit "    " Obl%A_index%_img2 " " Unit "`n"
            . Unit "    " Obl%A_index%_name2 " " Unit "    " Obl%A_index%_name2 " " Unit "`n"
            . Unit "    " Obl%A_index%_img3 " " Unit "    " Obl%A_index%_img3 " " Unit "`n"
            . Unit "    " Obl%A_index%_name3 " " Unit "    " Obl%A_index%_name3 " " Unit "`n"
            . "obl " A_index " (конец)`n"

text.=Unit "`n" BigUnit "`n" BigUnit "`nmain obl (конец)"
GuiControl,,tablet,
GuiControl,,tablet,% text

return
GuiClose:
ExitApp

UpdateScrollBar(hWnd, ScrollHeight, GuiHeight)
{
   VarSetCapacity(si, 28, 0), NumPut(28, si) ,NumPut(0x1 | 0x2, si, 4) ,NumPut(ScrollHeight, si, 12)
   NumPut(GuiHeight, si, 16), DllCall("SetScrollInfo", Ptr, hWnd, UInt, 1, Ptr, &si, UInt, 1)
   
   GuiControlGet, Pos, %hWnd%: Pos, Edit1
   if (PosY = 10)
      Return
   top := PosY - 10
   GuiControlGet, Pos, %hWnd%: Pos, Edit20
   bottom := PosY + PosH + 10
   if (top < 0 && bottom < GuiHeight)
      y := (a := Abs(top)) > (b := GuiHeight-bottom) ? b : a , DllCall("ScrollWindow", Ptr, hWnd, Int, 0, Int, y, Ptr, 0, Ptr, 0)
}

WM_VSCROLL(wParam, lParam, msg, hwnd)
{
   static SIF_ALL:=0x17, SCROLL_STEP:=10
   bar := msg=0x115 , VarSetCapacity(si, 28, 0) , NumPut(28, si, "UInt") , NumPut(SIF_ALL, si, 4, "UInt") ; fMask
   if !DllCall("GetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si)
     return
   VarSetCapacity(rect, 16) , DllCall("GetClientRect", Ptr, hwnd, Ptr, &rect) , new_pos := NumGet(si, 20, "UInt")
   action := wParam & 0xFFFF
   % (action = 0) ? (new_pos -= SCROLL_STEP) : (action = 1) ? (new_pos += SCROLL_STEP)
   : (action = 2) ? (new_pos -= NumGet(rect, 12, "Int") - SCROLL_STEP) : (action = 3) ? (new_pos += NumGet(rect, 12, "Int") - SCROLL_STEP)
   : (action = 5 || action = 4) ? (new_pos := wParam>>16) : (action = 6) ? (new_pos := NumGet(si, 8, "Int"))
   : (action = 7) ? (new_pos := NumGet(si, 12, "Int"))
   min := NumGet(si, 8, "Int") , max := NumGet(si, 12, "Int") - NumGet(si, 16, "UInt")
   new_pos := new_pos > max ? max : new_pos , new_pos := new_pos < min ? min : new_pos
   old_pos := NumGet(si, 20, "Int") , y := old_pos-new_pos ,DllCall("ScrollWindow", Ptr, hwnd, Int, 0, Int, y, UInt, 0, UInt, 0)
   NumPut(new_pos, si, 20, "Int") , DllCall("SetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si, Int, 1)
}

Вот добавил скролл. Сейчас 100 штук там.

36

Re: AHK: Изменение текста с помощью GUI

yalanne пишет:

Вот добавил скролл. Сейчас 100 штук там.

Скрол это хорошо, но 8 гигов оперы нужно чтобы скролить. У меня эксплорер отключился ну и ноутбук перезагрузил

37

Re: AHK: Изменение текста с помощью GUI

yalanne, помогите пожалуйсто решить проблему с EROR.

38 (изменено: yalanne, 2015-07-15 03:02:04)

Re: AHK: Изменение текста с помощью GUI

if FileExist("text.txt")
    file := FileOpen("text.txt","r")
Gui add,Edit ,vEndText w600 h600
Gui show
GuiControl,,EndText,% file.Read()

И создать текстовой файл text и туда запихать тот текст, должно открыться.

p.s Я конечно не очень шарю в html коде) но разве не надо сразу же в место '!!' подставлять код под html? То выглядит не очень:
http://i.imgur.com/K0MvFcU.png

39 (изменено: niceice, 2015-07-15 03:12:17)

Re: AHK: Изменение текста с помощью GUI

yalanne пишет:
if FileExist("text.txt")
    file := FileOpen("text.txt","r")
Gui add,Edit ,vEndText w600 h600
Gui show
GuiControl,,EndText,% file.Read()

И создать текстовой файл text и туда запихать тот текст, должно открыться.

p.s Я конечно не очень шарю в html коде) но разве не надо сразу же в место '!!' подставлять код под html? То выглядит не очень:
http://i.imgur.com/K0MvFcU.png

+ утераная часть кода

block=
(
<tr>
<td>
<a href="%image_1%" target="_blank"><img alt="" src="%image_1%" style="width: 311px; height: 400px;" /></a>
<p>
&nbsp;</p>
<p>
%name_1%</p>
</td>
<td>
<a href="%image_2%" target="_blank"><img alt="" src="%image_2%" style="width: 311px; height: 400px;" /></a>
<p>
&nbsp;</p>
<p>
%name_2%</p>
</td>
<td>
<a href="%image_3%" target="_blank"><img alt="" src="%image_3%" style="width: 311px; height: 400px;" /></a>
<p>
&nbsp;</p>
<p>
%name_3%</p>
</td>
</tr>
)

blocks.=block "`n"

}

Ваш код просто вставить в GUI ? И в какую часть?

40 (изменено: niceice, 2015-07-15 03:48:33)

Re: AHK: Изменение текста с помощью GUI

Нашел что EROR появляется только тогда когда в тексте присутствуют эти слова:
.med {
width: 100% !important;    ИМЕННО НА 100% ПОЧЕМУТО
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 40px !important;
}

.small {
width: 100% !important;    ИМЕННО НА 100% ПОЧЕМУТО
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}

Не знаю почему но скрипт их считает кодом.

41 (изменено: Alectric, 2015-07-15 07:39:31)

Re: AHK: Изменение текста с помощью GUI

Скорей всего нужно экранировать метасимволы с помощью "`" (без кавычек).
Непомню как статья называется про:

var=
(
text (`%`)
)
msgbox,% var

...

Вспомнил! Вот почитай: Разбивка длинных строк на ряд более коротких Способ №2.

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

42

Re: AHK: Изменение текста с помощью GUI

Alectric, Насчет list-box'a что там не понятного то?

niceice, Хм ну да оперативку кушает при скроле но не  на 8. У меня в разы меньше - где то 1гб кушает.

if FileExist("text.txt").....

Это отдельный скрипт, просто как пример использования.

А еще не проще работать с html редактором? Думаю легче будет вставить картинки на страницу.

43 (изменено: serzh82saratov, 2015-07-15 12:02:05)

Re: AHK: Изменение текста с помощью GUI

А этот кушает оперативку?


#SingleInstance Force      

Global GuiHeight := 536, Blocks := 0, hGBs := []
ScrollHeight := 0

Gui, +hwndhMain -DPIScale 
Gui, Margin, 5, 5
Gui, Color, D5DCEE
Gui, Add, Tab, w1030 h610 +0x400 HWNDhTab gTab vTab, WORK|END  
SendMessage, 0x1329, 0, 500 | 30 << 16, ,ahk_id %hTab%        ;  TCM_SETITEMSIZE  
Gui, Tab, END
Gui, Add, Edit, w1010 h570 vEndText
Gui, Tab, WORK
Gui, Back: +Parent%hTab% -Caption +hwndhBack -DPIScale  
Gui, Back: Add, Edit, w570 h20 hwndhMainImage 
SendMessage, 0x1501, 0, "main image",, ahk_id %hMainImage%  ;  EM_SETCUEBANNER  
Gui, Back: Color, D5DCEE
Gui, Back: Add, Button, x998 y140 w30 h100 gAdd, A`nD`nD
Gui, Back: Add, Button, xp y+100 wp hp gDel, D`nE`nL
Gui, WORK: Color, D5DCEE
Gui, WORK: +0x115 +Parent%hBack% -Caption +Border +hwndhWORK -DPIScale 

Gui, Back: Show, x0 y34 w1030 h578
Gui, WORK: Show, x0 y34 w990 h534
Gui, Show 
OnMessage(0x115, "WM_VSCROLL")   
GoSub Add
GuiControl, Focus, Tab 
Return 

Esc:: ExitApp 

Tab:
    Guicontrolget, Tab
    Gui, % "Back: " (Tab = "WORK" ? "Show" : "Hide")  
    If Tab = END
        GoSub Submit
    Return
    
Submit: 
    Loop % Blocks   {
        Block := A_Index
        Loop 6  {
            Type := A_Index > 3 ? "Name" : "Image"
            i := A_Index > 3 ? A_Index - 3 : A_Index 
            ControlGetText, Text , , % "ahk_id" hEdit_%Block%_%Type%_%i% 
            %Block%_%Type%_%i% := Text
        }
    }
    Listvars 
    Return 
    
Add:
    ControlGetPos,, PosY,,,, % "ahk_id " hGBs[Blocks++]
    Y := PosY = "" ? 10 : PosY - 104 + 100 
    Gui, WORK:Add, GroupBox, x10 y%Y% w950 h90 Section hwndhGroupBox%Blocks%, obl %Blocks%
    Loop 6
    {
        i := A_Index, hwnd :="hEdit_" Blocks "_" (i > 3 ? "Name_" : "Image_") (i2 := A_Index > 3 ? A_Index - 3 : A_Index)
        Gui, WORK:Add, Edit, % (i = 1 ? "xs+20 ys+20" : i = 4 ? "xs+20 y+20" : "x+20 yp") " w290 h20 hwnd" hwnd  
        SendMessage, 0x1501, 0, "" Blocks " " (i > 3 ? "Name" : "Image") " " i "",, % "ahk_id" %hwnd%
    }
    ScrollHeight := Blocks*100+10  
    hGBs[Blocks] := hGroupBox%Blocks%
    UpdateScrollBar(hWORK, ScrollHeight) 
    SetScrollPos(hWORK, ScrollHeight)
    return

Del: 
    If !Blocks
        return
    DllCall("DestroyWindow", "Ptr", hGBs[Blocks])
    Loop 6
        hwnd := "hEdit_" Blocks "_"(A_Index > 3 ? "Name_" : "Image_") (A_Index > 3 ? A_Index - 3 : A_Index), DllCall("DestroyWindow", "Ptr", %hwnd%)  
    hGBs.RemoveAt(Blocks--)
    ScrollHeight := Blocks*100+10  
    UpdateScrollBar(hWORK, ScrollHeight)
    SetScrollPos(hWORK, ScrollHeight)
    return  
    
UpdateScrollBar(hGui, ScrollHeight)
{
    static SIF_RANGE := 0x1, SIF_PAGE := 0x2, SB_VERT := 1  
    VarSetCapacity(si, 28, 0)
    NumPut(28, si) ; cbSize
    NumPut(SIF_RANGE | SIF_PAGE, si, 4)
    NumPut(ScrollHeight, si, 12) ; nMax
    NumPut(GuiHeight, si, 16) ; nPage
    DllCall("SetScrollInfo", Ptr, hGui, UInt, SB_VERT, Ptr, &si, Int, 1)   
    
    ControlGetPos,, Top,,,, % "ahk_id " hGBs[1]
    if (Top = 114)
        Return
    Top -= 114
      
    ControlGetPos,, y,, h,, % "ahk_id " hGBs[Blocks] 
    bottom := y + h - 64 
    if (top < 0 && bottom < GuiHeight)
    {
        y := (a := Abs(top)) > (b := GuiHeight-bottom) ? b : a  
        DllCall("ScrollWindow", Ptr, hGui, Int, 0, Int, y, Ptr, 0, Ptr, 0)
    }
}  
    
WM_VSCROLL(wParam, lParam, msg, hwnd)
{
    static SIF_ALL:=0x17, SCROLL_STEP:=10
    bar := msg=0x115 ; SB_HORZ=0, SB_VERT=1
    
    VarSetCapacity(si, 28, 0)
    NumPut(28, si, "UInt") ; cbSize
    NumPut(SIF_ALL, si, 4, "UInt") ; fMask
    if !DllCall("GetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si)
        return
    
    VarSetCapacity(rect, 16)
    DllCall("GetClientRect", Ptr, hwnd, Ptr, &rect) 
    new_pos := NumGet(si, 20, "UInt") ; nPos 
    action := wParam & 0xFFFF 

    if action = 0 ; SB_LINEUP
        new_pos -= SCROLL_STEP
    else if action = 1 ; SB_LINEDOWN
        new_pos += SCROLL_STEP
    else if action = 2 ; SB_PAGEUP
        new_pos -= NumGet(rect, 12, "Int") - SCROLL_STEP
    else if action = 3 ; SB_PAGEDOWN
        new_pos += NumGet(rect, 12, "Int") - SCROLL_STEP
    else if (action = 5 || action = 4) ; SB_THUMBTRACK || SB_THUMBPOSITION
        new_pos := wParam>>16
    else if action = 6 ; SB_TOP
        new_pos := NumGet(si, 8, "Int") ; nMin
    else if action = 7 ; SB_BOTTOM
        new_pos := NumGet(si, 12, "Int") ; nMax
    else
        return
    min := NumGet(si, 8, "Int") ; nMin
    max := NumGet(si, 12, "Int") - NumGet(si, 16, "UInt") ; nMax-nPage
    new_pos := new_pos > max ? max : new_pos
    new_pos := new_pos < min ? min : new_pos
    
    old_pos := NumGet(si, 20, "Int") ; nPos
    
    y := old_pos-new_pos
    ; Scroll contents of window and invalidate uncovered area.
    
    DllCall("ScrollWindow", Ptr, hwnd, Int, 0, Int, y, UInt, 0, UInt, 0)
    
    ; Update scroll bar.
    NumPut(new_pos, si, 20, "Int") ; nPos
        
    DllCall("SetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si, Int, 1) 
}

SetScrollPos(hwnd, nPos)  {  
    SendMessage, 0x115, 4 | ((nPos & 0xFFFF)<<16),,, ahk_id %hwnd%
}
По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui

44 (изменено: Alectric, 2015-07-15 12:11:54)

Re: AHK: Изменение текста с помощью GUI

yalanne, да все понятно, просто я лентяй.

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

45

Re: AHK: Изменение текста с помощью GUI

serzh82saratov пишет:

А этот кушает оперативку?

Нет, не кушает. Идеально выглядит, но скроллинг нужно "вручную" делать в вкладке WORK крутить скролом не работает, в вкладке END нужно также вручную выделать текст CNTRL+A не работает. А как текст заменить там ?

46

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:

Вспомнил! Вот почитай: Разбивка длинных строк на ряд более коротких Способ №2.

Прочитал, заменил, не работает

47

Re: AHK: Изменение текста с помощью GUI

yalanne пишет:

Это отдельный скрипт, просто как пример использования.

А еще не проще работать с html редактором? Думаю легче будет вставить картинки на страницу.

А как его использовать?

Нет не проще работать, в html нужно закодировать мой код, писать скрипт на роскодировку моего кода, а потом уже редактирование, потому что он просто так считает что мой планшет текста-КОД и не хочет работать.

48

Re: AHK: Изменение текста с помощью GUI

Так, как мне решить проблему с EROR?  Я просто уже растерянный.

49 (изменено: Alectric, 2015-07-15 16:29:36)

Re: AHK: Изменение текста с помощью GUI

Что-то ты не то заменял...

work=1
Gui, Add, Tab, x3 y6 w1030 h610 , 1|2|3|4|5|6|7|8|9|10|end
Gui, Add, GroupBox, x13 y70 w1010 h520 , main obl
Gui, Add, Button, x983 y116 w30 h100 gAdd, +
Gui, Tab, end
Gui, Add, Edit, x13 y36 w1010 h570 vEndText gsubmit, ПЛАНШЕТ ТЕКСТА
Gui, Tab, 1
Gui, Add, Edit, x13 y46 w570 h20 vmain_image gsubmit, main image
Gui, Show, x129 y84 h629 w1044, New GUI Window
Return
GuiClose:
ExitApp


submit:
gui,submit,nohide

blocks=
loop,% blockNum
{

  image_1:=image%a_index%_1
  name_1:=name%a_index%_1
  image_2:=image%a_index%_2
  name_2:=name%a_index%_2
  image_3:=image%a_index%_3
  name_3:=name%a_index%_3

block=
(
obl %a_index% (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_1% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_1%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_2%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   %image_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %image_3%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %image_3% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %name_3%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl %a_index% (конец)

)

  blocks.=block
}

EndText=
(
<p>
    <style type="text/css">
.all p {
font-family:trebuchet ms,helvetica,sans-serif !important;
color: #444 !important;
font-size: 16px;
}
.hr {
border: 0px !important;
height: 2px !important;
background-color: #888 !important;
}
.big {
object-fit: contain !important;
width: 500px !important;
height: 500px !important;
overflow:hidden !important;
display: block !important;
margin-left: 190px !important;
margin-right: 190px !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
.strong {
color: rgb(0,0,0) !important;
font-size: 18px !important;
}
.alt {
font-style: oblique !important;
text-align: right !important;
font-size: 18px !important;
font-family: 'Times New Roman' !important;
}
.pri {
color: rgb(0,0,0) !important;
font-size: 36px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 10px !important;
margin-top: 40px !important;
}
.sec {
font-size: 28px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 6px !important;
margin-top: 40px !important;
}
.all a {
color: blue !important;
text-decoration: underline !important;
}
.order {
color: #f11 !important;
font-size: 24px !important;
font-family:trebuchet ms,helvetica,sans-serif !important;
text-decoration: underline !important;
text-transform: uppercase !important;
text-align: center !important;
margin: 30px !important;
}
.order a {
color: red !important;
}
.all table tbody tr td {
vertical-align: top !important;
}
.med {
width: 100`% !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 40px !important;
}
.med img {
object-fit: contain !important;
width: 250px !important;
height: 250px !important;
overflow:hidden !important;
display: block !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 0px !important;
margin-top: 14px !important;
vertical-align: top !important;
}
.med p {
text-align: center !important;
font-size:18px !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 14px !important;
margin-top: 7px !important;
width: 250px !important;
}
.small {
width: 100`% !important;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}
.small img {
object-fit: contain;
width: 195px !important;
height: 195px !important;
overflow:hidden;
display: block;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 0px;
margin-top: 15px;
vertical-align: top;
border-width: 0px;
border-style: solid;
border-color: black;
}
.small p {
text-align: center !important;
font-size:16px !important;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 10px;
margin-top: 5px;
width: 195px;
font-family:trebuchet ms,helvetica,sans-serif;
color: #444;
}    </style>
</p>
<div class="all">
    <p>
        &nbsp;</p>
</div>
<p>
    &nbsp;</p>
<p>
        <a href="http://postach.com.ua/image/data/_pro/Zeus/robur.jpg" target="_blank"><img alt="" class="big" src="http://postach.com.ua/image/data/_pro/Zeus/robur.jpg" /></a></p>
    <h1 class="order">
        <a href="http://postach.com.ua/information/contact" target="_blank">Заказ +380673136554</a></h1>
    <table border="0" cellpadding="1" cellspacing="1" class="med" style="width: 500px;">
        <tbody>
  ; /////////////////////////////////////////////////////БЛОКИ//////////////////////////////////////////////
%blocks%
</tbody>
    </table>
</div>
<p>
    &nbsp;</p>
)

GuiControl,,EndText,%EndText%
return



Add:
Num++
if num>5
{
  work++
  Num=1
}
blockNum++
tooltip,Блоков - %blockNum%`nСтраниц - %work%
Gui, Tab, %work%
Gui, Add, GroupBox, x23 y+20 w950 h100 , obl %blockNum%
Gui, Add, Edit, xm+30 yp+30 w290 h20 vimage%blockNum%_1 gsubmit, %blockNum%image 1
Gui, Add, Edit, x+20 yp w290 h20 vimage%blockNum%_2 gsubmit, %blockNum%image 2
Gui, Add, Edit, x+20 yp w290 h20 vimage%blockNum%_3 gsubmit, %blockNum%image 3
Gui, Add, Edit, xm+30 y+5 w290 h20 vname%blockNum%_1 gsubmit, %blockNum%name 1
Gui, Add, Edit, x+20 yp w290 h20 vname%blockNum%_2 gsubmit, %blockNum%name 2
Gui, Add, Edit, x+20 yp w290 h20 vname%blockNum%_3 gsubmit, %blockNum%name 3

gosub,submit
return

Всего в 2-х местах заменил "%" на "`%".

OFF: Работаю до 5-и так что не мог раньше написать код, с телефона это не удобно.

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

50

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:

Что-то ты не то заменял...

Ну, а я просто весь код в " ' " поставил. Спасибо!:)

51 (изменено: Alectric, 2015-07-15 16:54:46)

Re: AHK: Изменение текста с помощью GUI

niceice пишет:

" ' "

Нужно было не ' а ` это разные символы, моя вина, нужно было сразу сказать что ` это ё только на англ. раскладке.

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

52 (изменено: serzh82saratov, 2015-07-15 19:15:04)

Re: AHK: Изменение текста с помощью GUI

скроллинг нужно "вручную" делать в вкладке WORK крутить скролом не работает

Чтто значит вручную? Что значит крутить скролом не работает?

в вкладке END нужно также вручную выделать текст CNTRL+A не работает

Та к непонятно в какие места хтмл кода надо вставлять, с !!!! всё ясно, а тут куда и что?

По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui

53 (изменено: Alectric, 2015-07-15 17:53:43)

Re: AHK: Изменение текста с помощью GUI

serzh82saratov пишет:

а тут как?

Там переменная в конце:

%blocks%  ; /////////////////////////////////////////////БЛОКИ////////////////////////////////

Остальное ТС сам расскажет.

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

54 (изменено: serzh82saratov, 2015-07-15 19:14:26)

Re: AHK: Изменение текста с помощью GUI

Чтто значит вручную? Что значит крутить скролом не работает?

Если разговор про перемотку кнопками, то добавил:

+ открыть спойлер
#SingleInstance Force     
#NoEnv 
 
Global GuiHeight := 536, Blocks := 0, hGBs := [], SB_LINEUP := 0, SB_LINEDOWN := 1
    , SB_PageUp := 2, SB_PageDown := 3, SB_Bottom := 7, WM_VSCROLL := 0x115 
ScrollHeight := 0
 
Gui, +hwndhMain -DPIScale 
Gui, Margin, 5, 5
Gui, Color, D5DCEE
Gui, Add, Tab, w1030 h610 +0x400 HWNDhTab gTab vTab, WORK|END  
SendMessage, 0x1329, 0, 500 | 30 << 16, ,ahk_id %hTab%        ;  TCM_SETITEMSIZE  
Gui, Tab, END
Gui, Add, Edit, w1010 h570 vEndText
Gui, Tab, WORK
Gui, Back: +Parent%hTab% -Caption +hwndhBack -DPIScale  
Gui, Back: Add, Edit, w570 h20 hwndhMainImage 
SendMessage, 0x1501, 0, "main image",, ahk_id %hMainImage%  ;  EM_SETCUEBANNER  
Gui, Back: Color, D5DCEE
Gui, Back: Add, Button, x998 y140 w30 h100 gAdd, A`nD`nD
Gui, Back: Add, Button, xp y+100 wp hp gDel, D`nE`nL
Gui, WORK: Color, D5DCEE
Gui, WORK: +Parent%hBack% -Caption +Border +hwndhWORK -DPIScale  

Gui, Back: Show, x0 y34 w1030 h578
Gui, WORK: Show, x0 y34 w990 h534
Gui, Show 
OnMessage(0x115, "WM_VSCROLL")   
OnMessage(0x20A, Func("WM_MOUSEWHEEL").Bind(hWORK))
GoSub Add
Guicontrolget, Tab
GuiControl, Focus, Tab 
Return 
 
#If WinActive("ahk_id " hMain) && Tab = "WORK"
~Up::
~Down::  
PgUp::
PgDn:: VSCROLL_To(hWORK, {"~Up":SB_LINEUP,"~Down":SB_LINEDOWN,"PgUp":SB_PageUp,"PgDn":SB_PageDown}[A_ThisHotkey]) 
#If  

Esc:: ExitApp 

Tab:
    Guicontrolget, Tab
    Gui, % "Back: " (Tab = "WORK" ? "Show" : "Hide")  
    If Tab = END
        GoSub Submit
    Return
    
Submit: 
    Loop % Blocks   {
        Block := A_Index
        Loop 6  {
            Type := A_Index > 3 ? "Name" : "Image"
            i := A_Index > 3 ? A_Index - 3 : A_Index 
            ControlGetText, Text , , % "ahk_id" hEdit_%Block%_%Type%_%i% 
            %Block%_%Type%_%i% := Text
        }
    }
    Listvars 
    Return 
    
Add:
    ControlGetPos,, PosY,,,, % "ahk_id " hGBs[Blocks++]
    Y := PosY = "" ? 10 : PosY - 104 + 100 
    Gui, WORK:Add, GroupBox, x10 y%Y% w950 h90 Section hwndhGroupBox%Blocks%, obl %Blocks%
    Loop 6
    {
        i1 := Ceil(A_Index/2), i2 := Mod(A_Index-1,2)+1, Type := ["Image","Name"][i2], hwnd :="hEdit_" Blocks "_" Type "_" i1
        Gui, WORK:Add, Edit, % (A_Index = 1 ? "xs+20 ys+20" : ["x+20 ys+20","xp y+20"][i2]) " w290 h20 hwnd" hwnd   
        SendMessage, 0x1501, 0, "" Blocks " " Type " " i1 "",, % "ahk_id" %hwnd%  
    }
    ScrollHeight := Blocks*100+10+18
    hGBs[Blocks] := hGroupBox%Blocks%
    UpdateScrollBar(hWORK, ScrollHeight) 
    VSCROLL_To(hWORK, SB_Bottom) 
    return
    
Del: 
    If !Blocks
        return
    DllCall("DestroyWindow", "Ptr", hGBs[Blocks])
    Loop 6
        hwnd := "hEdit_" Blocks "_"(A_Index > 3 ? "Name_" : "Image_") (A_Index > 3 ? A_Index - 3 : A_Index), DllCall("DestroyWindow", "Ptr", %hwnd%)  
    hGBs.RemoveAt(Blocks--)
    ScrollHeight := Blocks*100+10+4
    UpdateScrollBar(hWORK, ScrollHeight) 
    VSCROLL_To(hWORK, SB_Bottom) 
    return  
    
UpdateScrollBar(hGui, ScrollHeight)
{
    static SIF_RANGE := 0x1, SIF_PAGE := 0x2, SB_VERT := 1  
    VarSetCapacity(si, 28, 0)
    NumPut(28, si) ; cbSize
    NumPut(SIF_RANGE | SIF_PAGE, si, 4)
    NumPut(ScrollHeight, si, 12) ; nMax
    NumPut(GuiHeight, si, 16) ; nPage
    DllCall("SetScrollInfo", Ptr, hGui, UInt, SB_VERT, Ptr, &si, Int, 1)   
    
    ControlGetPos,, Top,,,, % "ahk_id " hGBs[1]
    if (Top = 114)
        Return
    Top -= 114
      
    ControlGetPos,, y,, h,, % "ahk_id " hGBs[Blocks] 
    bottom := y + h - 74 
    if (top < 0 && bottom < GuiHeight)
    {
        y := (a := Abs(top)) > (b := GuiHeight-bottom) ? b : a  
        DllCall("ScrollWindow", Ptr, hGui, Int, 0, Int, y, Ptr, 0, Ptr, 0)
    }
}  
    
WM_VSCROLL(wParam, lParam, msg, hwnd)
{
    static SIF_ALL:=0x17, SCROLL_STEP:=10
    bar := msg=0x115 ; SB_HORZ=0, SB_VERT=1
    
    VarSetCapacity(si, 28, 0)
    NumPut(28, si, "UInt") ; cbSize
    NumPut(SIF_ALL, si, 4, "UInt") ; fMask
    if !DllCall("GetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si)
        return
    
    VarSetCapacity(rect, 16)
    DllCall("GetClientRect", Ptr, hwnd, Ptr, &rect) 
    new_pos := NumGet(si, 20, "UInt") ; nPos 
    action := wParam & 0xFFFF 
    
    if action = 0 ; SB_LINEUP
        new_pos -= SCROLL_STEP
    else if action = 1 ; SB_LINEDOWN
        new_pos += SCROLL_STEP
    else if action = 2 ; SB_PAGEUP
        new_pos -= NumGet(rect, 12, "Int") - SCROLL_STEP
    else if action = 3 ; SB_PAGEDOWN
        new_pos += NumGet(rect, 12, "Int") - SCROLL_STEP
    else if (action = 5 || action = 4) ; SB_THUMBTRACK || SB_THUMBPOSITION
        new_pos := wParam>>16
    else if action = 6 ; SB_TOP
        new_pos := NumGet(si, 8, "Int") ; nMin
    else if action = 7 ; SB_BOTTOM
        new_pos := NumGet(si, 12, "Int") ; nMax
    else
        return
    min := NumGet(si, 8, "Int") ; nMin
    max := NumGet(si, 12, "Int") - NumGet(si, 16, "UInt") ; nMax-nPage
    new_pos := new_pos > max ? max : new_pos
    new_pos := new_pos < min ? min : new_pos
    
    old_pos := NumGet(si, 20, "Int") ; nPos
    
    y := old_pos-new_pos
    ; Scroll contents of window and invalidate uncovered area.
    
    DllCall("ScrollWindow", Ptr, hwnd, Int, 0, Int, y, UInt, 0, UInt, 0)
    
    ; Update scroll bar.
    NumPut(new_pos, si, 20, "Int") ; nPos
        
    DllCall("SetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si, Int, 1) 
}

VSCROLL_To(hwnd, msg){
    WM_VSCROLL(msg, 0, WM_VSCROLL, hWnd) 
}

WM_MOUSEWHEEL(hWnd, wp)
{
   Loop 4
      WM_VSCROLL(wp>>16 & 0xFFFF < 0x7FFF ? SB_LINEUP : SB_LINEDOWN, 0, WM_VSCROLL, hWnd) 
}

Остальное ТС сам расскажет.

Не знаю не знаю, там какая-то тайна.

По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui

55 (изменено: Alectric, 2015-07-15 19:46:27)

Re: AHK: Изменение текста с помощью GUI

Про скрол: он имел ввиду, что при вращении ролика мыши - скрола не происходит, у меня кстати тоже.

Не знаю не знаю, там какая-то тайна.

Просто выражать свои мысли так чтобы абсолютно все поняли - нелегкая задача... для начинающих программистов... наверное.

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

56

Re: AHK: Изменение текста с помощью GUI

при вращении ролика мыши - скрола не происходит, у меня кстати тоже.

Из 54 поста не происходит?

По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui

57

Re: AHK: Изменение текста с помощью GUI

Стрелками вверх\вниз - работает, роликом - нет.

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

58

Re: AHK: Изменение текста с помощью GUI

Не знаю, у меня работает.

По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui

59 (изменено: Alectric, 2015-07-15 20:46:32)

Re: AHK: Изменение текста с помощью GUI

Может у тебя какой-нибудь скрипт "помагает" скролить? Или запущен только этот и никаких других?

...

Да все работает, дело в версии AHK.

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

60 (изменено: yalanne, 2015-07-15 20:46:25)

Re: AHK: Изменение текста с помощью GUI

serzh82saratov пишет:

Не знаю, у меня работает.

У меня на 10ой винде работает колесиком, а на 7й нет.

61

Re: AHK: Изменение текста с помощью GUI

yalanne пишет:

У меня на 10ой винде работает колесиком, а на 7й нет.

У вас 10ка? Как она? Все программы работают? Обновление висит, а устанавливать незнаю стоит ли?

Alectric, качал с оф сайта неделю назад.

serzh82saratov,  там везде html код. Вместо !!!!! должен быть "ПЛАНШЕТ ТЕКСТА"

+ планшет

<p>
    <style type="text/css">
.all p {
font-family:trebuchet ms,helvetica,sans-serif !important;
color: #444 !important;
font-size: 16px;
}
.hr {
border: 0px !important;
height: 2px !important;
background-color: #888 !important;
}
.big {
object-fit: contain !important;
width: 500px !important;
height: 500px !important;
overflow:hidden !important;
display: block !important;
margin-left: 190px !important;
margin-right: 190px !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
.strong {
color: rgb(0,0,0) !important;
font-size: 18px !important;
}
.alt {
font-style: oblique !important;
text-align: right !important;
font-size: 18px !important;
font-family: 'Times New Roman' !important;
}
.pri {
color: rgb(0,0,0) !important;
font-size: 36px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 10px !important;
margin-top: 40px !important;
}
.sec {
font-size: 28px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 6px !important;
margin-top: 40px !important;
}
.all a {
color: blue !important;
text-decoration: underline !important;
}
.order {
color: #f11 !important;
font-size: 24px !important;
font-family:trebuchet ms,helvetica,sans-serif !important;
text-decoration: underline !important;
text-transform: uppercase !important;
text-align: center !important;
margin: 30px !important;
}
.order a {
color: red !important;
}
.all table tbody tr td {
vertical-align: top !important;
}
.med {
width: 100`% !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 40px !important;
}
.med img {
object-fit: contain !important;
width: 250px !important;
height: 250px !important;
overflow:hidden !important;
display: block !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 0px !important;
margin-top: 14px !important;
vertical-align: top !important;
}
.med p {
text-align: center !important;
font-size:18px !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 14px !important;
margin-top: 7px !important;
width: 250px !important;
}
.small {
width: 100`% !important;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}
.small img {
object-fit: contain;
width: 195px !important;
height: 195px !important;
overflow:hidden;
display: block;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 0px;
margin-top: 15px;
vertical-align: top;
border-width: 0px;
border-style: solid;
border-color: black;
}
.small p {
text-align: center !important;
font-size:16px !important;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 10px;
margin-top: 5px;
width: 195px;
font-family:trebuchet ms,helvetica,sans-serif;
color: #444;
}    </style>
</p>
<div class="all">
    <p>
        &nbsp;</p>
</div>
<p>
    &nbsp;</p>
<p>
        <a href="%main_image%" target="_blank"><img alt="" class="big" src="%main_image%" /></a></p>
    <h1 class="order">
        <a href="http://postach.com.ua/information/contact" target="_blank">Заказ +380673136554</a></h1>
    <table border="0" cellpadding="1" cellspacing="1" class="med" style="width: 500px;">
        <tbody>
%blocks%
</tbody>
    </table>
</div>
<p>
    &nbsp;</p>
)

А вот блоки:

+ блоки

<tr>
<td>
<a href="%image_1%" target="_blank"><img alt="" src="%image_1%" style="width: 311px; height: 400px;" /></a>
<p>
&nbsp;</p>
<p>
%name_1%</p>
</td>
<td>
<a href="%image_2%" target="_blank"><img alt="" src="%image_2%" style="width: 311px; height: 400px;" /></a>
<p>
&nbsp;</p>
<p>
%name_2%</p>
</td>
<td>
<a href="%image_3%" target="_blank"><img alt="" src="%image_3%" style="width: 311px; height: 400px;" /></a>
<p>
&nbsp;</p>
<p>
%name_3%</p>
</td>
</tr>

62 (изменено: yalanne, 2015-07-16 00:06:14)

Re: AHK: Изменение текста с помощью GUI

HideGenius пишет:

У вас 10ка? Как она? Все программы работают? Обновление висит, а устанавливать незнаю стоит ли

Вполне годная. Везде новые иконки в hd; Пуск смесь метро и стандартного; directx12; Новый браузер стандартный "Спартан", Можно Неактивные окна скролить наведя на него курсор.

А программы вроде все работают, вот только на момент релиза гта5 она на этой ос не запускалась, а после обновы норм.
Так как микросфты купили моджанг они хотят на 10ку спец версию minecraft выпустить 29 июля.  По описанию там вроде как добавят сюжет).

Да и скоро официально win10 выведут на рынок. Сейчас она на бета тестировании.

63 (изменено: serzh82saratov, 2017-08-21 22:11:00)

Re: AHK: Изменение текста с помощью GUI

serzh82saratov,  там везде html код. Вместо !!!!! должен быть "ПЛАНШЕТ ТЕКСТА"

Так?



#SingleInstance Force     
#NoEnv 
 
Global GuiHeight := 536, Blocks := 0, hGBs := [], SB_LINEUP := 0, SB_LINEDOWN := 1
    , SB_PageUp := 2, SB_PageDown := 3, SB_Bottom := 7, WM_VSCROLL := 0x115 
ScrollHeight := 0
 
Gui, +hwndhMain -DPIScale 
Gui, Margin, 5, 5
Gui, Color, D5DCEE
Gui, Add, Tab, w1030 h610 +0x400 HWNDhTab gTab vTab, WORK|END  
SendMessage, 0x1329, 0, 500 | 30 << 16, ,ahk_id %hTab%        ;  TCM_SETITEMSIZE  
Gui, Tab, END
Gui, Add, Edit, w1010 h570 vEndText
Gui, Tab, WORK
Gui, Back: +Parent%hTab% -Caption +hwndhBack -DPIScale  
Gui, Back: Add, Edit, w570 h20 hwndhMainImage vmain_image
SendMessage, 0x1501, 0, "main image",, ahk_id %hMainImage%  ;  EM_SETCUEBANNER  
Gui, Back: Color, D5DCEE
Gui, Back: Add, Button, x998 y140 w30 h100 gAdd, A`nD`nD
Gui, Back: Add, Button, xp y+100 wp hp gDel, D`nE`nL
Gui, WORK: Color, D5DCEE
Gui, WORK: +Parent%hBack% -Caption +Border +hwndhWORK -DPIScale  

Gui, Back: Show, x0 y34 w1030 h578
Gui, WORK: Show, x0 y34 w990 h534
Gui, Show 
OnMessage(0x115, "WM_VSCROLL")   
OnMessage(0x20A, Func("WM_MOUSEWHEEL").Bind(hWORK))
GoSub Add 
Guicontrolget, Tab
GuiControl, Focus, Tab 
Return 
 
#If WinActive("ahk_id " hMain) && Tab = "WORK"
~Up::
~Down::  
PgUp::
PgDn:: VSCROLL_To(hWORK, {"~Up":SB_LINEUP,"~Down":SB_LINEDOWN,"PgUp":SB_PageUp,"PgDn":SB_PageDown}[A_ThisHotkey]) 
#If  

Esc:: ExitApp 

Tab:
    Guicontrolget, Tab
    Gui, % "Back: " (Tab = "WORK" ? "Show" : "Hide")  
    If Tab = END
        GoSub Submit
    Return

Submit: 
    allhtml2 =
    Loop % Blocks   {
        Block := A_Index
        Loop 6  {
            Type := A_Index > 3 ? "Name" : "Image"
            i := A_Index > 3 ? A_Index - 3 : A_Index 
            ControlGetText, Text , , % "ahk_id" hEdit_%Block%_%Type%_%i% 
            %Type%_%i% := Text
        } 
        GoSub inithtml2
        allhtml2 .= html2 "`n"  
        
    } 
    Guicontrolget, main_image, Back: 
    GoSub inithtml1  
    GuiControl, , EndText, %html1%
    Return  
    
Add:
	ControlGetPos,, PosY,,,, % "ahk_id " hGBs[Blocks++]
	Y := PosY = "" ? 10 : PosY - 104 + 100 
	Gui, WORK:Add, GroupBox, x10 y%Y% w950 h90 Section hwndhGroupBox%Blocks%, obl %Blocks%
	Loop 6
	{
		i1 := Ceil(A_Index/2), i2 := Mod(A_Index-1,2)+1, Type := ["Image","Name"][i2], hwnd :="hEdit_" Blocks "_" Type "_" i1
		Gui, WORK:Add, Edit, % (A_Index = 1 ? "xs+20 ys+20" : ["x+20 ys+20","xp y+20"][i2]) " w290 h20 hwnd" hwnd   
		SendMessage, 0x1501, 0, "" Blocks " " Type " " i1 "",, % "ahk_id" %hwnd%
	}
	ScrollHeight := Blocks*95+34
	hGBs[Blocks] := hGroupBox%Blocks%
	UpdateScrollBar(hWORK, ScrollHeight) 
	VSCROLL_To(hWORK, SB_Bottom)
	return
	
Del: 
	If !Blocks
		return
	DllCall("DestroyWindow", "Ptr", hGBs[Blocks])
	Loop 6
		hwnd := "hEdit_" Blocks "_"(A_Index > 3 ? "Name_" : "Image_") (A_Index > 3 ? A_Index - 3 : A_Index), DllCall("DestroyWindow", "Ptr", %hwnd%)  
	hGBs.RemoveAt(Blocks--)
	ScrollHeight := Blocks*95+34
	UpdateScrollBar(hWORK, ScrollHeight) 
	VSCROLL_To(hWORK, SB_Bottom)
	return  
    
UpdateScrollBar(hGui, ScrollHeight)
{
    static SIF_RANGE := 0x1, SIF_PAGE := 0x2, SB_VERT := 1  
    VarSetCapacity(si, 28, 0)
    NumPut(28, si) ; cbSize
    NumPut(SIF_RANGE | SIF_PAGE, si, 4)
    NumPut(ScrollHeight, si, 12) ; nMax
    NumPut(GuiHeight, si, 16) ; nPage
    DllCall("SetScrollInfo", Ptr, hGui, UInt, SB_VERT, Ptr, &si, Int, 1)   
    
    ControlGetPos,, Top,,,, % "ahk_id " hGBs[1]
    if (Top = 114)
        Return
    Top -= 114
      
    ControlGetPos,, y,, h,, % "ahk_id " hGBs[Blocks] 
    bottom := y + h - 74 
    if (top < 0 && bottom < GuiHeight)
    {
        y := (a := Abs(top)) > (b := GuiHeight-bottom) ? b : a  
        DllCall("ScrollWindow", Ptr, hGui, Int, 0, Int, y, Ptr, 0, Ptr, 0)
    }
}  
    
WM_VSCROLL(wParam, lParam, msg, hwnd)
{
    static SIF_ALL:=0x17, SCROLL_STEP:=10
    bar := msg=0x115 ; SB_HORZ=0, SB_VERT=1
    
    VarSetCapacity(si, 28, 0)
    NumPut(28, si, "UInt") ; cbSize
    NumPut(SIF_ALL, si, 4, "UInt") ; fMask
    if !DllCall("GetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si)
        return
    
    VarSetCapacity(rect, 16)
    DllCall("GetClientRect", Ptr, hwnd, Ptr, &rect) 
    new_pos := NumGet(si, 20, "UInt") ; nPos 
    action := wParam & 0xFFFF 
    
    if action = 0 ; SB_LINEUP
        new_pos -= SCROLL_STEP
    else if action = 1 ; SB_LINEDOWN
        new_pos += SCROLL_STEP
    else if action = 2 ; SB_PAGEUP
        new_pos -= NumGet(rect, 12, "Int") - SCROLL_STEP
    else if action = 3 ; SB_PAGEDOWN
        new_pos += NumGet(rect, 12, "Int") - SCROLL_STEP
    else if (action = 5 || action = 4) ; SB_THUMBTRACK || SB_THUMBPOSITION
        new_pos := wParam>>16
    else if action = 6 ; SB_TOP
        new_pos := NumGet(si, 8, "Int") ; nMin
    else if action = 7 ; SB_BOTTOM
        new_pos := NumGet(si, 12, "Int") ; nMax
    else
        return
    min := NumGet(si, 8, "Int") ; nMin
    max := NumGet(si, 12, "Int") - NumGet(si, 16, "UInt") ; nMax-nPage
    new_pos := new_pos > max ? max : new_pos
    new_pos := new_pos < min ? min : new_pos
    
    old_pos := NumGet(si, 20, "Int") ; nPos
    
    y := old_pos-new_pos
    ; Scroll contents of window and invalidate uncovered area.
    
    DllCall("ScrollWindow", Ptr, hwnd, Int, 0, Int, y, UInt, 0, UInt, 0)
    
    ; Update scroll bar.
    NumPut(new_pos, si, 20, "Int") ; nPos
        
    DllCall("SetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si, Int, 1) 
}

VSCROLL_To(hwnd, msg){
    WM_VSCROLL(msg, 0, WM_VSCROLL, hWnd) 
}

WM_MOUSEWHEEL(hWnd, wp)
{
   Loop 4
      WM_VSCROLL(wp>>16 & 0xFFFF < 0x7FFF ? SB_LINEUP : SB_LINEDOWN, 0, WM_VSCROLL, hWnd) 
}

inithtml1:
html1 =
(
<p>
    <style type="text/css">
.all p {
font-family:trebuchet ms,helvetica,sans-serif !important;
color: #444 !important;
font-size: 16px;
}
.hr {
border: 0px !important;
height: 2px !important;
background-color: #888 !important;
}
.big {
object-fit: contain !important;
width: 500px !important;
height: 500px !important;
overflow:hidden !important;
display: block !important;
margin-left: 190px !important;
margin-right: 190px !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
.strong {
color: rgb(0,0,0) !important;
font-size: 18px !important;
}
.alt {
font-style: oblique !important;
text-align: right !important;
font-size: 18px !important;
font-family: 'Times New Roman' !important;
}
.pri {
color: rgb(0,0,0) !important;
font-size: 36px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 10px !important;
margin-top: 40px !important;
}
.sec {
font-size: 28px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 6px !important;
margin-top: 40px !important;
}
.all a {
color: blue !important;
text-decoration: underline !important;
}
.order {
color: #f11 !important;
font-size: 24px !important;
font-family:trebuchet ms,helvetica,sans-serif !important;
text-decoration: underline !important;
text-transform: uppercase !important;
text-align: center !important;
margin: 30px !important;
}
.order a {
color: red !important;
}
.all table tbody tr td {
vertical-align: top !important;
}
.med {
width: 100`% !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 40px !important;
}
.med img {
object-fit: contain !important;
width: 250px !important;
height: 250px !important;
overflow:hidden !important;
display: block !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 0px !important;
margin-top: 14px !important;
vertical-align: top !important;
}
.med p {
text-align: center !important;
font-size:18px !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 14px !important;
margin-top: 7px !important;
width: 250px !important;
}
.small {
width: 100`% !important;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}
.small img {
object-fit: contain;
width: 195px !important;
height: 195px !important;
overflow:hidden;
display: block;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 0px;
margin-top: 15px;
vertical-align: top;
border-width: 0px;
border-style: solid;
border-color: black;
}
.small p {
text-align: center !important;
font-size:16px !important;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 10px;
margin-top: 5px;
width: 195px;
font-family:trebuchet ms,helvetica,sans-serif;
color: #444;
}    </style>
</p>
<div class="all">
    <p>
        &nbsp;</p>
</div>
<p>
    &nbsp;</p>
<p>
        <a href="%main_image%" target="_blank"><img alt="" class="big" src="%main_image%" /></a></p>
    <h1 class="order">
        <a href="http://postach.com.ua/information/contact" target="_blank">Заказ +380673136554</a></h1>
    <table border="0" cellpadding="1" cellspacing="1" class="med" style="width: 500px;">
        <tbody>
%allhtml2%
</tbody>
    </table>
</div>
<p>
    &nbsp;</p>
)
Return

inithtml2:
html2 =
(
<tr>
                <td>
                    <a href="%image_1%" target="_blank"><img alt="" src="%image_1%" style="width: 311px; height: 400px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_1%</p>
                </td>
                <td>
                    <a href="%image_2%" target="_blank"><img alt="" src="%image_2%" style="width: 311px; height: 400px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_2%</p>
                </td>
                <td>
                    <a href="%image_3%" target="_blank"><img alt="" src="%image_3%" style="width: 311px; height: 400px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_3%</p>
                </td>
            </tr>
)
Return
По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui

64

Re: AHK: Изменение текста с помощью GUI

serzh82saratov пишет:

Так?

Да, все так! Идеально.
Но не подскажите как еще там в коде добавить пару строк ввода и кнопку ввода и привязать к "планшету" ?

65

Re: AHK: Изменение текста с помощью GUI

Как обычно, ничего не понял.

По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui

66

Re: AHK: Изменение текста с помощью GUI

serzh82saratov пишет:

Как обычно, ничего не понял.

Хотел бы я еще добавить в вкладку WORK пару строк ввода и кнопок и привязать их к тексту в вкладке END.
И как сделать что бы при нажатии на кнопку (которую создам) отсылался всегда одинаковый текст в текст в вкладке END?

67

Re: AHK: Изменение текста с помощью GUI

Слишком мало конкретики, для программирования...
Ну что же, отвечу в вашем стиле.

И как сделать что бы при нажатии на кнопку (которую создам) отсылался всегда одинаковый текст в текст в вкладке END?

Добавить кнопку, отсылать по ней текст. Всё очень просто.

По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui

68

Re: AHK: Изменение текста с помощью GUI

serzh82saratov пишет:

Слишком мало конкретики, для программирования...

Возле строки main image создать строку ввода NAME и привязать  к строке в вкладке END

 <a href="%main_image%" target="_blank">[b]"СТРОКА ВВОДА NAME"[/b]<img alt="" class="big" src="%main_image%" /></a></p>

Возле каждых двух строк ввода (в блоках) добавить две кнопки КНОПКА 1 и КНОПКА 2 и привязать их к тексту в вкладке END, и что бы каждая посылала текст 400 при нажатии в текст в вкладке END

<tr>
                <td>
                    <a href="%image_1%" target="_blank"><img alt="" src="%image_1%" style="width: [b]"КНОПКА 1"[/b]px; height: [b]"КНОПКА 2"[/b]px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_1%</p>
                </td>
                <td>
                    <a href="%image_2%" target="_blank"><img alt="" src="%image_2%" style="width: [b]"КНОПКА 1"[/b]px; height: [b]"КНОПКА 2"px[/b];" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_2%</p>
                </td>
                <td>
                    <a href="%image_3%" target="_blank"><img alt="" src="%image_3%" style="width: [b]"КНОПКА 1[/b]"px; height: [b]"КНОПКА 1"[/b]px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_3%</p>
                </td>
            </tr>

69

Re: AHK: Изменение текста с помощью GUI

Если честно, то взялся потому что не практиковал такой скролл.
Оставшиеся задачи уже просто не интересны. Думаю при большом желании сами разберётесь, код не большой.

По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui

70 (изменено: niceice, 2015-07-16 02:31:00)

Re: AHK: Изменение текста с помощью GUI

serzh82saratov пишет:

Если честно, то взялся потому что не практиковал такой скролл.
Оставшиеся задачи уже просто не интересны. Думаю при большом желании сами разберётесь, код не большой.

Код не большой но он мне не понятен. Мне легче переделать другой пример потому что он мне понятен. Но и на этом спасибо!
Но если поможете то покажите хоть по 1 примеру в коментарях.

71

Re: AHK: Изменение текста с помощью GUI

serzh82saratov, ваш вариант чудесный, но я до сих пор не могу разобраться как там что-то добавить.

72 (изменено: Alectric, 2015-07-17 16:03:46)

Re: AHK: Изменение текста с помощью GUI

Вот добавил, не кнопки правда, но думаю так наверное даже удобнее - можно любую цифру вписать, не только 400.
С переменными, думаю, уже сам разберешься что где.

Криво, косо, но работает:

#SingleInstance Force
#NoEnv

Global GuiHeight := 536, Blocks := 0, hGBs := [], SB_LINEUP := 0, SB_LINEDOWN := 1
    , SB_PageUp := 2, SB_PageDown := 3, SB_Bottom := 7, WM_VSCROLL := 0x115
ScrollHeight := 0

Gui, +hwndhMain -DPIScale
Gui, Margin, 5, 5
Gui, Color, D5DCEE
Gui, Add, Tab, w1030 h610 +0x400 HWNDhTab gTab vTab, WORK|END
SendMessage, 0x1329, 0, 500 | 30 << 16, ,ahk_id %hTab%        ;  TCM_SETITEMSIZE
Gui, Tab, END
Gui, Add, Edit, w1010 h570 vEndText
Gui, Tab, WORK
Gui, Back: +Parent%hTab% -Caption +hwndhBack -DPIScale
Gui, Back: Add, Edit, w460 h20 hwndhMainImage
Gui, Back: Add, Edit, x+5 w460 h20 hwndhMainName
SendMessage, 0x1501, 0, "main image",, ahk_id %hMainImage%  ;  EM_SETCUEBANNER
SendMessage, 0x1501, 0, "main name",, ahk_id %hMainName%  ;  EM_SETCUEBANNER
Gui, Back: Color, D5DCEE
Gui, Back: Add, Button, x998 y140 w30 h100 gAdd, A`nD`nD
Gui, Back: Add, Button, xp y+100 wp hp gDel, D`nE`nL
Gui, WORK: Color, D5DCEE
Gui, WORK: +Parent%hBack% -Caption +Border +hwndhWORK -DPIScale

Gui, Back: Show, x0 y34 w1030 h578
Gui, WORK: Show, x0 y34 w990 h534
Gui, Show
OnMessage(0x115, "WM_VSCROLL")
OnMessage(0x20A, Func("WM_MOUSEWHEEL").Bind(hWORK))
GoSub Add
Guicontrolget, Tab
GuiControl, Focus, Tab
Return

#If WinActive("ahk_id " hMain) && Tab = "WORK"
~Up::
~Down::
PgUp::
PgDn:: VSCROLL_To(hWORK, {"~Up":SB_LINEUP,"~Down":SB_LINEDOWN,"PgUp":SB_PageUp,"PgDn":SB_PageDown}[A_ThisHotkey])
#If

Esc:: ExitApp

Tab:
    Guicontrolget, Tab
    Gui, % "Back: " (Tab = "WORK" ? "Show" : "Hide")
    If Tab = END
        GoSub Submit
    Return

Submit:
ControlGetText,main_image, , % "ahk_id" hMainImage
ControlGetText,main_name, , % "ahk_id" hMainName
Textblocks=

Loop % Blocks
{
  Block := A_Index

  Loop 8
  {
    Type := A_Index > 3 ? "Name" : "Image"
    i := A_Index > 3 ? A_Index - 3 : A_Index
    ControlGetText, Text , , % "ahk_id" hEdit_%Block%_%Type%_%i%
    var%a_index%:=%Block%_%Type%_%i% := Text
  }
;    Listvars

Textblock=
(
obl %Block% (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %var1% !!!!!!!! %var7% !!!!!!!!!!!!!!!!!!!!!!!!!!!!    %var1% !!!!!!!! %var7% !!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %var4%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %var2%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   %var2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %var5% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %var3%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %var3% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %var6%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl %Block% (конец)

)
  Textblocks.=Textblock
}

EndText=
(
%main_image%
%main_name%




<p>
    <style type="text/css">
.all p {
font-family:trebuchet ms,helvetica,sans-serif !important;
color: #444 !important;
font-size: 16px;
}
.hr {
border: 0px !important;
height: 2px !important;
background-color: #888 !important;
}
.big {
object-fit: contain !important;
width: 500px !important;
height: 500px !important;
overflow:hidden !important;
display: block !important;
margin-left: 190px !important;
margin-right: 190px !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
.strong {
color: rgb(0,0,0) !important;
font-size: 18px !important;
}
.alt {
font-style: oblique !important;
text-align: right !important;
font-size: 18px !important;
font-family: 'Times New Roman' !important;
}
.pri {
color: rgb(0,0,0) !important;
font-size: 36px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 10px !important;
margin-top: 40px !important;
}
.sec {
font-size: 28px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 6px !important;
margin-top: 40px !important;
}
.all a {
color: blue !important;
text-decoration: underline !important;
}
.order {
color: #f11 !important;
font-size: 24px !important;
font-family:trebuchet ms,helvetica,sans-serif !important;
text-decoration: underline !important;
text-transform: uppercase !important;
text-align: center !important;
margin: 30px !important;
}
.order a {
color: red !important;
}
.all table tbody tr td {
vertical-align: top !important;
}
.med {
width: 100`% !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 40px !important;
}
.med img {
object-fit: contain !important;
width: 250px !important;
height: 250px !important;
overflow:hidden !important;
display: block !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 0px !important;
margin-top: 14px !important;
vertical-align: top !important;
}
.med p {
text-align: center !important;
font-size:18px !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 14px !important;
margin-top: 7px !important;
width: 250px !important;
}
.small {
width: 100`% !important;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}
.small img {
object-fit: contain;
width: 195px !important;
height: 195px !important;
overflow:hidden;
display: block;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 0px;
margin-top: 15px;
vertical-align: top;
border-width: 0px;
border-style: solid;
border-color: black;
}
.small p {
text-align: center !important;
font-size:16px !important;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 10px;
margin-top: 5px;
width: 195px;
font-family:trebuchet ms,helvetica,sans-serif;
color: #444;
}    </style>
</p>
<div class="all">
    <p>
        &nbsp;</p>
</div>
<p>
    &nbsp;</p>
<p>
        <a href="http://postach.com.ua/image/data/_pro/Zeus/robur.jpg" target="_blank"><img alt="" class="big" src="http://postach.com.ua/image/data/_pro/Zeus/robur.jpg" /></a></p>
    <h1 class="order">
        <a href="http://postach.com.ua/information/contact" target="_blank">Заказ +380673136554</a></h1>
    <table border="0" cellpadding="1" cellspacing="1" class="med" style="width: 500px;">
        <tbody>
  ; /////////////////////////////////////////////////////БЛОКИ//////////////////////////////////////////////
%Textblocks%
</tbody>
    </table>
</div>
<p>
    &nbsp;</p>
)

GuiControl,,EndText,%EndText%

Return

Add:
    ControlGetPos,, PosY,,,, % "ahk_id " hGBs[Blocks++]
    Y := PosY = "" ? 10 : PosY - 4
    Gui, WORK:Add, GroupBox, x10 y%Y% w950 h90 Section hwndhGroupBox%Blocks%, obl %Blocks%
    Loop 8
    {
        i1 := Ceil(A_Index/2), i2 := Mod(A_Index-1,2)+1, Type := ["Image","Name"][i2], hwnd :="hEdit_" Blocks "_" Type "_" i1
if i1=4
{
  Gui, WORK:Add, Edit, % (A_Index = 1 ? "xs+20 ys+20" : ["x+20 ys+20","xp y+20"][i2]) " w55 h20 hwnd" hwnd
        SendMessage, 0x1501, 0, "400?" ,, % "ahk_id" %hwnd%
}
else
{
        Gui, WORK:Add, Edit, % (A_Index = 1 ? "xs+20 ys+20" : ["x+20 ys+20","xp y+20"][i2]) " w270 h20 hwnd" hwnd
        SendMessage, 0x1501, 0, "" Blocks " " Type " " i1 "",, % "ahk_id" %hwnd%
}
    }


    ScrollHeight := Blocks*100+10+18
    hGBs[Blocks] := hGroupBox%Blocks%
    UpdateScrollBar(hWORK, ScrollHeight)
    VSCROLL_To(hWORK, SB_Bottom)
    return

Del:
    If !Blocks
        return
    DllCall("DestroyWindow", "Ptr", hGBs[Blocks])
    Loop 8
        hwnd := "hEdit_" Blocks "_"(A_Index > 3 ? "Name_" : "Image_") (A_Index > 3 ? A_Index - 3 : A_Index), DllCall("DestroyWindow", "Ptr", %hwnd%)
    hGBs.RemoveAt(Blocks--)
    ScrollHeight := Blocks*100+10+4
    UpdateScrollBar(hWORK, ScrollHeight)
    VSCROLL_To(hWORK, SB_Bottom)
    return

UpdateScrollBar(hGui, ScrollHeight)
{
    static SIF_RANGE := 0x1, SIF_PAGE := 0x2, SB_VERT := 1
    VarSetCapacity(si, 28, 0)
    NumPut(28, si) ; cbSize
    NumPut(SIF_RANGE | SIF_PAGE, si, 4)
    NumPut(ScrollHeight, si, 12) ; nMax
    NumPut(GuiHeight, si, 16) ; nPage
    DllCall("SetScrollInfo", Ptr, hGui, UInt, SB_VERT, Ptr, &si, Int, 1)

    ControlGetPos,, Top,,,, % "ahk_id " hGBs[1]
    if (Top = 114)
        Return
    Top -= 114

    ControlGetPos,, y,, h,, % "ahk_id " hGBs[Blocks]
    bottom := y + h - 74
    if (top < 0 && bottom < GuiHeight)
    {
        y := (a := Abs(top)) > (b := GuiHeight-bottom) ? b : a
        DllCall("ScrollWindow", Ptr, hGui, Int, 0, Int, y, Ptr, 0, Ptr, 0)
    }
}

WM_VSCROLL(wParam, lParam, msg, hwnd)
{
    static SIF_ALL:=0x17, SCROLL_STEP:=10
    bar := msg=0x115 ; SB_HORZ=0, SB_VERT=1

    VarSetCapacity(si, 28, 0)
    NumPut(28, si, "UInt") ; cbSize
    NumPut(SIF_ALL, si, 4, "UInt") ; fMask
    if !DllCall("GetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si)
        return

    VarSetCapacity(rect, 16)
    DllCall("GetClientRect", Ptr, hwnd, Ptr, &rect)
    new_pos := NumGet(si, 20, "UInt") ; nPos
    action := wParam & 0xFFFF

    if action = 0 ; SB_LINEUP
        new_pos -= SCROLL_STEP
    else if action = 1 ; SB_LINEDOWN
        new_pos += SCROLL_STEP
    else if action = 2 ; SB_PAGEUP
        new_pos -= NumGet(rect, 12, "Int") - SCROLL_STEP
    else if action = 3 ; SB_PAGEDOWN
        new_pos += NumGet(rect, 12, "Int") - SCROLL_STEP
    else if (action = 5 || action = 4) ; SB_THUMBTRACK || SB_THUMBPOSITION
        new_pos := wParam>>16
    else if action = 6 ; SB_TOP
        new_pos := NumGet(si, 8, "Int") ; nMin
    else if action = 7 ; SB_BOTTOM
        new_pos := NumGet(si, 12, "Int") ; nMax
    else
        return
    min := NumGet(si, 8, "Int") ; nMin
    max := NumGet(si, 12, "Int") - NumGet(si, 16, "UInt") ; nMax-nPage
    new_pos := new_pos > max ? max : new_pos
    new_pos := new_pos < min ? min : new_pos

    old_pos := NumGet(si, 20, "Int") ; nPos

    y := old_pos-new_pos
    ; Scroll contents of window and invalidate uncovered area.

    DllCall("ScrollWindow", Ptr, hwnd, Int, 0, Int, y, UInt, 0, UInt, 0)

    ; Update scroll bar.
    NumPut(new_pos, si, 20, "Int") ; nPos

    DllCall("SetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si, Int, 1)
}

VSCROLL_To(hwnd, msg){
    WM_VSCROLL(msg, 0, WM_VSCROLL, hWnd)
}

WM_MOUSEWHEEL(hWnd, wp)
{
   Loop 4
      WM_VSCROLL(wp>>16 & 0xFFFF < 0x7FFF ? SB_LINEUP : SB_LINEDOWN, 0, WM_VSCROLL, hWnd)
}
Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

73

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:

Вот добавил, не кнопки правда, но думаю так наверное даже удобнее - можно любую цифру вписать, не только 400.


Криво, косо, но работает:

Работает но никак Добавляются лишние блоки не работающие, строки которые добавили, работает только 1на. Но спасибо попробую разобраться

74 (изменено: yalanne, 2015-07-17 16:24:01)

Re: AHK: Изменение текста с помощью GUI

Я интерфейс в виде дерева сделал + добавил нужные строки которые сказаны выше.
И этот скрипт не создает с 0 страницу а редактирует

+ скрипт
FileName := "test.html"

FileDelete New_%FileName%
Loop, read, %FileName% ; Чтение страницы.
{
if tablet or (A_LoopReadLine ~= "<tbody>") and (pos1 := A_Index) ; записать часть кода в переменную от <tbody> до </tbody>.
    tablet.=A_LoopReadLine "`n"
if tablet and (A_LoopReadLine ~= "</tbody>") and (pos2 := A_Index)
    break
}


Unit := StrSplit(tablet,"<tr>")  ; Деление tablet на основные блоки.
loop % Unit.MaxIndex()-1
{
    _UnitP := A_Index
    UnitChild := StrSplit(Unit[A_Index+1] , "<td>") ; Деление на дополнительные блоки.
    loop % UnitChild.MaxIndex()-1
        {
        _UnitC%_UnitP% := A_Index
        _Unit%_UnitP%_href%A_Index% := (RegExMatch( UnitChild[A_Index+1] , "U) href=""(.*)"" .*</td>",_tmp) ? "" : "") _tmp1
        _Unit%_UnitP%_target%A_Index% := (RegExMatch( UnitChild[A_Index+1] , "U) target=""_blank"">""(.*)"".*</td>",_tmp) ? "" : "") _tmp1
        _Unit%_UnitP%_src%A_Index% := (RegExMatch( UnitChild[A_Index+1] , "U) src=""(.*)"" .*</td>",_tmp) ? "" : "") _tmp1
        _Unit%_UnitP%_style%A_Index% := (RegExMatch( UnitChild[A_Index+1] , "U) style=""(.*)"" .*</td>",_tmp) ? "" : "") _tmp1
        _Unit%_UnitP%_name%A_Index% := (RegExMatch( UnitChild[A_Index+1] , "U)<p>.*<p>(.*)</p>",_tmp) ? "" : "") RegExReplace(_tmp1,"\s")
        ; Отсеивание лишнего и занос в переменные.
        }
}
;msgbox % "href: " _Unit1_href2 "`ntarget: " _Unit1_target2 "`nsrc: " _Unit1_src2 "`nstyle: " _Unit1_style2 "`nname: " _Unit1_name2

; Доступные переменные после действий сделанных выше:
; _UnitP - Содержит общее количество Основных блоков.
; _UnitC[Номер основного блока] - содержит количество дополнительных блоков в основном блоке. 
;     Пример ввода: "_UnitC1"
; _Unit[Номер основного блока]_href[Номер дополнительного блока] - Содержит href параметр. Ссылка.
; _Unit[Номер основного блока]_target[Номер дополнительного блока] - Содержит target параметр. Первое имя.
; _Unit[Номер основного блока]_src[Номер дополнительного блока] - Содержит src параметр. Имя картинки.
; _Unit[Номер основного блока]_style[Номер дополнительного блока] - Содержит style параметр. Стиль картинки.
; _Unit[Номер основного блока]_name[Номер дополнительного блока] - Содержит name параметр. Второе имя.
;     Пример ввода: "_Unit1_href1"

Gui, Margin, 5, 10

Gui Add, text, x5, href - Ссылка:
Gui add, Edit,xp yp+15 w295 gedt_list vhref
Gui Add, text, x5, target - Первое имя:
Gui add, Edit,xp yp+15 w295 gedt_list vtarget
Gui Add, text, x5, src - Имя картинки:
Gui add, Edit,xp yp+15 w295 gedt_list vsrc
Gui Add, text, x5, style - Стиль картинки:
Gui add, Edit,xp yp+15 w295 gedt_list vstyle
Gui Add, text, x5, name - Второе имя:
Gui add, Edit,xp yp+15 w295 gedt_list vname

Gui, Add, TreeView, xp+300 y10 w300 h490 gtree_list vtree_list
Gui add, button, xp yp+495 w150 gadd_Item,Добавить блок
Gui add, button, xp+150 yp w150 gdel_Item,Удалить блок
Gui add, button, x5 yp w150 gstart,Запустить.
Gosub Create_tree

Gui, Show 
return
tree_list:
ItemID :=  TV_GetSelection()
TV_GetText(TextP,    TV_GetParent(ItemID)), TV_GetText(TextC, ItemID)
if (TextC ~= "блок")
    TextP:=TextC,TextC=""
Select_ListP := Ltrim(TextP,"блок ")
Select_ListC := Ltrim(TextC, "Картинка ")

GuiControl,,href, % !(TextP) ? "" : _Unit%Select_ListP%_href%Select_ListC%
GuiControl,,target, % !(TextP) ? "" : _Unit%Select_ListP%_target%Select_ListC%
GuiControl,,src, % !(TextP) ? "" : _Unit%Select_ListP%_src%Select_ListC%
GuiControl,,style, % !(TextP) ? "" : _Unit%Select_ListP%_style%Select_ListC%
GuiControl,,name, % !(TextP) ? "" : _Unit%Select_ListP%_name%Select_ListC%
return
Create_tree:
loop % _UnitP
{
h := A_Index
P%h% := TV_Add("блок " h)
    loop % _UnitC%h%
        TV_Add("Картинка " A_Index,P%h%)
}
TV_Modify(P1,"Select")
return
edt_list:
if !Select_ListC
return
ControlGetFocus focus, % "ahk_id " WinExist()
if !(focus ~= "Edit")
    return
GuiControlGet,href
GuiControlGet,target
GuiControlGet,src
GuiControlGet,style
GuiControlGet,name
_Unit%Select_ListP%_%A_GuiControl%%Select_ListC% := %A_GuiControl%
return
add_Item:
_UnitP++
_UnitC%_UnitP% := 3
loop % _UnitC%_UnitP%
    {
    _Unit%_UnitP%_target%A_Index% := _UnitP "Имя" A_Index
    _Unit%_UnitP%_src%A_Index% := _UnitP "image" A_Index ".jpg"
    _Unit%_UnitP%_style%A_Index% := "width: 400px; height: 400px;"
    _Unit%_UnitP%_name%A_Index% := _UnitP "Имя2_" A_Index
    }

TV_Delete()
Gosub Create_tree
return

del_Item:
if !_UnitP
    return
TV_Delete(P%_UnitP%)
loop 3
    {
    _Unit%_UnitP%_href%A_Index% := ""
    _Unit%_UnitP%_target%A_Index% := "" 
    _Unit%_UnitP%_src%A_Index% := ""
    _Unit%_UnitP%_style%A_Index% := ""
    _Unit%_UnitP%_name := ""
    }
_UnitC%_UnitP% := ""
_UnitP--
Goto tree_list
start:
FileDelete New_%FileName%
tablet := "", new_code:=""
tablet.="<tbody>`n`n"
loop % _UnitP
{
    h := A_Index
    tablet.="`t<tr>`n"
    loop % _UnitC%h%
        tablet.="`t`t<td>"
        . "`n`t`t`t<a href=""" _Unit%h%_href%A_Index% """ target=""_blank"">""" _Unit%h%_target%A_Index% """<img alt="""" class=""big"" src=""" _Unit%h%_src%A_Index% """ style=""" _Unit%h%_style%A_Index% """ /></a>" "`n"
        . "`t`t`t<p>`n`t`t`t`t&nbsp;</p>`n`t`t`t<p>`n`t`t`t`t" _Unit%h%_name%A_Index% "</p>"
        . "`n`t`t</td>`n`n"
        
    tablet.="`t</tr>`n"    
}
tablet.="</tbody>"

Loop, read, %FileName%
if (A_Index != pos1)
    new_code.= A_LoopReadLine "`n"
else
    break
new_code.="`n" tablet "`n"
Loop, read, %FileName%
if (A_Index > pos2)
    new_code.= A_LoopReadLine "`n"

FileAppend %new_code%, New_%FileName%
loop 100
{
if FileExist("New_" FileName)
    break
sleep 100
}
try Run New_%FileName%
return
GuiClose:
if FileExist("New_" FileName)
{
FileDelete %FileName%
FileMove New_%FileName%, %FileName%
}
ExitApp
+ страница
<p>
    <style type="text/css">
.all p {
font-family:trebuchet ms,helvetica,sans-serif !important;
color: #444 !important;
font-size: 16px;
}
.hr {
border: 0px !important;
height: 2px !important;
background-color: #888 !important;
}
.big {
object-fit: contain !important;
width: 500px !important;
height: 500px !important;
overflow:hidden !important;
display: block !important;
margin-left: 190px !important;
margin-right: 190px !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
.strong {
color: rgb(0,0,0) !important;
font-size: 18px !important;
}
.alt {
font-style: oblique !important;
text-align: right !important;
font-size: 18px !important;
font-family: 'Times New Roman' !important;
}
.pri {
color: rgb(0,0,0) !important;
font-size: 36px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 10px !important;
margin-top: 40px !important;
}
.sec {
font-size: 28px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 6px !important;
margin-top: 40px !important;
}
.all a {
color: blue !important;
text-decoration: underline !important;
}
.order {
color: #f11 !important;
font-size: 24px !important;
font-family:trebuchet ms,helvetica,sans-serif !important;
text-decoration: underline !important;
text-transform: uppercase !important;
text-align: center !important;
margin: 30px !important;
}
.order a {
color: red !important;
}
.all table tbody tr td {
vertical-align: top !important;
}
.med {
width: 100% !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 40px !important;
}
.med img {
object-fit: contain !important;
width: 250px !important;
height: 250px !important;
overflow:hidden !important;
display: block !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 0px !important;
margin-top: 14px !important;
vertical-align: top !important;
}
.med p {
text-align: center !important;
font-size:18px !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 14px !important;
margin-top: 7px !important;
width: 250px !important;
}
.small {
width: 100% !important;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}
.small img {
object-fit: contain;
width: 195px !important;
height: 195px !important;
overflow:hidden;
display: block;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 0px;
margin-top: 15px;
vertical-align: top;
border-width: 0px;
border-style: solid;
border-color: black;
}
.small p {
text-align: center !important;
font-size:16px !important;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 10px;
margin-top: 5px;
width: 195px;
font-family:trebuchet ms,helvetica,sans-serif;
color: #444;
}    </style>
</p>
<div class="all">
    <p>
        &nbsp;</p>
</div>
<p>
    &nbsp;</p>
<p>
        <a href="" target="_blank"><img alt="" class="big" src="" /></a></p>
    <h1 class="order">
        <a href="http://postach.com.ua/information/contact" target="_blank">Заказ +380673136554</a></h1>
    <table border="0" cellpadding="1" cellspacing="1" class="med" style="width: 500px;">


<tbody>

</tbody>
    </table>
</div>
<p>
    &nbsp;</p>

Страницу положить рядом со скриптом и дать имя странице "test.html"


При запуске скрипта загружает в лист-дерево все нужные блоки.

75 (изменено: Alectric, 2015-07-17 06:47:52)

Re: AHK: Изменение текста с помощью GUI

блоки не работающие

Все вроде работало... там нужно все строки заполнить чтобы это в конце отобразилось, если не заполнить, то да, блоки пустые будут. Это так задумано было у serzh82saratov.

работает только 1на

Что?

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

76

Re: AHK: Изменение текста с помощью GUI

yalanne пишет:

Я интерфейс в виде дерева сделал + добавил нужные строки которые сказаны выше.
И этот скрипт не создает с 0 страницу а редактирует

Интересная интерпретация моей идеи, я как раз думал над тем как менять старые коды под новые настройки. Спасибо, это будет очень полезно.

77

Re: AHK: Изменение текста с помощью GUI

А куда кстати в html коде прикрутить main image  я таки не понял и тупо не добавил).

78

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:

Все вроде работало... там нужно все строки заполнить чтобы это в конце отобразилось, если не заполнить, то да, блоки пустые будут. Это так задумано было у serzh82saratov.


Что?

Подскажите где взять актуальную версию AHK. Там где вы добавили две строки ввода (placeholder 400), из них работает только одна строка ввода нижней и вводит текст во все блоки, но думаю это решится после обновления версии AHK.
Да и не подскадите как добавить что бы в строке ввода был серый текст как в примере serzh82saratov-а ?

79

Re: AHK: Изменение текста с помощью GUI

  • последняя версия AHK

  • Не совсем понял, но вроде речь идет о style он кстати почему то в моем коде работает неправильно. Вроде в html код не правильно подставляю(не сильно уж шарю в коде html)

  • Вот пример маленький(отдельный скрипт):

Gui, Add, Edit, w570 h20 HWNDedt1
SendMessage, 0x1501, 0, "main image",, ahk_id %edt1%
Gui add,button
Gui show 
GuiControl, Focus, Button1

80

Re: AHK: Изменение текста с помощью GUI

Исправил. Там путаница была с хендлами "hEdit".

#SingleInstance Force
#NoEnv

Global GuiHeight := 536, Blocks := 0, hGBs := [], SB_LINEUP := 0, SB_LINEDOWN := 1
    , SB_PageUp := 2, SB_PageDown := 3, SB_Bottom := 7, WM_VSCROLL := 0x115
ScrollHeight := 0

Gui, +hwndhMain -DPIScale
Gui, Margin, 5, 5
Gui, Color, D5DCEE
Gui, Add, Tab, w1030 h610 +0x400 HWNDhTab gTab vTab, WORK|END
SendMessage, 0x1329, 0, 500 | 30 << 16, ,ahk_id %hTab%        ;  TCM_SETITEMSIZE
Gui, Tab, END
Gui, Add, Edit, w1010 h570 vEndText
Gui, Tab, WORK
Gui, Back: +Parent%hTab% -Caption +hwndhBack -DPIScale
Gui, Back: Add, Edit, w460 h20 hwndhMainImage
Gui, Back: Add, Edit, x+5 w460 h20 hwndhMainName
SendMessage, 0x1501, 0, "main image",, ahk_id %hMainImage%  ;  EM_SETCUEBANNER
SendMessage, 0x1501, 0, "main name",, ahk_id %hMainName%  ;  EM_SETCUEBANNER
Gui, Back: Color, D5DCEE
Gui, Back: Add, Button, x998 y140 w30 h100 gAdd, A`nD`nD
Gui, Back: Add, Button, xp y+100 wp hp gDel, D`nE`nL
Gui, WORK: Color, D5DCEE
Gui, WORK: +Parent%hBack% -Caption +Border +hwndhWORK -DPIScale

Gui, Back: Show, x0 y34 w1030 h578
Gui, WORK: Show, x0 y34 w990 h534
Gui, Show
OnMessage(0x115, "WM_VSCROLL")
OnMessage(0x20A, Func("WM_MOUSEWHEEL").Bind(hWORK))
GoSub Add
Guicontrolget, Tab
GuiControl, Focus, Tab
Return

#If WinActive("ahk_id " hMain) && Tab = "WORK"
~Up::
~Down::
PgUp::
PgDn:: VSCROLL_To(hWORK, {"~Up":SB_LINEUP,"~Down":SB_LINEDOWN,"PgUp":SB_PageUp,"PgDn":SB_PageDown}[A_ThisHotkey])
#If

Esc:: ExitApp

Tab:
    Guicontrolget, Tab
    Gui, % "Back: " (Tab = "WORK" ? "Show" : "Hide")
    If Tab = END
        GoSub Submit
    Return

Submit:
ControlGetText,main_image, , % "ahk_id" hMainImage
ControlGetText,main_name, , % "ahk_id" hMainName
Textblocks=
Loop % Blocks
{
  Block := A_Index

  Loop 8
  {
    Type := A_Index > 3 ? "Name" : "Image"
    i := A_Index > 3 ? A_Index - 3 : A_Index
    ControlGetText, Text , , % "ahk_id" hEdit_%Block%_%A_Index%
    var%a_index%:=%Block%_%Type%_%i% := Text
  }
;    Listvars

Textblock=
(
obl %Block% (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %var1% !!!!!!!! %var7% !!!!!!!!!!!!!!!!!!!!!!!!!!!!    %var1% !!!!!!!! %var8% !!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %var4%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %var2%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   %var2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %var5% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %var3%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %var3% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %var6%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl %Block% (конец)

)
  Textblocks.=Textblock
}

EndText=
(
%main_image%
%main_name%




<p>
    <style type="text/css">
.all p {
font-family:trebuchet ms,helvetica,sans-serif !important;
color: #444 !important;
font-size: 16px;
}
.hr {
border: 0px !important;
height: 2px !important;
background-color: #888 !important;
}
.big {
object-fit: contain !important;
width: 500px !important;
height: 500px !important;
overflow:hidden !important;
display: block !important;
margin-left: 190px !important;
margin-right: 190px !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
.strong {
color: rgb(0,0,0) !important;
font-size: 18px !important;
}
.alt {
font-style: oblique !important;
text-align: right !important;
font-size: 18px !important;
font-family: 'Times New Roman' !important;
}
.pri {
color: rgb(0,0,0) !important;
font-size: 36px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 10px !important;
margin-top: 40px !important;
}
.sec {
font-size: 28px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 6px !important;
margin-top: 40px !important;
}
.all a {
color: blue !important;
text-decoration: underline !important;
}
.order {
color: #f11 !important;
font-size: 24px !important;
font-family:trebuchet ms,helvetica,sans-serif !important;
text-decoration: underline !important;
text-transform: uppercase !important;
text-align: center !important;
margin: 30px !important;
}
.order a {
color: red !important;
}
.all table tbody tr td {
vertical-align: top !important;
}
.med {
width: 100`% !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 40px !important;
}
.med img {
object-fit: contain !important;
width: 250px !important;
height: 250px !important;
overflow:hidden !important;
display: block !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 0px !important;
margin-top: 14px !important;
vertical-align: top !important;
}
.med p {
text-align: center !important;
font-size:18px !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 14px !important;
margin-top: 7px !important;
width: 250px !important;
}
.small {
width: 100`% !important;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}
.small img {
object-fit: contain;
width: 195px !important;
height: 195px !important;
overflow:hidden;
display: block;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 0px;
margin-top: 15px;
vertical-align: top;
border-width: 0px;
border-style: solid;
border-color: black;
}
.small p {
text-align: center !important;
font-size:16px !important;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 10px;
margin-top: 5px;
width: 195px;
font-family:trebuchet ms,helvetica,sans-serif;
color: #444;
}    </style>
</p>
<div class="all">
    <p>
        &nbsp;</p>
</div>
<p>
    &nbsp;</p>
<p>
        <a href="http://postach.com.ua/image/data/_pro/Zeus/robur.jpg" target="_blank"><img alt="" class="big" src="http://postach.com.ua/image/data/_pro/Zeus/robur.jpg" /></a></p>
    <h1 class="order">
        <a href="http://postach.com.ua/information/contact" target="_blank">Заказ +380673136554</a></h1>
    <table border="0" cellpadding="1" cellspacing="1" class="med" style="width: 500px;">
        <tbody>
  ; /////////////////////////////////////////////////////БЛОКИ//////////////////////////////////////////////
%Textblocks%
</tbody>
    </table>
</div>
<p>
    &nbsp;</p>
)

GuiControl,,EndText,%EndText%

Return

Add:
    ControlGetPos,, PosY,,,, % "ahk_id " hGBs[Blocks++]
    Y := PosY = "" ? 10 : PosY - 4
    Gui, WORK:Add, GroupBox, x10 y%Y% w950 h90 Section hwndhGroupBox%Blocks%, obl %Blocks%
    Loop 8
    {
        i1 := Ceil(A_Index/2), i2 := Mod(A_Index-1,2)+1, Type := ["Image","Name"][i2], hwnd :="hEdit_" Blocks "_" A_Index
if i1=4
{
  Gui, WORK:Add, Edit, % (A_Index = 1 ? "xs+20 ys+20" : ["x+20 ys+20","xp y+20"][i2]) " w55 h20 hwnd" hwnd
        SendMessage, 0x1501, 0, "400?" ,, % "ahk_id" %hwnd%
}
else
{
        Gui, WORK:Add, Edit, % (A_Index = 1 ? "xs+20 ys+20" : ["x+20 ys+20","xp y+20"][i2]) " w270 h20 hwnd" hwnd
        SendMessage, 0x1501, 0, "" Blocks " " Type " " i1 "",, % "ahk_id" %hwnd%
}
    }


    ScrollHeight := Blocks*100+10+18
    hGBs[Blocks] := hGroupBox%Blocks%
    UpdateScrollBar(hWORK, ScrollHeight)
    VSCROLL_To(hWORK, SB_Bottom)
    return

Del:
    If !Blocks
        return
    DllCall("DestroyWindow", "Ptr", hGBs[Blocks])
    Loop 8
        hwnd := "hEdit_" Blocks "_"(A_Index > 3 ? "Name_" : "Image_") (A_Index > 3 ? A_Index - 3 : A_Index), DllCall("DestroyWindow", "Ptr", %hwnd%)
    hGBs.RemoveAt(Blocks--)
    ScrollHeight := Blocks*100+10+4
    UpdateScrollBar(hWORK, ScrollHeight)
    VSCROLL_To(hWORK, SB_Bottom)
    return

UpdateScrollBar(hGui, ScrollHeight)
{
    static SIF_RANGE := 0x1, SIF_PAGE := 0x2, SB_VERT := 1
    VarSetCapacity(si, 28, 0)
    NumPut(28, si) ; cbSize
    NumPut(SIF_RANGE | SIF_PAGE, si, 4)
    NumPut(ScrollHeight, si, 12) ; nMax
    NumPut(GuiHeight, si, 16) ; nPage
    DllCall("SetScrollInfo", Ptr, hGui, UInt, SB_VERT, Ptr, &si, Int, 1)

    ControlGetPos,, Top,,,, % "ahk_id " hGBs[1]
    if (Top = 114)
        Return
    Top -= 114

    ControlGetPos,, y,, h,, % "ahk_id " hGBs[Blocks]
    bottom := y + h - 74
    if (top < 0 && bottom < GuiHeight)
    {
        y := (a := Abs(top)) > (b := GuiHeight-bottom) ? b : a
        DllCall("ScrollWindow", Ptr, hGui, Int, 0, Int, y, Ptr, 0, Ptr, 0)
    }
}

WM_VSCROLL(wParam, lParam, msg, hwnd)
{
    static SIF_ALL:=0x17, SCROLL_STEP:=10
    bar := msg=0x115 ; SB_HORZ=0, SB_VERT=1

    VarSetCapacity(si, 28, 0)
    NumPut(28, si, "UInt") ; cbSize
    NumPut(SIF_ALL, si, 4, "UInt") ; fMask
    if !DllCall("GetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si)
        return

    VarSetCapacity(rect, 16)
    DllCall("GetClientRect", Ptr, hwnd, Ptr, &rect)
    new_pos := NumGet(si, 20, "UInt") ; nPos
    action := wParam & 0xFFFF

    if action = 0 ; SB_LINEUP
        new_pos -= SCROLL_STEP
    else if action = 1 ; SB_LINEDOWN
        new_pos += SCROLL_STEP
    else if action = 2 ; SB_PAGEUP
        new_pos -= NumGet(rect, 12, "Int") - SCROLL_STEP
    else if action = 3 ; SB_PAGEDOWN
        new_pos += NumGet(rect, 12, "Int") - SCROLL_STEP
    else if (action = 5 || action = 4) ; SB_THUMBTRACK || SB_THUMBPOSITION
        new_pos := wParam>>16
    else if action = 6 ; SB_TOP
        new_pos := NumGet(si, 8, "Int") ; nMin
    else if action = 7 ; SB_BOTTOM
        new_pos := NumGet(si, 12, "Int") ; nMax
    else
        return
    min := NumGet(si, 8, "Int") ; nMin
    max := NumGet(si, 12, "Int") - NumGet(si, 16, "UInt") ; nMax-nPage
    new_pos := new_pos > max ? max : new_pos
    new_pos := new_pos < min ? min : new_pos

    old_pos := NumGet(si, 20, "Int") ; nPos

    y := old_pos-new_pos
    ; Scroll contents of window and invalidate uncovered area.

    DllCall("ScrollWindow", Ptr, hwnd, Int, 0, Int, y, UInt, 0, UInt, 0)

    ; Update scroll bar.
    NumPut(new_pos, si, 20, "Int") ; nPos

    DllCall("SetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si, Int, 1)
}

VSCROLL_To(hwnd, msg){
    WM_VSCROLL(msg, 0, WM_VSCROLL, hWnd)
}

WM_MOUSEWHEEL(hWnd, wp)
{
   Loop 4
      WM_VSCROLL(wp>>16 & 0xFFFF < 0x7FFF ? SB_LINEUP : SB_LINEDOWN, 0, WM_VSCROLL, hWnd)
}
Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

81

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:

Исправил. Там путаница была с хендлами "hEdit".

Да и досих пор плутаница
При добавлении блоков и удалении пропадает только обрамление, а строки ввода остаються, но если снова добавить блоки то с них текст не будет посылаться в вкладку END. То есть добавил 2 блока, потом удалил, текст в вкладке END остается но уже "нерабочий" потому что текст из строк ввода не посылаеться в него. Лучше уже старая версия нежели столько работы с чужим кодом, + старая версия рабочая и простая.

82

Re: AHK: Изменение текста с помощью GUI

yalanne пишет:

Вот пример маленький(отдельный скрипт):

Помню ранше нужно было просто что то дописать до EDIT-a  и все, но сейчас не могу найти тот код. Но спасибо!

83

Re: AHK: Изменение текста с помощью GUI

Исправил пару багов в своем коде.

84

Re: AHK: Изменение текста с помощью GUI

Исправил... последний раз, что-то я устал уже...

#SingleInstance Force
#NoEnv

Global GuiHeight := 536, Blocks := 0, hGBs := [], SB_LINEUP := 0, SB_LINEDOWN := 1
    , SB_PageUp := 2, SB_PageDown := 3, SB_Bottom := 7, WM_VSCROLL := 0x115
ScrollHeight := 0

Gui, +hwndhMain -DPIScale
Gui, Margin, 5, 5
Gui, Color, D5DCEE
Gui, Add, Tab, w1030 h610 +0x400 HWNDhTab gTab vTab, WORK|END
SendMessage, 0x1329, 0, 500 | 30 << 16, ,ahk_id %hTab%        ;  TCM_SETITEMSIZE
Gui, Tab, END
Gui, Add, Edit, w1010 h570 vEndText
Gui, Tab, WORK
Gui, Back: +Parent%hTab% -Caption +hwndhBack -DPIScale
Gui, Back: Add, Edit, w460 h20 hwndhMainImage
Gui, Back: Add, Edit, x+5 w460 h20 hwndhMainName
SendMessage, 0x1501, 0, "main image",, ahk_id %hMainImage%  ;  EM_SETCUEBANNER
SendMessage, 0x1501, 0, "main name",, ahk_id %hMainName%  ;  EM_SETCUEBANNER
Gui, Back: Color, D5DCEE
Gui, Back: Add, Button, x998 y140 w30 h100 gAdd, A`nD`nD
Gui, Back: Add, Button, xp y+100 wp hp gDel, D`nE`nL
Gui, WORK: Color, D5DCEE
Gui, WORK: +Parent%hBack% -Caption +Border +hwndhWORK -DPIScale

Gui, Back: Show, x0 y34 w1030 h578
Gui, WORK: Show, x0 y34 w990 h534
Gui, Show
OnMessage(0x115, "WM_VSCROLL")
OnMessage(0x20A, Func("WM_MOUSEWHEEL").Bind(hWORK))
GoSub Add
Guicontrolget, Tab
GuiControl, Focus, Tab
Return

#If WinActive("ahk_id " hMain) && Tab = "WORK"
~Up::
~Down::
PgUp::
PgDn:: VSCROLL_To(hWORK, {"~Up":SB_LINEUP,"~Down":SB_LINEDOWN,"PgUp":SB_PageUp,"PgDn":SB_PageDown}[A_ThisHotkey])
#If

Esc:: ExitApp

Tab:
    Guicontrolget, Tab
    Gui, % "Back: " (Tab = "WORK" ? "Show" : "Hide")
    If Tab = END
        GoSub Submit
    Return

Submit:
ControlGetText,main_image, , % "ahk_id" hMainImage
ControlGetText,main_name, , % "ahk_id" hMainName
Textblocks=
Loop % Blocks
{
  Block := A_Index

  Loop 8
  {
    Type := A_Index > 3 ? "Name" : "Image"
    i := A_Index > 3 ? A_Index - 3 : A_Index
    ControlGetText, Text , , % "ahk_id" hEdit_%Block%_%A_Index%
    var%a_index%:=%Block%_%Type%_%i% := Text
  }
;    Listvars

Textblock=
(
obl %Block% (начало)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %var1% !!!!!!!! %var7% !!!!!!!!!!!!!!!!!!!!!!!!!!!!    %var1% !!!!!!!! %var8% !!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %var4%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %var2%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   %var2% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %var5% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    %var3%  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %var3% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  %var6%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
obl %Block% (конец)

)
  Textblocks.=Textblock
}

EndText=
(
%main_image%
%main_name%




<p>
    <style type="text/css">
.all p {
font-family:trebuchet ms,helvetica,sans-serif !important;
color: #444 !important;
font-size: 16px;
}
.hr {
border: 0px !important;
height: 2px !important;
background-color: #888 !important;
}
.big {
object-fit: contain !important;
width: 500px !important;
height: 500px !important;
overflow:hidden !important;
display: block !important;
margin-left: 190px !important;
margin-right: 190px !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
.strong {
color: rgb(0,0,0) !important;
font-size: 18px !important;
}
.alt {
font-style: oblique !important;
text-align: right !important;
font-size: 18px !important;
font-family: 'Times New Roman' !important;
}
.pri {
color: rgb(0,0,0) !important;
font-size: 36px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 10px !important;
margin-top: 40px !important;
}
.sec {
font-size: 28px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 6px !important;
margin-top: 40px !important;
}
.all a {
color: blue !important;
text-decoration: underline !important;
}
.order {
color: #f11 !important;
font-size: 24px !important;
font-family:trebuchet ms,helvetica,sans-serif !important;
text-decoration: underline !important;
text-transform: uppercase !important;
text-align: center !important;
margin: 30px !important;
}
.order a {
color: red !important;
}
.all table tbody tr td {
vertical-align: top !important;
}
.med {
width: 100`% !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 40px !important;
}
.med img {
object-fit: contain !important;
width: 250px !important;
height: 250px !important;
overflow:hidden !important;
display: block !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 0px !important;
margin-top: 14px !important;
vertical-align: top !important;
}
.med p {
text-align: center !important;
font-size:18px !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 14px !important;
margin-top: 7px !important;
width: 250px !important;
}
.small {
width: 100`% !important;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}
.small img {
object-fit: contain;
width: 195px !important;
height: 195px !important;
overflow:hidden;
display: block;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 0px;
margin-top: 15px;
vertical-align: top;
border-width: 0px;
border-style: solid;
border-color: black;
}
.small p {
text-align: center !important;
font-size:16px !important;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 10px;
margin-top: 5px;
width: 195px;
font-family:trebuchet ms,helvetica,sans-serif;
color: #444;
}    </style>
</p>
<div class="all">
    <p>
        &nbsp;</p>
</div>
<p>
    &nbsp;</p>
<p>
        <a href="http://postach.com.ua/image/data/_pro/Zeus/robur.jpg" target="_blank"><img alt="" class="big" src="http://postach.com.ua/image/data/_pro/Zeus/robur.jpg" /></a></p>
    <h1 class="order">
        <a href="http://postach.com.ua/information/contact" target="_blank">Заказ +380673136554</a></h1>
    <table border="0" cellpadding="1" cellspacing="1" class="med" style="width: 500px;">
        <tbody>
  ; /////////////////////////////////////////////////////БЛОКИ//////////////////////////////////////////////
%Textblocks%
</tbody>
    </table>
</div>
<p>
    &nbsp;</p>
)

GuiControl,,EndText,%EndText%

Return

Add:
    ControlGetPos,, PosY,,,, % "ahk_id " hGBs[Blocks++]
    Y := PosY = "" ? 10 : PosY - 4
    Gui, WORK:Add, GroupBox, x10 y%Y% w950 h90 Section hwndhGroupBox%Blocks%, obl %Blocks%
    Loop 8
    {
        i1 := Ceil(A_Index/2), i2 := Mod(A_Index-1,2)+1, Type := ["Image","Name"][i2], hwnd :="hEdit_" Blocks "_" A_Index
if i1=4
{
  Gui, WORK:Add, Edit, % (A_Index = 1 ? "xs+20 ys+20" : ["x+20 ys+20","xp y+20"][i2]) " w55 h20 hwnd" hwnd
        SendMessage, 0x1501, 0, "400?" ,, % "ahk_id" %hwnd%
}
else
{
        Gui, WORK:Add, Edit, % (A_Index = 1 ? "xs+20 ys+20" : ["x+20 ys+20","xp y+20"][i2]) " w270 h20 hwnd" hwnd
        SendMessage, 0x1501, 0, "" Blocks " " Type " " i1 "",, % "ahk_id" %hwnd%
}
    }


    ScrollHeight := Blocks*100+10+18
    hGBs[Blocks] := hGroupBox%Blocks%
    UpdateScrollBar(hWORK, ScrollHeight)
    VSCROLL_To(hWORK, SB_Bottom)
    return

Del:
    If !Blocks
        return
    DllCall("DestroyWindow", "Ptr", hGBs[Blocks])
    Loop 8
        hwnd := "hEdit_" Blocks "_" A_Index, DllCall("DestroyWindow", "Ptr", %hwnd%)
    hGBs.RemoveAt(Blocks--)
    ScrollHeight := Blocks*100+10+4
    UpdateScrollBar(hWORK, ScrollHeight)
    VSCROLL_To(hWORK, SB_Bottom)
    return

UpdateScrollBar(hGui, ScrollHeight)
{
    static SIF_RANGE := 0x1, SIF_PAGE := 0x2, SB_VERT := 1
    VarSetCapacity(si, 28, 0)
    NumPut(28, si) ; cbSize
    NumPut(SIF_RANGE | SIF_PAGE, si, 4)
    NumPut(ScrollHeight, si, 12) ; nMax
    NumPut(GuiHeight, si, 16) ; nPage
    DllCall("SetScrollInfo", Ptr, hGui, UInt, SB_VERT, Ptr, &si, Int, 1)

    ControlGetPos,, Top,,,, % "ahk_id " hGBs[1]
    if (Top = 114)
        Return
    Top -= 114

    ControlGetPos,, y,, h,, % "ahk_id " hGBs[Blocks]
    bottom := y + h - 74
    if (top < 0 && bottom < GuiHeight)
    {
        y := (a := Abs(top)) > (b := GuiHeight-bottom) ? b : a
        DllCall("ScrollWindow", Ptr, hGui, Int, 0, Int, y, Ptr, 0, Ptr, 0)
    }
}

WM_VSCROLL(wParam, lParam, msg, hwnd)
{
    static SIF_ALL:=0x17, SCROLL_STEP:=10
    bar := msg=0x115 ; SB_HORZ=0, SB_VERT=1

    VarSetCapacity(si, 28, 0)
    NumPut(28, si, "UInt") ; cbSize
    NumPut(SIF_ALL, si, 4, "UInt") ; fMask
    if !DllCall("GetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si)
        return

    VarSetCapacity(rect, 16)
    DllCall("GetClientRect", Ptr, hwnd, Ptr, &rect)
    new_pos := NumGet(si, 20, "UInt") ; nPos
    action := wParam & 0xFFFF

    if action = 0 ; SB_LINEUP
        new_pos -= SCROLL_STEP
    else if action = 1 ; SB_LINEDOWN
        new_pos += SCROLL_STEP
    else if action = 2 ; SB_PAGEUP
        new_pos -= NumGet(rect, 12, "Int") - SCROLL_STEP
    else if action = 3 ; SB_PAGEDOWN
        new_pos += NumGet(rect, 12, "Int") - SCROLL_STEP
    else if (action = 5 || action = 4) ; SB_THUMBTRACK || SB_THUMBPOSITION
        new_pos := wParam>>16
    else if action = 6 ; SB_TOP
        new_pos := NumGet(si, 8, "Int") ; nMin
    else if action = 7 ; SB_BOTTOM
        new_pos := NumGet(si, 12, "Int") ; nMax
    else
        return
    min := NumGet(si, 8, "Int") ; nMin
    max := NumGet(si, 12, "Int") - NumGet(si, 16, "UInt") ; nMax-nPage
    new_pos := new_pos > max ? max : new_pos
    new_pos := new_pos < min ? min : new_pos

    old_pos := NumGet(si, 20, "Int") ; nPos

    y := old_pos-new_pos
    ; Scroll contents of window and invalidate uncovered area.

    DllCall("ScrollWindow", Ptr, hwnd, Int, 0, Int, y, UInt, 0, UInt, 0)

    ; Update scroll bar.
    NumPut(new_pos, si, 20, "Int") ; nPos

    DllCall("SetScrollInfo", Ptr, hwnd, Int, bar, Ptr, &si, Int, 1)
}

VSCROLL_To(hwnd, msg){
    WM_VSCROLL(msg, 0, WM_VSCROLL, hWnd)
}

WM_MOUSEWHEEL(hWnd, wp)
{
   Loop 4
      WM_VSCROLL(wp>>16 & 0xFFFF < 0x7FFF ? SB_LINEUP : SB_LINEDOWN, 0, WM_VSCROLL, hWnd)
}
Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

85

Re: AHK: Изменение текста с помощью GUI

yalanne пишет:

Исправил пару багов в своем коде.

Огромное вам спасибо!

86

Re: AHK: Изменение текста с помощью GUI

Не подскажите как сделать чтобы скрипт работал только на 1 компютере? Тоесть привязка к компютеру.

87

Re: AHK: Изменение текста с помощью GUI

Один вопрос - одна тема.

88

Re: AHK: Изменение текста с помощью GUI

Не подскажите как сделать пронумеровку чисел в строках ввода?
Добавил строку ввода ; НОВАЯ СТРОКА и кнопку ; НОВАЯ КНОПКА


Gui, Add, Edit, x585 y46 w60 h20 vmain_numb gsubmit, numb  ;                                       НОВАЯ СТРОКА
Gui, Add, Button, x645 y46 w20 h20 gAdd, № ;                                                               НОВАЯ КНОПКА
+ полный код

work=1
;Gui Font, cRed
Gui Show
Gui, Color,, ffef7d
Gui, +toolwindow
gui, font, 543724
Gui +Resize -MaximizeBox 
Gui, Color, 257de0
Gui, Add, Tab, x3 y6 w1030 h610 , 1|2|3|4|5|6|7|8|9|10|end
Gui, Add, GroupBox, x13 y70 w1010 h520 , main obl
Gui, Add, Button, x983 y116 w30 h100 gAdd, +
Gui, Tab, end
Gui, Add, Edit, x13 y36 w1010 h570 vEndText gsubmit, ПЛАНШЕТ ТЕКСТА
Gui, Tab, 1
Gui, Add, Edit, x13 y46 w570 h20 vmain_image gsubmit, http://postach.com.ua/image/data/1NEW/78/m100.1.jpg
Gui, Add, Edit, x585 y46 w60 h20 vmain_numb gsubmit, numb  ;                                        НОВАЯ СТРОКА
Gui, Add, Button, x645 y46 w20 h20 gAdd, № ;                                                               НОВАЯ КНОПКА
Gui, Add, Edit, x675 y46 w270 h20 vmain_name gsubmit, main name
Gui, Show, x129 y84 h629 w1044, New GUI Window
Return
GuiClose:
ExitApp


submit:
gui,submit,nohide

blocks=
loop,% blockNum
{

  image_1:=image%a_index%_1
  name_1:=name%a_index%_1
  image_2:=image%a_index%_2
  name_2:=name%a_index%_2
  image_3:=image%a_index%_3
  name_3:=name%a_index%_3

block=
(
<tr>
<td>
<a href="%image_1%" target="_blank"><img alt="" src="%image_1%" style="width: 311px; height: 400px;" /></a>
<p>
&nbsp;</p>
<p>
%name_1%</p>
</td>
<td>
<a href="%image_2%" target="_blank"><img alt="" src="%image_2%" style="width: 311px; height: 400px;" /></a>
<p>
&nbsp;</p>
<p>
%name_2%</p>
</td>
<td>
<a href="%image_3%" target="_blank"><img alt="" src="%image_3%" style="width: 311px; height: 400px;" /></a>
<p>
&nbsp;</p>
<p>
%name_3%</p>
</td>
</tr>
)

  blocks.=block
}

EndText=
(
<p>
    <style type="text/css">
.all p {
font-family:trebuchet ms,helvetica,sans-serif !important;
color: #444 !important;
font-size: 16px;
}
.hr {
border: 0px !important;
height: 2px !important;
background-color: #888 !important;
}
.big {
object-fit: contain !important;
width: 500px !important;
height: 500px !important;
overflow:hidden !important;
display: block !important;
margin-left: 190px !important;
margin-right: 190px !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
.strong {
color: rgb(0,0,0) !important;
font-size: 18px !important;
}
.alt {
font-style: oblique !important;
text-align: right !important;
font-size: 18px !important;
font-family: 'Times New Roman' !important;
}
.pri {
color: rgb(0,0,0) !important;
font-size: 36px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 10px !important;
margin-top: 40px !important;
}
.sec {
font-size: 28px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 6px !important;
margin-top: 40px !important;
}
.all a {
color: blue !important;
text-decoration: underline !important;
}
.order {
color: #f11 !important;
font-size: 24px !important;
font-family:trebuchet ms,helvetica,sans-serif !important;
text-decoration: underline !important;
text-transform: uppercase !important;
text-align: center !important;
margin: 30px !important;
}
.order a {
color: red !important;
}
.all table tbody tr td {
vertical-align: top !important;
}
.med {
width: 100`% !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 40px !important;
}
.med img {
object-fit: contain !important;
width: 250px !important;
height: 250px !important;
overflow:hidden !important;
display: block !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 0px !important;
margin-top: 14px !important;
vertical-align: top !important;
}
.med p {
text-align: center !important;
font-size:18px !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 14px !important;
margin-top: 7px !important;
width: 250px !important;
}
.small {
width: 100`% !important;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}
.small img {
object-fit: contain;
width: 195px !important;
height: 195px !important;
overflow:hidden;
display: block;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 0px;
margin-top: 15px;
vertical-align: top;
border-width: 0px;
border-style: solid;
border-color: black;
}
.small p {
text-align: center !important;
font-size:16px !important;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 10px;
margin-top: 5px;
width: 195px;
font-family:trebuchet ms,helvetica,sans-serif;
color: #444;
}    </style> 
</p>
<div class="all">
<p>
<a href="%main_image%" target="_blank"><img alt="" class="big" src="%main_image%" /></a></p>
<h1 class="order">
<a href="http://postach.com.ua/information/contact" target="_blank">Заказ +380673136554</a></h1>
<p class="pri">
%main_name%</p>
<hr />
</div>
<table border="0" cellpadding="1" cellspacing="1" class="med" style="width: 500px;">
<tbody>
%blocks%
</tbody>
    </table>
</div>
<p>
    &nbsp;</p>
)

GuiControl,,EndText,%EndText%
return



Add:
Num++
if num>5
{
  work++
  Num=1
}
blockNum++
tooltip,Блоков - %blockNum%`nСтраниц - %work%
Gui, Tab, %work%
Gui, Add, GroupBox, x23 y+20 w950 h100 , obl %blockNum%
Gui, Add, Edit, xm+30 yp+30 w290 h20 vimage%blockNum%_1 gsubmit, %blockNum%image 1
Gui, Add, Edit, x+5 yp w290 h20 vimage%blockNum%_2 gsubmit, %blockNum%image 2
Gui, Add, Edit, x+5 yp w290 h20 vimage%blockNum%_3 gsubmit, %blockNum%image 3
Gui, Add, Edit, xm+30 y+5 w290 h20 vname%blockNum%_1 gsubmit, %blockNum%name 1
Gui, Add, Edit, x+5 yp w290 h20 vname%blockNum%_2 gsubmit, %blockNum%name 2
Gui, Add, Edit, x+5 yp w290 h20 vname%blockNum%_3 gsubmit, %blockNum%name 3

gosub,submit
return

!d::
Gui, Show, AutoSize Center
return

Как сделать чтобы к примеру вписываю в новую строку число 5, нажимаю на новую кнопку и у всех существующих блоках в сроках ввода IMAGE цифра 5 нумеровалась от 5 и до количества строк ввода сколько создано. Пример: создаю 5 блоков в которых по 3 строки ввода IMAGE, ввожу в НОВУЮ СТРОКУ число 10, нажимаю на НОВУЮ КНОПКУ и число 10 нумеруется от 10 до 24 ( 15 строк ввода IMAGE). Пробовал через TAB , но много погрешностей получается.

89

Re: AHK: Изменение текста с помощью GUI

Ничего не понятно... чтобы отсчет всех блоков начинался с того числа?

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

90

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:

Ничего не понятно... чтобы отсчет всех блоков начинался с того числа?

Нет, просто чтобы при нажатии НОВОЙ КНОПКИ число нумеровалось (которое вписано в строку ввода НОВАЯ СТРОКА), тоесть : в строку IMAGE1 = 5 ,IMAGE2 = 6 , IMAGE3 = 7, IMAGE4 = 8 ,IMAGE5 = 9 ,IMAGE6 = 10 ,IMAGE7 = 11....
  Сейчас использую ручную вставку, вот код:

num := 0
SetKeyDelay, 0, 0
^xbutton1::
send %num%
num++
return

Просто нумерованный текст отправляеться в строки ввода IMAGE, по увеличению от того числа что вписано в строке ; НОВАЯ СТРОКА.

91

Re: AHK: Изменение текста с помощью GUI

число нумеровалось

Это словосочетание вызывает ошибку у меня в мозгу, и приложение дешифровки вопросов закрывается.
Перефразируй.
...
Чтобы в строки с "Image" во всех блоках вписывались числа по очереди, начиная с указанного?
Например так:вводим в "НОВАЯ СТРОКА" число 5; вместо "1image 1" - записывается 5; вместо "2image 1" - 6; и т.д.?

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

92 (изменено: niceice, 2015-07-23 17:37:11)

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:

Чтобы в строки с "Image" во всех блоках вписывались числа по очереди, начиная с указанного?
Например так:вводим в "НОВАЯ СТРОКА" число 5; вместо "1image 1" - записывается 5; вместо "2image 1" - 6; и т.д.?

Да, все так. Простите за то, что не умею выразить свои мысли и спасибо что постарались меня понять.

93 (изменено: Alectric, 2015-07-23 18:07:24)

Re: AHK: Изменение текста с помощью GUI

Так, если я правильно понял:

work=1
;Gui Font, cRed
Gui, Add, Button, x983 y116 w30 h100 gAdd, +
Gui, Add, Edit, x13 y46 w570 h20 vmain_image gsubmit, http://postach.com.ua/image/data/1NEW/78/m100.1.jpg
Gui, Add, Edit, x585 y46 w60 h20 vmain_numb, numb  ;                                        НОВАЯ СТРОКА
Gui, Add, Button, x645 y46 w20 h20 gChengeNum, № ;                                                               НОВАЯ КНОПКА
Gui, Add, Edit, x675 y46 w270 h20 vmain_name gsubmit, main name
gui,add,text,x950 y76 h20,Блоков -  ;
gui,add,text,x+5 yp w30 h20 vblockNum,0
gui,add,text,x950 y96 h20,Страниц -  ;
gui,add,text,x+5 yp w20 h20 vwork,0
Gui, Color,, ffef7d
;Gui, +toolwindow
gui, font, 543724
Gui +Resize -MaximizeBox
Gui, Color, 257de0
Gui, Add, Tab, x3 y6 w1030 h610 , 1|2|3|4|5|6|7|8|9|10|end
Gui, Tab, end
Gui, Add, Edit, x13 y122 w950 h483 vEndText gsubmit, ПЛАНШЕТ ТЕКСТА
Gui, Show, x129 y84 h629 w1044, New GUI Window
Return
GuiClose:
ExitApp

submit:
gui,submit,nohide
blocks=
loop,% blockNum
{
  image_1:=image%a_index%_1
  name_1:=name%a_index%_1
  image_2:=image%a_index%_2
  name_2:=name%a_index%_2
  image_3:=image%a_index%_3
  name_3:=name%a_index%_3
block=
(
<tr>
                <td>
                    <a href="%image_1%" target="_blank"><img alt="" src="%image_1%" style="width: 311px; height: 400px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_1%</p>
                </td>
                <td>
                    <a href="%image_2%" target="_blank"><img alt="" src="%image_2%" style="width: 311px; height: 400px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_2%</p>
                </td>
                <td>
                    <a href="%image_3%" target="_blank"><img alt="" src="%image_3%" style="width: 311px; height: 400px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_3%</p>
                </td>
            </tr>
)
  blocks.=block
}
EndText=
(
<p>
    <style type="text/css">
.all p {
font-family:trebuchet ms,helvetica,sans-serif !important;
color: #444 !important;
font-size: 16px;
}
.hr {
border: 0px !important;
height: 2px !important;
background-color: #888 !important;
}
.big {
object-fit: contain !important;
width: 500px !important;
height: 500px !important;
overflow:hidden !important;
display: block !important;
margin-left: 190px !important;
margin-right: 190px !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
.strong {
color: rgb(0,0,0) !important;
font-size: 18px !important;
}
.alt {
font-style: oblique !important;
text-align: right !important;
font-size: 18px !important;
font-family: 'Times New Roman' !important;
}
.pri {
color: rgb(0,0,0) !important;
font-size: 36px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 10px !important;
margin-top: 40px !important;
}
.sec {
font-size: 28px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 6px !important;
margin-top: 40px !important;
}
.all a {
color: blue !important;
text-decoration: underline !important;
}
.order {
color: #f11 !important;
font-size: 24px !important;
font-family:trebuchet ms,helvetica,sans-serif !important;
text-decoration: underline !important;
text-transform: uppercase !important;
text-align: center !important;
margin: 30px !important;
}
.order a {
color: red !important;
}
.all table tbody tr td {
vertical-align: top !important;
}
.med {
width: 100`% !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 40px !important;
}
.med img {
object-fit: contain !important;
width: 250px !important;
height: 250px !important;
overflow:hidden !important;
display: block !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 0px !important;
margin-top: 14px !important;
vertical-align: top !important;
}
.med p {
text-align: center !important;
font-size:18px !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 14px !important;
margin-top: 7px !important;
width: 250px !important;
}
.small {
width: 100`% !important;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}
.small img {
object-fit: contain;
width: 195px !important;
height: 195px !important;
overflow:hidden;
display: block;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 0px;
margin-top: 15px;
vertical-align: top;
border-width: 0px;
border-style: solid;
border-color: black;
}
.small p {
text-align: center !important;
font-size:16px !important;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 10px;
margin-top: 5px;
width: 195px;
font-family:trebuchet ms,helvetica,sans-serif;
color: #444;
}    </style>
</p>
<div class="all">
    <p>
        <a href="%main_image%" target="_blank"><img alt="" class="big" src="%main_image%" /></a></p>
    <h1 class="order">
        <a href="http://postach.com.ua/information/contact" target="_blank">Заказ +380673136554</a></h1>
    <p class="pri">
        %main_name%</p>
    <hr />
</div>
<table border="0" cellpadding="1" cellspacing="1" class="med" style="width: 500px;">
    <tbody>
%blocks%
</tbody>
    </table>
</div>
<p>
    &nbsp;</p>
)
GuiControl,,EndText,%EndText%
return


ChengeNum:
gui,submit,nohide
if !main_numb
  return
if main_numb
{
  loop,% blockNum
  {
    critical
    tooltip,% a_index
    GuiControl,,image%a_index%_1,% main_numb "`n" test
    main_numb++
  }
  tooltip
  gosub,submit
}
return

Add:
Num++
if num>5
{
  work++
  Num=1
}
blockNum++
GuiControl,,blockNum,% blockNum
GuiControl,,work,% work
Gui, Tab, %work%
if Num=1
  Gui, Add, GroupBox, x23 y+90 w950 h100 , obl %blockNum%
else
  Gui, Add, GroupBox, x23 y+20 w950 h100 , obl %blockNum%
Gui, Add, Edit, xm+30 yp+30 w290 h20 vimage%blockNum%_1 gsubmit, %blockNum%image 1
Gui, Add, Edit, x+5 yp w290 h20 vimage%blockNum%_2 gsubmit, %blockNum%image 2
Gui, Add, Edit, x+5 yp w290 h20 vimage%blockNum%_3 gsubmit, %blockNum%image 3
Gui, Add, Edit, xm+30 y+5 w290 h20 vname%blockNum%_1 gsubmit, %blockNum%name 1
Gui, Add, Edit, x+5 yp w290 h20 vname%blockNum%_2 gsubmit, %blockNum%name 2
Gui, Add, Edit, x+5 yp w290 h20 vname%blockNum%_3 gsubmit, %blockNum%name 3
gosub,submit
return

!d::
Gui, Show, AutoSize Center
return
Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

94 (изменено: niceice, 2015-07-23 23:01:25)

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:

Так, если я правильно понял:

И так и не так.
Нумерует цифры только в первых строках ввода IMAGE 1, а IMAGE 2 и IMAGE 3 пропускает.

http://cs627325.vk.me/v627325742/f09f/YI21ihdBPSs.jpg

95 (изменено: Alectric, 2015-07-24 16:22:42)

Re: AHK: Изменение текста с помощью GUI

Исправил ошибку - переменные записывались с ентером в конце:

work=1
;Gui Font, cRed
Gui, Add, Button, x983 y116 w30 h100 gAdd, +
Gui, Add, Edit, x13 y46 w570 h20 vmain_image gsubmit, http://postach.com.ua/image/data/1NEW/78/m100.1.jpg
Gui, Add, Edit, x585 y46 w60 h20 number vmain_numb, numb  ;                                        НОВАЯ СТРОКА
Gui, Add, Button, x645 y46 w20 h20 gChengeNum, № ;                                                               НОВАЯ КНОПКА
Gui, Add, Edit, x675 y46 w270 h20 vmain_name gsubmit, main name
gui,add,text,x950 y76 h20,Блоков -  ;
gui,add,text,x+5 yp w30 h20 vblockNum,0
gui,add,text,x950 y96 h20,Страниц -  ;
gui,add,text,x+5 yp w20 h20 vwork,0
Gui, Color,, ffef7d
;Gui, +toolwindow
gui, font, 543724
Gui +Resize -MaximizeBox
Gui, Color, 257de0
Gui, Add, Tab, x3 y6 w1030 h610 , 1|2|3|4|5|6|7|8|9|10|end
Gui, Tab, end
Gui, Add, Edit, x13 y122 w950 h483 vEndText gsubmit, ПЛАНШЕТ ТЕКСТА
Gui, Show, x129 y84 h629 w1044, New GUI Window
Return
GuiClose:
ExitApp

submit:
gui,submit,nohide
blocks=
loop,% blockNum
{
  image_1:=image%a_index%_1
  name_1:=name%a_index%_1
  image_2:=image%a_index%_2
  name_2:=name%a_index%_2
  image_3:=image%a_index%_3
  name_3:=name%a_index%_3
loop,3
  stringreplace,image_%a_index%,image_%a_index%,`n,,all
loop,3
  stringreplace,name_%a_index%,name_%a_index%,`n,,all
block=
(
<tr>
                <td>
                    <a href="%image_1%" target="_blank"><img alt="" src="%image_1%" style="width: 311px; height: 400px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_1%</p>
                </td>
                <td>
                    <a href="%image_2%" target="_blank"><img alt="" src="%image_2%" style="width: 311px; height: 400px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_2%</p>
                </td>
                <td>
                    <a href="%image_3%" target="_blank"><img alt="" src="%image_3%" style="width: 311px; height: 400px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_3%</p>
                </td>
            </tr>
)
  blocks.=block
}
EndText=
(
<p>
    <style type="text/css">
.all p {
font-family:trebuchet ms,helvetica,sans-serif !important;
color: #444 !important;
font-size: 16px;
}
.hr {
border: 0px !important;
height: 2px !important;
background-color: #888 !important;
}
.big {
object-fit: contain !important;
width: 500px !important;
height: 500px !important;
overflow:hidden !important;
display: block !important;
margin-left: 190px !important;
margin-right: 190px !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
.strong {
color: rgb(0,0,0) !important;
font-size: 18px !important;
}
.alt {
font-style: oblique !important;
text-align: right !important;
font-size: 18px !important;
font-family: 'Times New Roman' !important;
}
.pri {
color: rgb(0,0,0) !important;
font-size: 36px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 10px !important;
margin-top: 40px !important;
}
.sec {
font-size: 28px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 6px !important;
margin-top: 40px !important;
}
.all a {
color: blue !important;
text-decoration: underline !important;
}
.order {
color: #f11 !important;
font-size: 24px !important;
font-family:trebuchet ms,helvetica,sans-serif !important;
text-decoration: underline !important;
text-transform: uppercase !important;
text-align: center !important;
margin: 30px !important;
}
.order a {
color: red !important;
}
.all table tbody tr td {
vertical-align: top !important;
}
.med {
width: 100`% !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 40px !important;
}
.med img {
object-fit: contain !important;
width: 250px !important;
height: 250px !important;
overflow:hidden !important;
display: block !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 0px !important;
margin-top: 14px !important;
vertical-align: top !important;
}
.med p {
text-align: center !important;
font-size:18px !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 14px !important;
margin-top: 7px !important;
width: 250px !important;
}
.small {
width: 100`% !important;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}
.small img {
object-fit: contain;
width: 195px !important;
height: 195px !important;
overflow:hidden;
display: block;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 0px;
margin-top: 15px;
vertical-align: top;
border-width: 0px;
border-style: solid;
border-color: black;
}
.small p {
text-align: center !important;
font-size:16px !important;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 10px;
margin-top: 5px;
width: 195px;
font-family:trebuchet ms,helvetica,sans-serif;
color: #444;
}    </style>
</p>
<div class="all">
    <p>
        <a href="%main_image%" target="_blank"><img alt="" class="big" src="%main_image%" /></a></p>
    <h1 class="order">
        <a href="http://postach.com.ua/information/contact" target="_blank">Заказ +380673136554</a></h1>
    <p class="pri">
        %main_name%</p>
    <hr />
</div>
<table border="0" cellpadding="1" cellspacing="1" class="med" style="width: 500px;">
    <tbody>
%blocks%
</tbody>
    </table>
</div>
<p>
    &nbsp;</p>
)
GuiControl,,EndText,%EndText%
return


ChengeNum:
gui,submit,nohide
if main_numb
{
  loop,% blockNum
  {
    critical
    tmp:=a_index
    loop,3
    {
      GuiControl,,image%tmp%_%a_index%,% main_numb "`n" test
      main_numb++
    }
  }
  tooltip
  gosub,submit
}
return

Add:
Num++
if num>5
{
  work++
  Num=1
}
blockNum++
GuiControl,,blockNum,% blockNum
GuiControl,,work,% work
Gui, Tab, %work%
if Num=1
  Gui, Add, GroupBox, x23 y+90 w950 h100 , obl %blockNum%
else
  Gui, Add, GroupBox, x23 y+20 w950 h100 , obl %blockNum%
Gui, Add, Edit, xm+30 yp+30 w290 h20 vimage%blockNum%_1 gsubmit, %blockNum%image 1
Gui, Add, Edit, x+5 yp w290 h20 vimage%blockNum%_2 gsubmit, %blockNum%image 2
Gui, Add, Edit, x+5 yp w290 h20 vimage%blockNum%_3 gsubmit, %blockNum%image 3
Gui, Add, Edit, xm+30 y+5 w290 h20 vname%blockNum%_1 gsubmit, %blockNum%name 1
Gui, Add, Edit, x+5 yp w290 h20 vname%blockNum%_2 gsubmit, %blockNum%name 2
Gui, Add, Edit, x+5 yp w290 h20 vname%blockNum%_3 gsubmit, %blockNum%name 3
gosub,submit
return

!d::
Gui, Show, AutoSize Center
return

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

96

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:

Исправил ошибку - переменные записывались с ентером в конце:

Большое спасибо!
Что тут нужно добавить

ChengeNum:
gui,submit,nohide
if main_numb
{
  loop,% blockNum
  {
    critical
    tmp:=a_index
    loop,3
    {
      GuiControl,,image%tmp%_%a_index%,% main_numb "`n" test
      main_numb++
    }
  }
  tooltip
  gosub,submit
}
return

Чтобы с числом писало буквы к примеру: go15. Буквы всегда те же будут.

97 (изменено: Alectric, 2015-07-24 16:39:24)

Re: AHK: Изменение текста с помощью GUI

      GuiControl,,image%tmp%_%a_index%,% main_numb "`n" test

      |
      V

      GuiControl,,image%tmp%_%a_index%,% "go" main_numb

или

      GuiControl,,image%tmp%_%a_index%,любой текст %main_numb%
Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

98

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:
      GuiControl,,image%tmp%_%a_index%,% main_numb "`n" test

      |
      V

      GuiControl,,image%tmp%_%a_index%,% "go" main_numb

или

      GuiControl,,image%tmp%_%a_index%,любой текст %main_numb%

Идеально! Очень вам благодарен!

99

Re: AHK: Изменение текста с помощью GUI

А лучше так:

work=1
;Gui Font, cRed
Gui, Add, Button, x983 y116 w30 h100 gAdd, +
Gui, Add, Edit, x13 y46 w500 h20 vmain_image gsubmit, http://postach.com.ua/image/data/1NEW/78/m100.1.jpg
Gui, Add, Edit, x+5 y46 w60 h20 vmain_text, text  ;                                        НОВАЯ СТРОКА
Gui, Add, Edit, x+5 y46 w60 h20 number vmain_numb, numb  ;                                        НОВАЯ СТРОКА
Gui, Add, Button, x+1 y46 w20 h20 gChengeNum, № ;                                                               НОВАЯ КНОПКА
Gui, Add, Edit, x+5 y46 w270 h20 vmain_name gsubmit, main name
gui,add,text,x950 y76 h20,Блоков -  ;
gui,add,text,x+5 yp w30 h20 vblockNum,0
gui,add,text,x950 y96 h20,Страниц -  ;
gui,add,text,x+5 yp w20 h20 vwork,0
Gui, Color,, ffef7d
;Gui, +toolwindow
gui, font, 543724
Gui +Resize -MaximizeBox
Gui, Color, 257de0
Gui, Add, Tab, x3 y6 w1030 h610 , 1|2|3|4|5|6|7|8|9|10|end
Gui, Tab, end
Gui, Add, Edit, x13 y122 w950 h483 vEndText gsubmit, ПЛАНШЕТ ТЕКСТА
Gui, Show, x129 y84 h629 w1044, New GUI Window
Return
GuiClose:
ExitApp

submit:
gui,submit,nohide
blocks=
loop,% blockNum
{
  image_1:=image%a_index%_1
  name_1:=name%a_index%_1
  image_2:=image%a_index%_2
  name_2:=name%a_index%_2
  image_3:=image%a_index%_3
  name_3:=name%a_index%_3
loop,3
  stringreplace,image_%a_index%,image_%a_index%,`n,,all
loop,3
  stringreplace,name_%a_index%,name_%a_index%,`n,,all
block=
(
<tr>
                <td>
                    <a href="%image_1%" target="_blank"><img alt="" src="%image_1%" style="width: 311px; height: 400px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_1%</p>
                </td>
                <td>
                    <a href="%image_2%" target="_blank"><img alt="" src="%image_2%" style="width: 311px; height: 400px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_2%</p>
                </td>
                <td>
                    <a href="%image_3%" target="_blank"><img alt="" src="%image_3%" style="width: 311px; height: 400px;" /></a>
                    <p>
                        &nbsp;</p>
                    <p>
                        %name_3%</p>
                </td>
            </tr>
)
  blocks.=block
}
EndText=
(
<p>
    <style type="text/css">
.all p {
font-family:trebuchet ms,helvetica,sans-serif !important;
color: #444 !important;
font-size: 16px;
}
.hr {
border: 0px !important;
height: 2px !important;
background-color: #888 !important;
}
.big {
object-fit: contain !important;
width: 500px !important;
height: 500px !important;
overflow:hidden !important;
display: block !important;
margin-left: 190px !important;
margin-right: 190px !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
.strong {
color: rgb(0,0,0) !important;
font-size: 18px !important;
}
.alt {
font-style: oblique !important;
text-align: right !important;
font-size: 18px !important;
font-family: 'Times New Roman' !important;
}
.pri {
color: rgb(0,0,0) !important;
font-size: 36px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 10px !important;
margin-top: 40px !important;
}
.sec {
font-size: 28px !important;
text-transform: uppercase !important;
text-align: center !important;
margin-bottom: 6px !important;
margin-top: 40px !important;
}
.all a {
color: blue !important;
text-decoration: underline !important;
}
.order {
color: #f11 !important;
font-size: 24px !important;
font-family:trebuchet ms,helvetica,sans-serif !important;
text-decoration: underline !important;
text-transform: uppercase !important;
text-align: center !important;
margin: 30px !important;
}
.order a {
color: red !important;
}
.all table tbody tr td {
vertical-align: top !important;
}
.med {
width: 100`% !important;
margin-left: auto !important;
margin-right: auto !important;
margin-bottom: 40px !important;
}
.med img {
object-fit: contain !important;
width: 250px !important;
height: 250px !important;
overflow:hidden !important;
display: block !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 0px !important;
margin-top: 14px !important;
vertical-align: top !important;
}
.med p {
text-align: center !important;
font-size:18px !important;
margin-left: 15px !important;
margin-right: 15px !important;
margin-bottom: 14px !important;
margin-top: 7px !important;
width: 250px !important;
}
.small {
width: 100`% !important;
margin-left: auto;
margin-right: auto;
margin-bottom: 30px;
}
.small img {
object-fit: contain;
width: 195px !important;
height: 195px !important;
overflow:hidden;
display: block;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 0px;
margin-top: 15px;
vertical-align: top;
border-width: 0px;
border-style: solid;
border-color: black;
}
.small p {
text-align: center !important;
font-size:16px !important;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 10px;
margin-top: 5px;
width: 195px;
font-family:trebuchet ms,helvetica,sans-serif;
color: #444;
}    </style>
</p>
<div class="all">
    <p>
        <a href="%main_image%" target="_blank"><img alt="" class="big" src="%main_image%" /></a></p>
    <h1 class="order">
        <a href="http://postach.com.ua/information/contact" target="_blank">Заказ +380673136554</a></h1>
    <p class="pri">
        %main_name%</p>
    <hr />
</div>
<table border="0" cellpadding="1" cellspacing="1" class="med" style="width: 500px;">
    <tbody>
%blocks%
</tbody>
    </table>
</div>
<p>
    &nbsp;</p>
)
GuiControl,,EndText,%EndText%
return


ChengeNum:
gui,submit,nohide
if main_numb
{
  loop,% blockNum
  {
    critical
    tmp:=a_index
    loop,3
    {
      GuiControl,,image%tmp%_%a_index%,% main_text . main_numb
      main_numb++
    }
  }
  tooltip
  gosub,submit
}
return

Add:
Num++
if num>5
{
  work++
  Num=1
}
blockNum++
GuiControl,,blockNum,% blockNum
GuiControl,,work,% work
Gui, Tab, %work%
if Num=1
  Gui, Add, GroupBox, x23 y+90 w950 h100 , obl %blockNum%
else
  Gui, Add, GroupBox, x23 y+20 w950 h100 , obl %blockNum%
Gui, Add, Edit, xm+30 yp+30 w290 h20 vimage%blockNum%_1 gsubmit, %blockNum%image 1
Gui, Add, Edit, x+5 yp w290 h20 vimage%blockNum%_2 gsubmit, %blockNum%image 2
Gui, Add, Edit, x+5 yp w290 h20 vimage%blockNum%_3 gsubmit, %blockNum%image 3
Gui, Add, Edit, xm+30 y+5 w290 h20 vname%blockNum%_1 gsubmit, %blockNum%name 1
Gui, Add, Edit, x+5 yp w290 h20 vname%blockNum%_2 gsubmit, %blockNum%name 2
Gui, Add, Edit, x+5 yp w290 h20 vname%blockNum%_3 gsubmit, %blockNum%name 3
gosub,submit
return

!d::
Gui, Show, AutoSize Center
return

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.

100

Re: AHK: Изменение текста с помощью GUI

Alectric пишет:

А лучше так:

Хороший вариант, сохраню на всякий случай

Есть еще одна проблема, но думаю это займет много времени вашего, я напишу ее здесь и если когда-то будете иметь время то поможете надеюсь.