Jump to content

Bug Or Me = Dumb


Recommended Posts

Hey,

Try running this code as it is.. Looks fine eh? Now try to run it but change $gui_line[2] = "Numer telefonu wewnętry: " to $gui_line[2] = "Numer telefonu wewnętrzy: ". Just one little letter 'z' in that line and the whole word wewnetrzny is gone...

#include <INet.au3>
#include <file.au3>
#include <array.au3>
#include <GUIConstants.au3>
;==================================================================
; VARIABLES FOR GUI
;==================================================================
Dim $position1 = 15, $position2 = 30; First "check"
Dim $position3 = 310, $position5 = 5, $position6 = 30
Dim $position10 = 90, $position11 = 320; Autor's positioning
Dim $lenght1 = 150, $height1 = 15
Dim $lenght2 = 399, $height2 = 50
Global $label[100]
Global $button[4]
Dim $version = "0.3.1", $autor = ""

;==================================================================
;  MENU
;==================================================================
Global $button[20]
Global $gui_line[20]
$gui_line[1] = "Imię i nazwisko: "
$gui_line[2] = "Numer telefonu wewnętry: "
$gui_line[3] = "Numer telefonu - biurko: "
$gui_line[4] = "Numer telefonu - komórka: "
$gui_line[5] = "SKO pracownika: "
$gui_line[6] = " "
$gui_line[7] = " "
$gui_line[8] = " "
$gui_line[9] = " "


Global $ReadOutput, $AdressOutput, $picture_width, $picture_height, $username, $picture_temp_dir
Global $tempname[10], $file[10], $group[10], $pic[10], $version = "0.2", $name = "Something"

 Opt("GUICoordMode", 1)
    GuiCreate("Something - Searcher! ", 300, 270)
    $group[1] = GUICtrlCreateGroup ("Info:", 10, 10, 200, 220)
    GUIStartGroup()
   ; Obrazek
   ;$Pic[1] = GuiCtrlCreatePic($picture_temp_dir, 0, 0, $picture_width, $picture_height)
    $label[99] = GUICtrlCreateLabel ("",  $position10, $position11, 300, 15)
    GUICtrlSetData ($label[99], "Program written by: " & $autor,$GUI_SHOW )
    GUICtrlSetFont ($label[99],9, 400, 0, "Tahoma")
    GUICtrlSetState($label[99],$GUI_DISABLE)
   ;===================== LABELS
    $label[1] = GUICtrlCreateLabel ("",  $position1, $position2, $lenght1, 15)
    $label[2] = GUICtrlCreateLabel ("",  $position1, $position2+25, $lenght1, 15)
    $label[3] = GUICtrlCreateLabel ("",  $position1, $position2+50, $lenght1, 15)
    $label[4] = GUICtrlCreateLabel ("",  $position1, $position2+75, $lenght1, 15)
    $label[5] = GUICtrlCreateLabel ("",  $position1, $position2+100, $lenght1, 15)
    $label[6] = GUICtrlCreateLabel ("",  $position1, $position2+125, $lenght1, 15)
   
    $label[21] = GUICtrlCreateLabel ("",  $position3, $position2, $lenght1, 15)
    $label[22] = GUICtrlCreateLabel ("",  $position3, $position2+25, $lenght1, 15)
    $label[23] = GUICtrlCreateLabel ("",  $position3, $position2+50, $lenght1, 15)
    $label[24] = GUICtrlCreateLabel ("",  $position3, $position2+75, $lenght1, 15)
    $label[25] = GUICtrlCreateLabel ("",  $position3, $position2+100, $lenght1, 15)
    $label[26] = GUICtrlCreateLabel ("",  $position3, $position2+125, $lenght1, 15)
    $button[1] = GUICtrlCreateButton ($gui_line[15], 120, 275, 160, 40)
    GUICtrlSetState($button[1],$GUI_HIDE)
   ; FINISH LINE
;   GuiCtrlCreateGraphic(5, 165, 40,80)
;   GUICtrlSetGraphic(-1,$GUI_GR_LINE, 395,0)
;   GuiCtrlCreateGraphic(5, 200, 40,30)
;   GUICtrlSetGraphic(-1,$GUI_GR_LINE, 395,0)
    $label[50] = GUICtrlCreateLabel ("",  $position1+50, $position2+180, 300, 15)
    $label[51] = GUICtrlCreateLabel ("",  $position1+80, $position2+200, 300, 15)
    $label[54] = GUICtrlCreateLabel ("",  $position1+70, $position2+220, 300, 15)
    $label[55] = GUICtrlCreateLabel ("",  $position1+127, $position2+240, 300, 15)
    For $a = 1 to 7 Step +1
;    GUICtrlSetColor($label[$a],0x8080ff)
;   GUICtrlSetFont ($button[$a],9, 400, 0, "Tahoma")
          GUICtrlSetFont ($label[$a],9, 400, 0, "Tahoma")
    Next
    For $a = 21 to 27 Step +1
     GUICtrlSetColor($label[$a],0x1090ff)
;   GUICtrlSetFont ($button[$a],9, 400, 0, "Tahoma")
          GUICtrlSetFont ($label[$a],9, 400, 0, "Tahoma")
    Next
    For $a = 50 to 55 Step +1
    ;GUICtrlSetColor($label[$a],0x1090ff)
