wxWidget

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Post by chi »

@kiffi: that would be nice ;)

@ts-soft: thanks for the checkbox-example... now i know what went wrong with my code... (grüsse nach de)


cheers, chi
chen
Enthusiast
Enthusiast
Posts: 338
Joined: Fri Dec 23, 2005 2:20 pm
Location: Quebec, Canada
Contact:

Post by chen »

ts-soft wrote:
USCode wrote:But I have to ask, what in particular does wxWidgets offer that PB doesn't have that motivated you to do this?
Dimension of controls the same on win and lin, other like pb.
More Controls
Flickerfree Tab
Better Eventhandling
and, and ...
:wink:
from your perspective, then what advantages has PB over wxWidgets?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

chen wrote: from your perspective, then what advantages has PB over wxWidgets?
PB is easier, no dll required, smaller executable ...
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
hallodri
Enthusiast
Enthusiast
Posts: 208
Joined: Tue Nov 08, 2005 7:59 am
Location: Germany
Contact:

Post by hallodri »

PB is not easier to learn and the executables are smaller as from PB.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

hallodri wrote:and the executables are smaller as from PB.
but requires a 3,66 MB DLL :wink:
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Kiffi
Addict
Addict
Posts: 1353
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Post by Kiffi »

ts-soft wrote:but requires a 3,66 MB DLL :wink:
but nevertheless the executable is smaller.
ts-soft wrote:smaller executable ...
;-)

Greetings ... Kiffi
Hygge
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

i write it in a short form, my english is to bad for longer explanation :oops:
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
chen
Enthusiast
Enthusiast
Posts: 338
Joined: Fri Dec 23, 2005 2:20 pm
Location: Quebec, Canada
Contact:

Post by chen »

ts-soft wrote:
hallodri wrote:and the executables are smaller as from PB.
but requires a 3,66 MB DLL :wink:
If wanted to minimize executables : http://wiki.wxwidgets.org/Reducing_Executable_Size
glops
User
User
Posts: 38
Joined: Wed Jan 16, 2008 12:53 pm
Location: France

what's wrong with that event ?

Post by glops »

Code: Select all

XIncludeFile #PB_Compiler_Home + "Include\inc.wx.pbi" 

Enumeration 
   #CONTROL 
   #myFrame
   #myText
   #myPanel
   #myButton
   #myBitmapButton
   #myBitmap
   #myImage
EndEnumeration 

Enumeration 
   #WINDOW_TEST 
EndEnumeration 

Global APP.i    

Procedure click_event()
  x= 0 
EndProcedure
    
Procedure OnInit() 
   Protected frame 
   Protected myPanel 
   Protected control 
   Protected myButton
   
   Protected myBitmapButton
   Protected myBitmap
   Protected myImage 
   
   
   ; fenster erstellen 
   frame = wxFrame() 
   myText = wxStaticText()
   control = wxCheckBox( ) 
   myButton = wxButton( )  
   myBitmapButton = wxBitmapButton()
   myBitmap = wxBitmap()
   myImage = wxImage()
   
   wxFrame_Create(frame, #WINDOW_TEST, 1, "Test", wxSize(-1,-1), wxSize(-1,-1), #wxDEFAULT_FRAME_STYLE, "frame") 
   
   wxCheckBox_Create (control,  frame ,  #CONTROL,  "I'm a checkbox" ,  wxSize(-1, -1),  wxSize(-1, -1),  0,  0,  "checkBox")    
   wxCheckBox_SetValue(control, #True) 
   
   wxButton_Create ( myButton ,  frame ,  #myButton ,  "button" ,  wxSize(50,50) ,  wxSize(100,20) ,  0 ,  wxValidator ,  "button" )  
   wxEvtHandler_proxy( myButton, @click_event() )
   wxEvtHandler_connect( myButton, wxEvent_EVT_COMMAND_BUTTON_CLICKED(), -1, -1, 0 )

   wxStaticText_Create ( myText ,  frame ,  #myText ,  "STATIC test ",  wxSize(30,30) ,  wxDefaultSize ,  0 ,  "staticText") 
       
   ; Frame anzeigen 
   wxWindow_Show(frame,#True)    
    
   ProcedureReturn wxApp_OnInit(APP) 
EndProcedure 

Procedure OnExit()    
   ProcedureReturn wxApp_OnExit(APP) 
EndProcedure    

Procedure Main()    
   APP    = wxApp() 
   wxApp_RegisterVirtual(app,@OnInit(),@OnExit())    
   wxApp_Run(0,0)    
EndProcedure:Main()
Message Invalid memory access...
Do you know how to correct this error in my code (in click_event() ) ?

Thanks
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Code: Select all

Procedure click_event(event,listener)
  x= 0
EndProcedure
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
glops
User
User
Posts: 38
Joined: Wed Jan 16, 2008 12:53 pm
Location: France

Post by glops »

thanks ! Will have further questions later !!
glops
User
User
Posts: 38
Joined: Wed Jan 16, 2008 12:53 pm
Location: France

wxListCtrl

Post by glops »

Does anybody know what's missing for a wxListCtrl ?

Code: Select all

XIncludeFile #PB_Compiler_Home + "Include\inc.wx.pbi" 

Enumeration 
   #CONTROL 
   #myFrame
   #myText
   #myPanel
   #myButton
   #myBitmapButton
   #myBitmap
   #myImage
   #myListCtrl
EndEnumeration 

Enumeration 
   #WINDOW_TEST 
EndEnumeration 

Global APP.i    

Procedure OnInit() 
   Protected frame 
   Protected myListCtrl

   
   ; fenster erstellen 
   frame = wxFrame() 
  wxFrame_Create(frame, #WINDOW_TEST, 1, "Test", wxSize(-1,-1), wxSize(-1,-1), #wxDEFAULT_FRAME_STYLE, "frame") 
   
   myListItem = wxListItem()
   myListCtrl = wxListCtrl()
   wxListCtrl_Create ( myListCtrl ,  frame ,  #myListCtrl , wxSize(60,70) ,  wxSize(250,150) ,  wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_HRULES|wxLC_VRULES ,  wxValidator ,  "listCtrl" )  

    
    wxListItem_SetImage(myListItem,-1);
    wxListItem_SetTextColour(myListItem, wxColour_ctorByName("Blue"));
    wxListItem_SetText(myListItem,"col1");
    wxListCtrl_InsertColumn(myListCtrl,0, myListItem);
    wxListCtrl_SetColumnWidth(myListCtrl,0, wxLIST_AUTOSIZE );
    ;wxListCtrl_SetColumnWidth(myListCtrl,0, 100 );
     
	
   wxWindow_Show(frame,#True)    
    
   ProcedureReturn wxApp_OnInit(APP) 
EndProcedure 



Procedure OnExit()    
   ProcedureReturn wxApp_OnExit(APP) 
EndProcedure    

Procedure Main()    
   APP    = wxApp() 
   wxApp_RegisterVirtual(app,@OnInit(),@OnExit())    
   wxApp_Run(0,0)    
EndProcedure:Main()
ps: wxNotebook is running !!
User avatar
hallodri
Enthusiast
Enthusiast
Posts: 208
Joined: Tue Nov 08, 2005 7:59 am
Location: Germany
Contact:

Post by hallodri »

I've forgotten the constant.

Code: Select all

#wxLC_VRULES          = $0001
#wxLC_HRULES          = $0002

#wxLC_ICON            = $0004
#wxLC_SMALL_ICON      = $0008
#wxLC_LIST            = $0010
#wxLC_REPORT          = $0020

#wxLC_ALIGN_TOP       = $0040
#wxLC_ALIGN_LEFT      = $0080
#wxLC_AUTOARRANGE     = $0100
#wxLC_VIRTUAL         = $0200
#wxLC_EDIT_LABELS     = $0400
#wxLC_NO_HEADER       = $0800
#wxLC_NO_SORT_HEADER  = $1000
#wxLC_SINGLE_SEL      = $2000
#wxLC_SORT_ASCENDING  = $4000
#wxLC_SORT_DESCENDING = $8000 

#wxLC_MASK_TYPE      = (#wxLC_ICON | #wxLC_SMALL_ICON | #wxLC_LIST | #wxLC_REPORT)
#wxLC_MASK_ALIGN     = (#wxLC_ALIGN_TOP | #wxLC_ALIGN_LEFT)
#wxLC_MASK_SORT      = (#wxLC_SORT_ASCENDING | #wxLC_SORT_DESCENDING)

#wxLIST_MASK_STATE        =   $0001
#wxLIST_MASK_TEXT         =   $0002
#wxLIST_MASK_IMAGE        =   $0004
#wxLIST_MASK_DATA         =   $0008
#wxLIST_SET_ITEM          =   $0010
#wxLIST_MASK_WIDTH        =   $0020
#wxLIST_MASK_FORMAT       =   $0040

#wxLIST_STATE_DONTCARE    = $0000
#wxLIST_STATE_DROPHILITED = $0001      
#wxLIST_STATE_FOCUSED     = $0002
#wxLIST_STATE_SELECTED    = $0004
#wxLIST_STATE_CUT         = $0008      

#wxLIST_HITTEST_ABOVE            = $0001  
#wxLIST_HITTEST_BELOW            = $0002  
#wxLIST_HITTEST_NOWHERE          = $0004  
#wxLIST_HITTEST_ONITEMICON       = $0020  
#wxLIST_HITTEST_ONITEMLABEL      = $0080  
#wxLIST_HITTEST_ONITEMRIGHT      = $0100  
#wxLIST_HITTEST_ONITEMSTATEICON  = $0200  
#wxLIST_HITTEST_TOLEFT           = $0400  
#wxLIST_HITTEST_TORIGHT          = $0800  

#wxLIST_HITTEST_ONITEM  = (#wxLIST_HITTEST_ONITEMICON | #wxLIST_HITTEST_ONITEMLABEL | #wxLIST_HITTEST_ONITEMSTATEICON)

Enumeration
  #wxLIST_NEXT_ABOVE
  #wxLIST_NEXT_ALL
  #wxLIST_NEXT_BELOW
  #wxLIST_NEXT_LEFT
  #wxLIST_NEXT_RIGHT
EndEnumeration

Enumeration
  #wxLIST_ALIGN_DEFAULT
  #wxLIST_ALIGN_LEFT
  #wxLIST_ALIGN_TOP
  #wxLIST_ALIGN_SNAP_TO_GRID
EndEnumeration

Enumeration
  #wxLIST_FORMAT_LEFT
  #wxLIST_FORMAT_RIGHT
  #wxLIST_FORMAT_CENTRE
  #wxLIST_FORMAT_CENTER = #wxLIST_FORMAT_CENTRE
EndEnumeration

Enumeration
  #wxLIST_AUTOSIZE = -1
  #wxLIST_AUTOSIZE_USEHEADER = -2
EndEnumeration     

Enumeration
  #wxLIST_RECT_BOUNDS
  #wxLIST_RECT_ICON
  #wxLIST_RECT_LABEL
EndEnumeration

Enumeration
  #wxLIST_FIND_UP
  #wxLIST_FIND_DOWN
  #wxLIST_FIND_LEFT
  #wxLIST_FIND_RIGHT
EndEnumeration

Code: Select all

Enumeration 
   #CONTROL 
   #myFrame 
   #myText 
   #myPanel 
   #myButton 
   #myBitmapButton 
   #myBitmap 
   #myImage 
   #myListCtrl 
EndEnumeration 

Enumeration 
   #WINDOW_TEST 
EndEnumeration 

Global APP.i    

Procedure OnInit() 
   Protected frame 
   Protected myListCtrl 
   
    frame = wxFrame() 
    wxFrame_Create(frame, #WINDOW_TEST, 1, "Test", wxSize(-1,-1), wxSize(-1,-1), #wxDEFAULT_FRAME_STYLE, "frame") 
    
    myListItem = wxListItem() 
    myListCtrl = wxListCtrl() 
    wxListCtrl_Create ( myListCtrl ,  frame ,  #myListCtrl , wxSize(60,70) ,  wxSize(250,150) ,  #wxLC_REPORT|#wxLC_SINGLE_SEL|#wxLC_HRULES|#wxLC_VRULES ,  #Null ,  "listCtrl" )      
    
    wxListItem_SetText(myListItem,"col1")    
    
    wxListCtrl_InsertColumn(myListCtrl,0, myListItem)
    
    wxListCtrl_SetColumnWidth(myListCtrl,0, 100 )    
    
    
    wxWindow_Show(frame,#True)    
    
   ProcedureReturn wxApp_OnInit(APP) 
EndProcedure 



Procedure OnExit()    
   ProcedureReturn wxApp_OnExit(APP) 
EndProcedure    

Procedure Main()    
   APP    = wxApp() 
   wxApp_RegisterVirtual(app,@OnInit(),@OnExit())    
   wxApp_Run(0,0)    
EndProcedure:Main()
klaver
Enthusiast
Enthusiast
Posts: 146
Joined: Wed Jun 28, 2006 6:55 pm
Location: Schröttersburg

Re: wxWidget

Post by klaver »

What's the version of wxWidgets? Is it 2.6.4 as in docs link?
Image
User avatar
Tenaja
Addict
Addict
Posts: 1948
Joined: Tue Nov 09, 2010 10:15 pm

Re: wxWidget

Post by Tenaja »

I just tried to run this out of curiosity. Unfortunately, the new PB 5.20 feature Module breaks the wxWidget, because a variable in the library is named Module. I tried renaming it in the declare, but it seems that it will not work properly until it is renamed in the original C lib.
Post Reply