Jump to content

Problem witch GuiCtrlCreateLabel()


MrKris7100
 Share

Recommended Posts

Hi, I have a small problem...

I create console in autoit and have this code:
 

#NoTrayIcon
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>
$CMD_BLACK = "0x000000"
$CMD_BLUE = "0x000080"
$CMD_GREEN = "0x008000"
$CMD_CYAN = "0x008080"
$CMD_RED = "0x800000"
$CMD_MAGENTA = "0x800080"
$CMD_BROWN = "0x808000"
$CMD_GREY = "0x808080"
$CMD_YELLOW = "0xFFFF00"
$CMD_ORANGE = "0xFF8000"
$CMD_WHITE = "0xFFFFFF"
$CMD_LIGHTGREY = "0xC0C0C0"
$CMD_LIGHTBLUE = "0x0000FF"
$CMD_LIGHTGREEN = "0x00FF00"
$CMD_LIGHTCYAN = "0x00FFFF"
$CMD_LIGHTRED = "0xFF0000"
$CMD_LIGHTMAGENTA = "0xFF00FF"
$GUI = GUICreate("ABatchIt RPG",80*8,50*12)
GUISetBkColor($CMD_BLACK)
GUISetState(@SW_SHOW)
$menu = Fill("          ABatchIt RPG Menu            ",$CMD_WHITE,$CMD_LIGHTBLUE,20,2,40,1)
$menu1 = Fill("█",$CMD_WHITE,$CMD_BLACK,20,3,40,3)
Sleep(5000)


;Func Fill(tekst, kolor:liter, kolor:tło,x,y,rozmiar:x,rozmiar:y)
Func Fill($FuncLine1,$FuncLine2,$FuncLine3,$FuncLine4,$FuncLine5,$FuncLine6,$FuncLine7)
    Local $Return
    Local $Buffer = StringLeft(_StringRepeat($FuncLine1,$FuncLine6),$FuncLine6)
    If Not $FuncLine7 = 0 Then
        For $i = 1 To $FuncLine7 - 1
            $Buffer&=@CRLF&$Buffer
        Next
    EndIf
    Local $Return = GUICtrlCreateLabel($Buffer,($FuncLine4 - 1)*8,($FuncLine5 - 1)*12,$FuncLine6*8,$FuncLine7*12)
    GUICtrlSetFont($Return, 10, 400, 0, "Lucida Console")
    GUICtrlSetBkColor($Return,$FuncLine3)
    GUICtrlSetColor($Return,$FuncLine2)
    Return($Return)
EndFunc

It work. When I change it:
 

$menu1 = Fill("█",$CMD_WHITE,$CMD_BLACK,20,3,40,3)

on it:
 

$menu1 = Fill("█",$CMD_WHITE,$CMD_BLACK,20,3,40,14)

don't work... please help me it's very important for me

Edited by MrKris7100
Link to comment
Share on other sites

You are creating multiple lines with your function... take a look

#NoTrayIcon
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>
$CMD_BLACK = "0x000000"
$CMD_BLUE = "0x000080"
$CMD_GREEN = "0x008000"
$CMD_CYAN = "0x008080"
$CMD_RED = "0x800000"
$CMD_MAGENTA = "0x800080"
$CMD_BROWN = "0x808000"
$CMD_GREY = "0x808080"
$CMD_YELLOW = "0xFFFF00"
$CMD_ORANGE = "0xFF8000"
$CMD_WHITE = "0xFFFFFF"
$CMD_LIGHTGREY = "0xC0C0C0"
$CMD_LIGHTBLUE = "0x0000FF"
$CMD_LIGHTGREEN = "0x00FF00"
$CMD_LIGHTCYAN = "0x00FFFF"
$CMD_LIGHTRED = "0xFF0000"
$CMD_LIGHTMAGENTA = "0xFF00FF"
$GUI = GUICreate("ABatchIt RPG",80*8,50*12)
GUISetBkColor($CMD_BLACK)
GUISetState(@SW_SHOW)
$menu = Fill("          ABatchIt RPG Menu            ",$CMD_WHITE,$CMD_LIGHTBLUE,20,2,40,14)
$menu1 = Fill("¦",$CMD_WHITE,$CMD_BLACK,20,20,40,14)
Sleep(5000)
 
 
;Func Fill(tekst, kolor:liter, kolor:tlo,x,y,rozmiar:x,rozmiar:y)
Func Fill($FuncLine1,$FuncLine2,$FuncLine3,$FuncLine4,$FuncLine5,$FuncLine6,$FuncLine7)
    Local $Return
    Local $Buffer = StringLeft(_StringRepeat($FuncLine1,$FuncLine6),$FuncLine6)
    If Not $FuncLine7 = 0 Then
        For $i = 1 To $FuncLine7 - 1
            $Buffer&=@CRLF&$Buffer
        Next
    EndIf
    Local $Return = GUICtrlCreateLabel($Buffer,($FuncLine4 - 1)*8,($FuncLine5 - 1)*12,$FuncLine6*8,$FuncLine7*12)
    GUICtrlSetFont($Return, 10, 400, 0, "Lucida Console")
    GUICtrlSetBkColor($Return,$FuncLine3)
    GUICtrlSetColor($Return,$FuncLine2)
    Return($Return)
EndFunc

NEWHeader1.png

Link to comment
Share on other sites

  • Moderators

MrKris7100,

Firstly we use English here, so writing in Polish when you report something is not a very clever idea. :naughty:

Secondly, why did you even report Valuater's post? You claimed it was spam - it looks to me as if he is trying to help. :wacko:

And finally, now I have been forced to look at this thread I see "ABatchIt RPG Menu" in your script. That to me spells "game" - which as I am sure you know means that this thread is not allowed under the Forum rules. Any reason why I should not lock the thread? :huh:

Not a terribly good idea to report that post, was it? I would make sure your brain is engaged before you do it again. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

MrKris7100,

On this forum, whan a Mod asks you a question it is advisable to respond rather than ignore it completely. So the answer to your question is "No" becasue the thread is now locked. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

MrKris7100,

And sending me PMs like the one you just have does you no good at all - permanently banned. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...