text superimposed

General discussion on Visual GLCD Software.
Post Reply
Author
Message
cirederf
Posts: 89
Joined: 10 Apr 2009 16:56
Location: FRANCE

text superimposed

#1 Post by cirederf » 10 Nov 2011 13:20

Hello

when I write a text the old values ​​are not deleted, they are superimposed, an idea?

Code: Select all

'-------------- User code declarations ---------------'
dim text as string [5]
dim incrementeur as word

'----------- End of User code declarations -----------'

implements

'--------------------- User code ---------------------'

'----------------- End of User code ------------------'

' Event Handlers


sub procedure parametres_click()
   DrawScreen(@screen2 )
end sub


sub procedure ButtonRound1_plusClick()
      RC2_bit = not RC2_bit
      inc (incrementeur)
      WordToStr(incrementeur, text)
      T6963C_Write_Text(text, 0, 0, T6963C_ROM_MODE_XOR)
      Label1_Caption = text
      DrawLabel(@Label1)
end sub
google translate is my friend

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: text superimposed

#2 Post by janko.kaljevic » 11 Nov 2011 09:15

Hello,

Yes, prior to writing new values you should delete old values. This should be done with all dynamic labels in your code.
Please try something like this:

Code: Select all

sub procedure ButtonRound1_plusClick()
      RC2_bit = not RC2_bit
      inc (incrementeur)
      WordToStr(incrementeur, text)
      T6963C_Write_Text(text, 0, 0, T6963C_ROM_MODE_XOR)
      Label1.Font_Color = BackGroundColor
      DrawLabel(@Label1)   
      Label1_Caption = text
      Label1.Font_Color = FontColor
      DrawLabel(@Label1)
end sub
Best regards.

cirederf
Posts: 89
Joined: 10 Apr 2009 16:56
Location: FRANCE

Re: text superimposed

#3 Post by cirederf » 14 Nov 2011 23:25

I do not know where you take BackgroundColor and FontColor,it does not work.I would like to know.

I found T6963C_WHITE and T6963C_BLACK and it's ok
:D

Code: Select all

program DPdouze_main
include __Lib_T6963C_Consts



dim timer_vitesse_H as byte
dim timer_vitesse_L as byte
dim puls_radar as word
dim octet_serie as byte
dim emplacement_octer_recu as byte
dim  buffer_reception as byte [5]
dim texte as string [5]
dim texte2 as string [5]
dim incrementeur as word
dim incrementeur2 as word
'
'
 sub procedure interrupt

'     if TestBit (PIR2,CCP2IF) = 1  then    'INTERRUPTION POUR PRISE DE REGIME
'          timer_vitesse_H = CCPR3H
'          timer_vitesse_L = CCPR3L
''          CCPR2H = 0
''          CCPR2L = 0
'          'TMR3H = 0
'          TMR3L = 0
'
''
''          if  PIR2.TMR3IF = 1 then     'si il a un debordement de timer 3 met une butée
''               puls_radar = 65534
''               ClearBit(PIR2,TMR3IF)' = 0       'remise à 0 du drapeau d'interruption timer 1
''               goto passetonchemin
''          end if
'               puls_radar =  timer_vitesse_L +  ( timer_vitesse_H << 8 ) 'OK
'                       passetonchemin:
'
'
'
'            ClearBit( PIR2,CCP2IF)' =0 '   remise en route de l interruption de capture entrée rotation
'     end if
'
'            '     INTERRUPTION UART                                  .
'        if (UART2_Data_Ready() = 1)  then
'           octet_serie = UART2_Read()  'lecture port serie
'           buffer_reception [emplacement_octer_recu] = octet_serie
'           inc  (emplacement_octer_recu)
'
'            if emplacement_octer_recu > 4  then
'                 emplacement_octer_recu = 0
'            end if
'            ClearBit( pir1,rcif)' = 0
'        end if
'
end sub


    sub procedure affiche_vitesse ()
    
            Label1_Caption = texte
            Label1.Font_Color = T6963C_Black    'efface  le vieux texte
            DrawLabel(@Label1)
    
            wordtostr ( inc (incrementeur2),texte) ' change le texte
            
'            Button1_Caption = texte  ' cette fonction fait clignoter le texte
'            DrawButton(@Button1)     ' This function flashes the text

            T6963C_Write_Text(texte, 0, 0, T6963C_ROM_MODE_XOR)
            
            Label1_Caption = texte             ' ecrit le nouveau texte
            Label1.Font_Color =  T6963C_WHITE
            DrawLabel(@Label1)
            
    end sub
    
    
    
  main:

    Start_TP()
    incrementeur =0
    incrementeur2 =0

    while TRUE
    Check_TP()
    

            
         if  PIR2.TMR3IF = 1 then
           inc (incrementeur)
            ClearBit(PIR2,TMR3IF)' = 0
             if incrementeur = 3then
                 affiche_vitesse ()
                 incrementeur =0
              end if
         end if

    wend

  end.
google translate is my friend

Post Reply

Return to “Visual GLCD General”