It is currently Sat Dec 15, 2018 10:22 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [Windows Programming] Add Name to List button not works
PostPosted: Wed Jul 11, 2018 7:57 pm 
Offline
User
User
User avatar

Joined: Sun Jun 24, 2018 12:28 pm
Posts: 34
Location: Holland
Hey Windows Programmers...,

I try to create an script, the user can typ an name via an input_requester...
So this is my script, written in PB5.6.2:

Code:
Procedure Window()
 
  If OpenWindow(0, 0, 0, 128, 128, "List View", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
   
    If CreateToolBar(0, WindowID(0))
     
      ToolBarStandardButton(0, #PB_ToolBarIcon_New)
     
      ListViewGadget(0, 0, 0, 128, 64)
     
    EndIf
   
  EndIf
 
EndProcedure


Procedure HandleEvents()
 
  Repeat
   
    Select WaitWindowEvent()
       
      Case #PB_Event_Menu
       
        Select EventMenu()
           
          Case 0
           
            Input$ = InputRequester("Add", "Name to List", "Name")
           
            If Input$
             
              AddGadgetItem(0, 1, Input$)
             
            EndIf
           
        EndSelect
       
      Case #PB_Event_CloseWindow
       
        Quit = 1
       
    EndSelect
   
  Until Quit = 1
 
EndProcedure

Window()
HandleEvents()



Just if you run this script, via the new file icon (or new name to list called) button, you can typ an name to the list.
But if you activate your name input via the 'InputRequester', the names had not be to the list...

So run this script and you should see thad it isn't works...So if you can find the problen, pleace
correct my code and post it here...

So can you correct my code pleace, thanks for help...
Jamie.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Windows Programming] Add Name to List button not works
PostPosted: Wed Jul 11, 2018 8:15 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Nov 15, 2012 11:38 pm
Posts: 117
Location: Los Angeles
Code:
Procedure Window()
 
  If OpenWindow(0, 0, 0, 128, 128, "List View", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
   
    If CreateToolBar(0, WindowID(0))
     
      ToolBarStandardButton(0, #PB_ToolBarIcon_New)
     
      ListViewGadget(0, 0, 24, 128, 64) ; had to move it down Y a bit
     
    EndIf
   
  EndIf
 
EndProcedure


Procedure HandleEvents()
 
  Repeat
   
    Select WaitWindowEvent()
       
      Case #PB_Event_Menu
       
        Select EventMenu()
           
          Case 0
           
            Input$ = InputRequester("Add", "Name to List", "Name")
           
            If Input$
             
              AddGadgetItem(0, -1, Input$) ; -1 to add items to the end of the list
             
            EndIf
           
        EndSelect
       
      Case #PB_Event_CloseWindow
       
        Quit = 1
       
    EndSelect
   
  Until Quit = 1
 
EndProcedure

Window()
HandleEvents()


Top
 Profile  
Reply with quote  
 Post subject: Re: [Windows Programming] Add Name to List button not works
PostPosted: Thu Jul 12, 2018 9:08 am 
Offline
User
User
User avatar

Joined: Sun Jun 24, 2018 12:28 pm
Posts: 34
Location: Holland
Jagermeister wrote:
Code:
Procedure Window()
 
  If OpenWindow(0, 0, 0, 128, 128, "List View", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
   
    If CreateToolBar(0, WindowID(0))
     
      ToolBarStandardButton(0, #PB_ToolBarIcon_New)
     
      ListViewGadget(0, 0, 24, 128, 64) ; had to move it down Y a bit
     
    EndIf
   
  EndIf
 
EndProcedure


Procedure HandleEvents()
 
  Repeat
   
    Select WaitWindowEvent()
       
      Case #PB_Event_Menu
       
        Select EventMenu()
           
          Case 0
           
            Input$ = InputRequester("Add", "Name to List", "Name")
           
            If Input$
             
              AddGadgetItem(0, -1, Input$) ; -1 to add items to the end of the list
             
            EndIf
           
        EndSelect
       
      Case #PB_Event_CloseWindow
       
        Quit = 1
       
    EndSelect
   
  Until Quit = 1
 
EndProcedure

Window()
HandleEvents()


Thanks... i think it help!.
Jamie.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Exabot [Bot], infratec and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye