Jump to content

I'm blind: Failing to use GUI creation, cell relative, starting at some point


rudi
 Share

Go to solution Solved by pixelsearch,

Recommended Posts

Hello,

I don't see my mistake. Who's going to open my blind eyes? 

#include <DateTimeConstants.au3>
#include <GUIConstantsEx.au3>
#include <Date.au3>


#Region Create GUI
$GUITitle = "MM Search Receiver LOGs, v" & FileGetVersion(@ScriptFullPath)

Dim $aCoord[3]=["start relative","absolute","cell relative"]

$GuiW = 350
$GuiH = 250
$Rim = 5
$CtrlGap = 5
$CtrlH = 20
$CtrlW = $GuiW - 2 * $Rim
$NextY = 0

$GuiDebug=True
$DebugCount=0

$Coordmode=1
GUICreate($GUITitle, $GuiW, $GuiH)
$Coordmode=1 ; default
Opt("guicoordmode",$CoordMode)
GUISetState()
GUIdebug()
$Group = GUICtrlCreateGroup("Suchoptionen", $Rim, $Rim, $GuiW - 2 * $Rim, 2 * $Rim + 3 * $CtrlGap + 3 * $CtrlH)
$NextY += $Rim + $Rim + $CtrlH + 2 * $CtrlGap + 3 * $CtrlH ; Nächstes Control unterhalb dieser Gruppe
GUIdebug()
$rToday = GUICtrlCreateRadio("nur heute", $Rim + $CtrlGap, $Rim * 3 + $CtrlGap, $CtrlW - 2 * $CtrlGap, $CtrlH)
GUICtrlSetState($rToday, $GUI_CHECKED)
$Coordmode=2
Opt("guicoordmode", $Coordmode)
GUIdebug()
$rOneDay = GUICtrlCreateRadio("Ein Tag", -1, $CtrlGap)
GUIdebug()
$rRange = GUICtrlCreateRadio("Datumsbereich", -1, $CtrlGap)
$Coordmode=1
Opt("guicoordmode", $Coordmode)
GUIdebug()
GUICtrlCreateGroup("", -99, -99) ; close group
GUIdebug()
$cDate = GUICtrlCreateDate(_NowCalcDate(), $Rim, $NextY, $CtrlW, $CtrlH, $DTS_SHORTDATEFORMAT)
GUICtrlSetState($cDate, $GUI_HIDE)
GUICtrlSetState($cDate, $GUI_SHOW)
$Coordmode=2
Opt("guicoordmode", $Coordmode)
$NextY += $CtrlH + $CtrlGap
GUIdebug()
$cDateZwei = GUICtrlCreateDate(_NowCalcDate(), -1, $CtrlGap, "", "", $DTS_SHORTDATEFORMAT)
GUICtrlSetState($cDateZwei, $GUI_HIDE)
GUICtrlSetState($cDateZwei, $GUI_show)
$NextY += $CtrlH + $CtrlGap
GUIdebug()
$lLabel = GUICtrlCreateLabel("String, nach dem gesucht werden soll:", -1, $CtrlGap)
$NextY += $CtrlH + $CtrlGap
GUIdebug()
$iSearch = GUICtrlCreateInput("a.e.neumann@mad.com", -1, $CtrlGap)
$NextY += $CtrlH + $CtrlGap
$Coordmode=1
Opt("guicoordmode", $Coordmode)
GUIdebug()
$bDoit = GUICtrlCreateButton("Suche starten", $Rim, $NextY + $CtrlGap, ($CtrlW - $CtrlGap) / 2, $CtrlH)
GUIdebug()
$bExit = GUICtrlCreateButton("Abbrechen", $Rim + $CtrlW / 2 + $CtrlGap, $NextY + $CtrlGap, ($CtrlW - $CtrlGap) / 2 - $Rim / 2, $CtrlH)
GUIdebug()
GUISetState()
#EndRegion Create GUI

MsgBox(0, "", "gui check")

Exit



Func GUIdebug($CallingLine=@ScriptLineNumber)
    if $GuiDebug=True Then
        $DebugCount+=1
        MsgBox(0, "Debug #" & $DebugCount,"Zeile = " & $CallingLine & @CRLF & "NextY = " & $NextY & @CRLF & "Coordmode = " & $CoordMode & " = " & $aCoord[$Coordmode])
    EndIf
EndFunc

TIA, Rudi.

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

I just almost got mad, because I rememered, that it *DID* work a couple of weeks ago.

 

So I went back to the PC, where I remembered, that I wrote the original approach: There it is working as expected.

using the shared clipboard to my main PC, the same lines did *NOT* work.

The difference seems to be the autoit version: Left the "other" PC working, right "my main" PC, not working:

 

image.png.16b56bc08575393c8b36a53ba29c7698.png  image.png.80a72aa13af928483314d0637a071738.png

 

so it's definitely some difference between these two Versions v3.3.14.5 <-> v3.3.16.1

 

 

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

If I understand correctly,  3 controls don't show in your GUI ( $cDateZwei , $lLabel , $iSearch )
They should appear if you change this line...

$cDateZwei = GUICtrlCreateDate(_NowCalcDate(), -1, $CtrlGap, "", "", $DTS_SHORTDATEFORMAT)

...with

$cDateZwei = GUICtrlCreateDate(_NowCalcDate(), -1, $CtrlGap, Default, Default, $DTS_SHORTDATEFORMAT)

I think -1 (instead of Default) should also work, i.e

$cDateZwei = GUICtrlCreateDate(_NowCalcDate(), -1, $CtrlGap, -1, -1, $DTS_SHORTDATEFORMAT)

Good luck

Edited by pixelsearch
Link to comment
Share on other sites

  • Solution
1 hour ago, rudi said:

so it's definitely some difference between these two Versions v3.3.14.5 <-> v3.3.16.1

  In fact the difference happened exactly between these 2 beta versions (just tested) :

AutoIt 3.3.15.3 (16th May, 2020) (Beta)

3 syntax work and create correctly the controls discussed in the preceding post :

$cDateZwei = GUICtrlCreateDate(_NowCalcDate(), -1, $CtrlGap, "", "", $DTS_SHORTDATEFORMAT)
$cDateZwei = GUICtrlCreateDate(_NowCalcDate(), -1, $CtrlGap, Default, Default, $DTS_SHORTDATEFORMAT)
$cDateZwei = GUICtrlCreateDate(_NowCalcDate(), -1, $CtrlGap, -1, -1, $DTS_SHORTDATEFORMAT)

AutoIt 3.3.15.4 (12th June, 2021) (Beta)

Only 2 syntax work

$cDateZwei = GUICtrlCreateDate(_NowCalcDate(), -1, $CtrlGap, Default, Default, $DTS_SHORTDATEFORMAT)
$cDateZwei = GUICtrlCreateDate(_NowCalcDate(), -1, $CtrlGap, -1, -1, $DTS_SHORTDATEFORMAT)

I don't see anything related to this in the "History / ChangeLog" of the actual help file (including betas), maybe I missed it.

The only fix related to this "width = 0 and height = 0" (as found in your initial script) applies to GuiCtrlCreatePic() which was solved precisely... in 3.3.15.4 . Is it possible that it had a side effect on all other controls ? Only Jon knows :

Fixed #3682: GuiCtrlCreatePic() with h=0 and w=0.
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...