;   GUICtrlSetFont ($button[$a],9, 400, 0, "Tahoma")
          GUICtrlSetFont ($label[$a],9, 400, 4, "Tahoma")
    Next
    GUICtrlSetData( $label[1], $gui_line[1],$GUI_SHOW )
    GUICtrlSetData( $label[2], $gui_line[2],$GUI_SHOW )
    GUICtrlSetData( $label[3], $gui_line[3],$GUI_SHOW )
    GUICtrlSetData( $label[4], $gui_line[4],$GUI_SHOW )
    GUICtrlSetData( $label[5], $gui_line[5],$GUI_SHOW )
    GUICtrlSetData( $label[6], $gui_line[6],$GUI_SHOW )
GUISetState ()  
    
    While 1
     $msg = GUIGetMsg()
     Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
     EndSelect
 WEnd

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

It seems that when the gui_line exceed the number of chars that can be shown on screen in given field whole word is cut instead of just few chars..

It's not cut out, it's wrapped, and the height isn't set to see the next line, try setting the style to no wrap

#include <INet.au3>
#include <file.au3>
#include <array.au3>
#include <GUIConstants.au3>
;==================================================================
; VARIABLES FOR GUI
;==================================================================
Dim $position1 = 15, $position2 = 30; First "check"
Dim $position3 = 310, $position5 = 5, $position6 = 30
Dim $position10 = 90, $position11 = 320; Autor's positioning
Dim $lenght1 = 150, $height1 = 15
Dim $lenght2 = 399, $height2 = 50
Global $label[100]
Global $button[4]
Dim $version = "0.3.1", $autor = ""

;==================================================================
;  MENU
;==================================================================
Global $button[20]
Global $gui_line[20]
$gui_line[1] = "Imie i nazwisko: "
$gui_line[2] = "Numer telefonu wewnetryz: "
$gui_line[3] = "Numer telefonu - biurko: "
$gui_line[4] = "Numer telefonu - komórka: "
$gui_line[5] = "SKO pracownika: "
$gui_line[6] = " "
$gui_line[7] = " "
$gui_line[8] = " "
$gui_line[9] = " "


Global $ReadOutput, $AdressOutput, $picture_width, $picture_height, $username, $picture_temp_dir
Global $tempname[10], $file[10], $group[10], $pic[10], $version = "0.2", $name = "Something"

Opt("GUICoordMode", 1)
GUICreate("Something - Searcher! ", 300, 270)
$group[1] = GUICtrlCreateGroup("Info:", 10, 10, 200, 220)
GUIStartGroup()
; Obrazek
;$Pic[1] = GuiCtrlCreatePic($picture_temp_dir, 0, 0, $picture_width, $picture_height)
$label[99] = GUICtrlCreateLabel("", $position10, $position11, 300, 15)
GUICtrlSetData($label[99], "Program written by: " & $autor, $GUI_SHOW)
GUICtrlSetFont($label[99], 9, 400, 0, "Tahoma")
GUICtrlSetState($label[99], $GUI_DISABLE)
;===================== LABELS
For $x = 0 To 6
    $label[$x + 1] = GUICtrlCreateLabel("", $position1, $position2 + ($x * 25), $lenght1, 15, $SS_LEFTNOWORDWRAP)
    $label[$x + 21] = GUICtrlCreateLabel("", $position3, $position2 + ($x * 25), $lenght1, 15, $SS_LEFTNOWORDWRAP)
Next

GUICtrlSetState($button[1], $GUI_HIDE)
; FINISH LINE
;   GuiCtrlCreateGraphic(5, 165, 40,80)
;   GUICtrlSetGraphic(-1,$GUI_GR_LINE, 395,0)
;   GuiCtrlCreateGraphic(5, 200, 40,30)
;   GUICtrlSetGraphic(-1,$GUI_GR_LINE, 395,0)
$label[50] = GUICtrlCreateLabel("", $position1 + 50, $position2 + 180, 300, 15)
$label[51] = GUICtrlCreateLabel("", $position1 + 80, $position2 + 200, 300, 15)
$label[54] = GUICtrlCreateLabel("", $position1 + 70, $position2 + 220, 300, 15)
$label[55] = GUICtrlCreateLabel("", $position1 + 127, $position2 + 240, 300, 15)
For $a = 1 To 7 Step + 1
;    GUICtrlSetColor($label[$a],0x8080ff)
;   GUICtrlSetFont ($button[$a],9, 400, 0, "Tahoma")
    GUICtrlSetFont($label[$a], 9, 400, 0, "Tahoma")
Next
For $a = 21 To 27 Step + 1
    GUICtrlSetColor($label[$a], 0x1090ff)
;   GUICtrlSetFont ($button[$a],9, 400, 0, "Tahoma")
    GUICtrlSetFont($label[$a], 9, 400, 0, "Tahoma")
Next
For $a = 50 To 55 Step + 1
;GUICtrlSetColor($label[$a],0x1090ff)
;   GUICtrlSetFont ($button[$a],9, 400, 0, "Tahoma")
    GUICtrlSetFont($label[$a], 9, 400, 4, "Tahoma")
Next
For $x = 1 to 6
    GUICtrlSetData($label[$x], $gui_line[$x], $GUI_SHOW)
Next
GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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