AddGadgetItem Panel

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
a_carignan
User
User
Posts: 98
Joined: Sat Feb 21, 2009 2:01 am
Location: Canada

AddGadgetItem Panel

Post by a_carignan »

L' opening of the window creates a problem d' aces with the memory and firm the program. Qu' would be said; it is impossible to close the gadget lists to create by AddGadgetItem. J' have already to test closegadgetlist and opengadgetlist to manage it. Thank you d' advances.
Procedure newpanel()
AddGadgetItem(Panel_0, -1, "Note "+Str(CountGadgetItems(panel_0)))
label_titre=TextGadget(#PB_Any, 5, 5, 20, 15, "Titre")
string_titre=StringGadget(#PB_Any, 30, 5, GadgetWidth(panel_0)-35, 20,GetGadgetItemText(web_actuel,#PB_Web_PageTitle) )
label_adress=TextGadget(#PB_Any, 5, 30, 40, 15, "Adresse")
string_adress=StringGadget(#PB_Any, 50, 30, GadgetWidth(panel_0)-55, 20,GetGadgetText(web_actuel))
label_rem=TextGadget(#PB_Any, 5, 55, 60, 15, "Commentaire")
hauteur_rem=Round((GadgetHeight(panel_0)-90)/3,0)
editor_rem=EditorGadget(#PB_Any, 5, 80, GadgetWidth(panel_0)-10, hauteur_rem)
RichEdit_SetInterface(GadgetID(editor_rem))
label_web=TextGadget(#PB_Any, 5, 90+hauteur_rem, 60, 15, "Page web")
webx=5
weby=115+hauteur_rem
webwidht=GadgetWidth(panel_0)-10
webheight=GadgetHeight(panel_0)-weby-20
web_mozilla1=WebGadget(#PB_Any, webx, weby, webwidht, webheight, "",#PB_Web_Mozilla)
web_internet1=WebGadget(#PB_Any, webx, weby, webwidht, webheight, "")
If web_actuel=web_mozilla
HideGadget(web_internet1,#True)
web_actuel1=web_mozilla1
Else
HideGadget(web_mozilla1,#True)
web_actuel1=web_internet1
EndIf
SetGadgetText(web_actuel1,GetGadgetText(web_actuel))
SetActiveGadget(panel_0)
SetGadgetState(panel_0,CountGadgetItems(panel_0)-1)
Window_1 = OpenWindow(#PB_Any, 0, 0, 600, 338, "Écrivez votre commentaire - "+#title)
rem_text$=InputRequester(#title,"Le commentaire?",GetGadgetItemText(web_actuel,#PB_Web_SelectedText))
SetGadgetText(editor_rem,rem_text$)
SetGadgetState(panel_0,0)
SetActiveGadget(web_actuel)
EndProcedure
cas
Enthusiast
Enthusiast
Posts: 597
Joined: Mon Nov 03, 2008 9:56 pm

Re: AddGadgetItem Panel

Post by cas »

a_carignan wrote:Qu' would be said; it is impossible to close the gadget lists to create by AddGadgetItem. J' have already to test closegadgetlist and opengadgetlist to manage it. Thank you d' advances.
Have you tried with UseGadgetList() ? Maybe if you post complete snippet describing your problem (which we can just copy/paste and compile) we can help you more. And please use 'Code tag' when posting source here.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

You might want to reformat your mail a little by using two keywords before and after your code:

[code]
For a = 1 to 100
...
Next a
[/code]

Makes it a lot easier to read :-) See the next message...
Last edited by blueznl on Thu Aug 13, 2009 7:15 pm, edited 1 time in total.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

You might want to reformat your mail a little by using two keywords before and after your code:

Code: Select all

For a = 1 to 100
  ...
Next a
Makes it a lot easier to read :-) See the previous message... Also, you may consider something that reformats your source so it's properly indented, I've found that over the years to be almost essential to clean coding.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply