Panel Question

wm.chatman

Well-Known Member
Licensed User
Longtime User
:) Hi all.

Here we got a clock that shows on the form only.
Question please. How am I able to show the time on a Panel ONLY ? Maybe a member could take a look please, that would be fantastic.

thanks much.

Best regards.
Willaim
 

Attachments

  • Clock.zip
    30.2 KB · Views: 212

sitajony

Active Member
Licensed User
The panel control have not a ForeLayer graphics...
You can draw the numbers in a Bitmap and set it in a Image on your Panel :)
Use DrawerEx + BitmapEx from ImageLibEx or other ;)
 

wm.chatman

Well-Known Member
Licensed User
Longtime User
:) Hi.

do you might have an example for me ? If you could. Or maybe even help ?

Thanks.
William
 

sitajony

Active Member
Licensed User
This is an example, I didn't understand some code so I modified it but it's the same thing:
 

Attachments

  • Clock.zip
    32.8 KB · Views: 219

wm.chatman

Well-Known Member
Licensed User
Longtime User
:) Hi sitajony

I tried your example, did not work for me. Anyway, I solved the panel Q. :)
still, thank you much for helping !

my little example... check out. dont look all that bad. :)

Edit: this works with the panel situ. see code

Sub Globals
MenuDown=0

Sub btnMenuUpDown_Click
If MenuDown=0 Then
MenuDown=1
btnMenuUpDown.Image=IL1.Item(1)
pnlTime.Visible=True
Else
MenuDown=0
btnMenuUpDown.Image=IL1.Item(0)
pnlTime.Visible=False
End If
End Sub

This is nice, but again... so how to Toggle show/hide Panel, with one Button ? Answer das been found. Blind Manns Luck.

Best regards.
William
 

Attachments

  • WMT.zip
    2.1 KB · Views: 220
Last edited:

sitajony

Active Member
Licensed User
My example doesn't work? On my device it works...
Otherwise in fact now you just set your clock as string in a Label, it's easier effectively :)
 

wm.chatman

Well-Known Member
Licensed User
Longtime User
My example doesn't work? On my device it works...
Otherwise in fact now you just set your clock as string in a Label, it's easier effectively :)
No Sir example did not work, I look again later and let you know.
BTW. just set your clock as string in a Label ? How you mean ?
 

wm.chatman

Well-Known Member
Licensed User
Longtime User
I meant ImageButton sorry, it's easier than draw it to a bitmap...
thats OK Sir. I have got it working Panel and the button works great. Blind Manns Luck. I've been up all night so have learnd something.
Take care.

Best regards.
William
 
Last edited:

klaus

Expert
Licensed User
Longtime User
Attached is a version of the clock on an Image control on a Panel control with the digital font.
Unfortuantley sitajony's version doesn't work on my desktop.
I get an Out of Memory message in the line that draws the character images onto a bitmap with transparent = True.
The program works OK with transparent = False.
It seems that there is a problem with the transparent color in the images in the digital.fnt file.
I extracted the needed images from that file and saved them with a black background color and now it works.
The 'strange' thing is that drawing these images directly onto the form's forelayer works, but drawing the images with a Drawer object onto a bitmap raises an error ?

Best regards.
 

Attachments

  • ClockKC.zip
    6.7 KB · Views: 236

wm.chatman

Well-Known Member
Licensed User
Longtime User
:) Hello Klaus

Thank you for posting your version of the Clock. You know I will take a look. :)
The Out of Memory message I also get with sitajony version.
Heck, I am still working on mine I quess to better it up some. Ha, ha.
I like the fonts, large. That's good for the eyes, the are getting old. :(

Edit: At Debug level, all is well, no errors found. At run mode first error pops up. Please see attached.


Well Sir, take care !

BEST REGARDS.

William
 

Attachments

  • error02.JPG
    error02.JPG
    12.8 KB · Views: 234
Last edited:

wm.chatman

Well-Known Member
Licensed User
Longtime User
:)

Hut ab / I'll take off my hat ! :cool:

may I ask you maybe, for just another helper ?
I am trying to make a panel slide in, from the bottom of frm, using a togle also !
to add more buttons of course...
Bis jetzt kein glueck / up until now without luck. Any ideas for me maybe Sir ?

BEST REGARDS :)

PS. i am tinkering with Save current Lat/Lon and Loading a Position just learning small things.

Update: Klaus, this is very interesting indeed ! I've tested your Clock and it is GREAT. If I could get a Panel to slide in from the bottom of frm now... what do you think about it Klaus ?

William
 
Last edited:

klaus

Expert
Licensed User
Longtime User
Update: Klaus, this is very interesting indeed ! I've tested your Clock and it is GREAT. If I could get a Panel to slide in from the bottom of frm now... what do you think about it Klaus ?

Is the attached program what you are expecting ?

Best regards.
 

Attachments

  • ClockKC1.sbp
    2.6 KB · Views: 227

wm.chatman

Well-Known Member
Licensed User
Longtime User
It is a bit more then I had expected. FOR REAL ! This is great.

In Sub Timer2_Tick this got me. If pnlClock.Top<=pnlClock_Top Then
this (<) got me ! I had it thus far myself, pnlClock.Top = pnlClock.

I would have figured hours again to check that. At least my thoughts had been in the right direction.

EDIT: slap my bug... in Numerics ? seems like a digital font problem. I see some tabs or spacers between the Numbers.
Please check Attachm.

EDIT: On Desktop in IDE this works great. Now had chance to test on Device. The Numbers Flicker that looks just a bit like a seconds tick, I think. ?
 

Attachments

  • numericbug.JPG
    numericbug.JPG
    14 KB · Views: 235
Last edited:

wm.chatman

Well-Known Member
Licensed User
Longtime User
:) Hi Folks

For a Toggle I use this:

Sub btnMenuUpDown_Click
If MenuDown=0 Then
MenuDown=1
btnMenuUpDown.Image=IL1.Item(1)
pnlTime.Visible=True
Else
MenuDown=0
btnMenuUpDown.Image=IL1.Item(0)
pnlTime.Visible=False
Else
Timer1.Enabled = Not(Timer1.Enabled)
If Timer1.Enabled Then
pnlTime.Top=240
Timer5.Enabled=True
Timer1_Tick
pnlTime.Visible=True
Else
pnlTime.Visible=Falese
End If

End Sub

Question:
Why do I need to click the btnMenuUpDown two times before the Panel
starts moving in. ? I do not see my mistake ! Whats wrong here with
the above code... :confused:

Thank you.

Best regards.
William
 
Last edited:

sitajony

Active Member
Licensed User
Normaly your program should not working...
You've written twice "Else"...
And I think that your code can be much shorter...

B4X:
Sub btnMenuUpDown_Click
     If Timer1.Enabled=false Then
        btnMenuUpDown.Image = IL1.Item(1)
        pnlTime.Visible = True
        pnlTime.Top = 240
                  Timer1.Enabled = True
        Timer5.Enabled = True
        Timer1_Tick
        pnlTime.Visible=True
     Else
        Timer1.Enabled = False
        Timer5.Enabled = False
        pnlTime.Visible = False
     End If
End Sub
But maybe it's wrong, I don't know exactly what Timer5 do on your program...
 

wm.chatman

Well-Known Member
Licensed User
Longtime User
hi.

your code does the same as above. ha, ha. your code is short above a longer, still same. i had this crap before and Klaus gave me a hand on that.
but i forgot ! its so simpl but the mind is getting weak ! lets just say; you cant get sicker ! when you forget... you know what i mean SIR ? :(
then u loose wife aint that a f***t up live ?

hi mjcoon
 
Last edited:

wm.chatman

Well-Known Member
Licensed User
Longtime User
Normaly your program should not working...
You've written twice "Else"...
And I think that your code can be much shorter...

B4X:
Sub btnMenuUpDown_Click
     If Timer1.Enabled=false Then
        btnMenuUpDown.Image = IL1.Item(1)
        pnlTime.Visible = True
        pnlTime.Top = 240
                  Timer1.Enabled = True
        Timer5.Enabled = True
        Timer1_Tick
        pnlTime.Visible=True
     Else
        Timer1.Enabled = False
        Timer5.Enabled = False
        pnlTime.Visible = False
     End If
End Sub
But maybe it's wrong, I don't know exactly what Timer5 do on your program...[/code]
I do not know how the quotes work but; tmr5movespnltop
 
Last edited:

wm.chatman

Well-Known Member
Licensed User
Longtime User
Normaly your program should not working...
You've written twice "Else"...
And I think that your code can be much shorter...

B4X:
Sub btnMenuUpDown_Click
     If Timer1.Enabled=false Then
        btnMenuUpDown.Image = IL1.Item(1)
        pnlTime.Visible = True
        pnlTime.Top = 240
                  Timer1.Enabled = True
        Timer5.Enabled = True
        Timer1_Tick
        pnlTime.Visible=True
     Else
        Timer1.Enabled = False
        Timer5.Enabled = False
        pnlTime.Visible = False
     End If
End Sub
But maybe it's wrong, I don't know exactly what Timer5 do on your program...[/code]
I do not know how the quotes work but;

tmr5movespnltop
I am really sorry about this mess ! Dont get teed at me folks OK. :) to much JD- Wiskey.
 
Last edited:
Top