IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PureBasic Discussion :

ScroolAreaGadget et StartDrawing()


Sujet :

PureBasic

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Avril 2011
    Messages
    10
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2011
    Messages : 10
    Points : 9
    Points
    9
    Par défaut ScroolAreaGadget et StartDrawing()
    Bonjour,

    Pourriez-vous me dire pourquoi ce code ne marche pas? J'essaye seulement d"utiliser un DrawText sur une image contenue dans un ScroolAreaGadget.
    Je ne comprends pas où se situe le problème

    Merci


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
     
    ;-------------------------------- Enumeration ------------------------
     
    Enumeration
    #WinCpte
    #PanCpte
     
    #ImgAp
     
    #CpteGLAC_Titre
    #CpteGLAC_Frame
    #CpteGLAC_FrameCF
    #CpteGLAC_OptionClient
    #CpteGLAC_OptionFour
     
    #CpteGLAC_FrameOption
    #CpteGLAC_TxtCpteDebut
    #CpteGLAC_ComboCpteDebut
    #CpteGLAC_TxtCpteFin
    #CpteGLAC_ComboCpteFin
    #CpteGLAC_CheckAllCpte
     
    #CpteGLAC_FramePeriode
    #CpteGLAC_TxtDateDebut
    #CpteGLAC_DateDebut
    #CpteGLAC_TxtDateFin
    #CpteGLAC_DateFin
     
    #CpteGLAC_Afficher
    #CpteGLAC_Imprimer
     
    #CpteGLAC_TxtNumCpte
    #CpteGLAC_NumCpte
    #CpteGLAC_LibCpte
    #CpteGLAC_PreviousCpte
    #CpteGLAC_NextCpte
     
    #CpteGLAC_TxtNumCpte1
    #CpteGLAC_NumCpte1
    #CpteGLAC_LibCpte1
     
    #CpteGLAC_TxtNumCpte2
    #CpteGLAC_NumCpte2
    #CpteGLAC_LibCpte2
     
    #CpteGLAC_TxtNumCpte3
    #CpteGLAC_NumCpte3
    #CpteGLAC_LibCpte3
     
    #CpteGLAC_Grid1
    #CpteGLAC_Grid2
    #CpteGLAC_Grid3
     
    #CpteGLAC_TxtTotal
     
    #CpteGLAC_FrameAncienSolde
    #CpteGLAC_TextAncienSoldeD
    #CpteGLAC_AncienSoldeD
    #CpteGLAC_TextAncienSoldeC
    #CpteGLAC_AncienSoldeC
     
    #CpteGLAC_FrameMVT
    #CpteGLAC_TextMvtD
    #CpteGLAC_MvtD
    #CpteGLAC_TextMvtC
    #CpteGLAC_MvtC
     
    #CpteGLAC_FrameCum
    #CpteGLAC_TextCumD
    #CpteGLAC_CumD
    #CpteGLAC_TextCumC
    #CpteGLAC_CumC
     
    #CpteGLAC_FrameSolde
    #CpteGLAC_TextSoldeD
    #CpteGLAC_SoldeD
    #CpteGLAC_TextSoldeC
    #CpteGLAC_SoldeC
     
    #CpteGLAC_FrameProg
    #CpteGLAC_Prog
     
    EndEnumeration
     
    ;------------------------------ data section -----------------------------
    UseJPEGImageDecoder()
     
    ImgAp=CatchImage(400, ?ImgAp)
     
    DataSection
    Imgap:
    IncludeBinary "imgap.jpg"
    EndDataSection
     
    ;------------------------------ Open windows----------------------------
    ExamineDesktops()
    Wlargeur=DesktopWidth(0)
    Whauteur=DesktopHeight(0)
     
    OpenWindow(#WinCpte, 0,0, Wlargeur, Whauteur, "Comptabilité...",#PB_Window_SystemMenu |#PB_Window_ScreenCentered | #PB_Window_TitleBar |#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget)
    If CreateGadgetList(WindowID(#WinCpte))
     
       WLar=Wlargeur-10:WHaut=Whauteur-100 
     
       PanelGadget(#PanCpte, 10,10, WLar, WHaut)
     
      ;*************************************************************************************************************
       AddGadgetItem (#PanCpte, -1, " Grand livre auxiliaire client")
     
       TextGadget(#CpteGLAC_Titre, 20, 30, 400, 30, "GRAND LIVRE AUXILIAIRE CLIENT")
     
       wrow=60
       Frame3DGadget(#CpteGLAC_Frame, 10, wrow, 550,40, "Comptes à afficher")
       TextGadget(#CpteGLAC_TxtCpteDebut, 20, wrow+15, 100, 20,"N° de cpte début:")
       ComboBoxGadget(#CpteGLAC_ComboCpteDebut, 120, wrow+15, 90, 100,  #PB_ComboBox_Editable  |#PB_ComboBox_UpperCase)
       TextGadget(#CpteGLAC_TxtCpteFin, 220, wrow+15, 100, 20,"N° de cpte fin:")
       ComboBoxGadget(#CpteGLAC_ComboCpteFin, 300, wrow+15, 90, 100,  #PB_ComboBox_Editable  |#PB_ComboBox_UpperCase)
       CheckBoxGadget(#CpteGLAC_CheckAllCpte, 400, wrow+15, 140, 20,"Afficher tous les comptes")
     
       Frame3DGadget(#CpteGLAC_FrameOption, 570, wrow, 280,40, "Période")
       TextGadget(#CpteGLAC_TxtDateDebut, 580, wrow+18, 40, 20,"Du:")
       DateGadget(#CpteGLAC_DateDebut, 610, wrow+15, 90, 20)
       TextGadget(#CpteGLAC_TxtDateFin, 710, wrow+18, 40, 20, "AU:")
       DateGadget(#CpteGLAC_DateFin, 750, wrow+15, 90, 20)
     
       ButtonGadget(#CpteGLAC_Afficher,860, wrow+8, 100, 30, "Afficher")
     
       ScrollAreaGadget(0, 10, wrow+60, WLar-50, WHaut-200, WLar-100, WHaut+5000, 30)
     
       ImageGadget(#Imgap, 15,20,Wlar-60, WHaut-210,ImageID(400)) 
     
       AddGadgetItem (#PanCpte, -1, " FERMER ");***************************************************
     
    EndIf
     
    If LoadFont(10, "DicotLight", 8)
       SetGadgetFont(#PanCpte, FontID(10))
    EndIf
     
    If LoadFont(1, "Trebushet ms", 13,#PB_Font_Bold)
       SetGadgetFont(#CpteGLAC_titre, FontID(1))
    EndIf
     
    wQuitWinCpte=0
     
    Repeat
    EventID = WaitWindowEvent()
    If EventID = #PB_Event_Gadget
       Select EventGadget()
     
       Case #CpteGLAC_Afficher
     
            If StartDrawing(ImageOutput(400))
               DrawingMode(#PB_2DDrawing_Default) 
               DrawText(100,100,"Please help me !",RGB(219, 27, 36))
               LineXY(100,140,700,140,RGB(21, 27, 236))
               StopDrawing()  
            EndIf 
     
     
       Case #PanCpte
            n=GetGadgetState(#PanCpte)
            If n=1
               wQuitWinCpte=1
            EndIf
     
       EndSelect
    EndIf   
    Until EventID = #PB_Event_CloseWindow  Or wQuitWinCpte=1
    CloseWindow(#WinCpte)

    A noter que l'image est une surface blanche qui ne contient rien...

  2. #2
    Membre du Club
    Homme Profil pro
    Consultant informatique
    Inscrit en
    Juin 2008
    Messages
    39
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Juin 2008
    Messages : 39
    Points : 57
    Points
    57
    Par défaut
    Bonjour, C'est évidement très tard, mais enfin...
    Sans aller beaucoup plus loin ou cela commence a coincer c'est avec : "PanelGadget(#PanCpte, 10,10, WLar, WHaut)"
    qui occulte ce qui se passe après. Donc en neutralisant ce qui est en rapport alors la, déjà les choses changent et apparaissent l'image et le texte dessus!!!
    Voilà, la dessus je vais manger un bout !
    A+

Discussions similaires

  1. La méthode startDraw
    Par alouha dans le forum Général Java
    Réponses: 1
    Dernier message: 11/05/2008, 12h10

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo