[Win/Linux] Visual WX-C Designer

User projects written in or related to FreeBASIC.
MOD
Posts: 555
Joined: Jun 11, 2009 20:15

[Win/Linux] Visual WX-C Designer

Postby MOD » May 26, 2011 8:56

Visual WX-C Designer is a application window designer for wx-c where widgets can be placed on a window by simple choosing them and clicking on the project window.
It supports lots of widgets, handler and XML form export/import and generating FreeBASIC-Code.

Screenshots:
Mainwindow
Projectpanel:
Image
Propertydialog

More information and downloads:
Visual WX-C Designer at FreeBASIC-Portal.de
Last edited by MOD on Oct 15, 2012 18:01, edited 9 times in total.
St_W
Posts: 1479
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Postby St_W » May 28, 2011 21:36

Nice to see that Visual WX-C Designer isn't dead.

The designer itself looks pretty good and works quite well. It's so much easier to design WXW Windows using a designer than to write everything by hand. Although the wx-c library and their bindings are quite old it's still useful - especially for smaller projects, where a simple GUI is needed.

Thanks for updating this great piece of software and keep up the good work!
Gonzo
Posts: 722
Joined: Dec 11, 2005 22:46

Postby Gonzo » May 29, 2011 2:44

It's a shame that there are no good visual designers yet for freebasic
freebasic has been out for what.. a decade soon?

if there was a decent designer i would consider remaking SSedit in fb

EDIT: i tried this, and its a good start. i like that its a simple designer :)
but it does seem to be dependent on wxwidgets.. seems to require a DLL
and its hardly a good design enviroment :/
MOD
Posts: 555
Joined: Jun 11, 2009 20:15

Postby MOD » May 29, 2011 15:17

St_W: thank you for the kind words. :)

Maybe I'll try to create more current headers for the 0.9.2 WX-C, depends on how many people are interested in this project.

Gonzo: the simplicity of this designer is why I'm doing this and yes, it will ever need this dll but it's much better than the bunch of dlls GTK needs.
Coolman
Posts: 211
Joined: Nov 05, 2010 15:09

Postby Coolman » May 30, 2011 15:49

Great job, congratulations...

I compiled wxwidgets 2.8.11 with gcc static mode (libs about 18 mo), using UBX converter (basic / c) I got enforced independently of any dlls approximately 2 mo for a simple program facillement compressible upx for approximately 600 kb, the program generated can be used without any dependence even under Windows 2000, wxwidgets is a fantastic cross-platform library that covers virtually all needs of a developer, the license is very permissive since it allows Static compilation with gcc the linkage is intelligent, integrated executable only features used, I do not understand why the developers of other languages ​basics ​or FreeBasic do not use this library, it would provide a very powerful GUI running under Windows Linux MacOS and even different architectures arms ...

For more info, see the debate here:

http://basic-compiler.com/forum/index.p ... opic=347.0

ubx : pity that the author seems to lose interest in the project
http://basic-compiler.com/forum/index.p ... opic=376.0

wxbasic : Good language but it is an interpreter and the program generator uses a runtime, so any executable reached 8 mo ... it said the project is constantly evolving, and recently he was there 's an update for windows and linux ...
http://wxbasic.net/index.html
jcfuller
Posts: 324
Joined: Sep 03, 2007 18:40

Postby jcfuller » May 30, 2011 16:08

Coolman,
I have not lost interest. Just very busy with other things at this time.

James
Coolman
Posts: 211
Joined: Nov 05, 2010 15:09

Postby Coolman » May 30, 2011 21:53

jcfuller wrote:Coolman,
I have not lost interest. Just very busy with other things at this time.

James


Glad to hear this

good luck
MOD
Posts: 555
Joined: Jun 11, 2009 20:15

Postby MOD » May 31, 2011 17:18

I've added some screenshots and a simple calculator as a sample, see first post.
petan
Posts: 683
Joined: Feb 16, 2010 15:34
Location: Europe
Contact:

Postby petan » Jun 01, 2011 9:37

Looks good, thx for your job.
I am searching all the time simple, powerfull, crossplatform, well documented GUI, but no one has in examples needed things - scrolling very long text/file in window and scrolling very big image/picture.

Pete
TJF
Posts: 3486
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Jun 01, 2011 10:49

petan wrote:... but no one has in examples needed things - scrolling very long text/file in window and scrolling very big image/picture.

That's pretty simple in GTK. You may have a look at GTK+tobac (source code and GUI-XML-file). A GtkTextView is used for output (images are similar).

In general:
    make an image/textview in your GUI
    cover it by a scroll-area
    use scroll functions to move to the desired portion of your view (if needed)
petan
Posts: 683
Joined: Feb 16, 2010 15:34
Location: Europe
Contact:

Postby petan » Jun 01, 2011 12:23

@ TJF
Ok, and has it these examples directly in package ??, actually I have opened 3 projects under old good graphics and not too much time to learn new GUI program flow and coding.Easy understanding of new coding is high priority for change of my working style.

Pete
MOD
Posts: 555
Joined: Jun 11, 2009 20:15

Postby MOD » Jun 01, 2011 12:45

Here you have a minimal example for a textcontrol with scrollbars with wx-c:

Code: Select all

#Include "wx-c/wx.bi"
#Define wxCLOSE_BOX &h1000
#Define FALSE 0
#Define TRUE (NOT FALSE)

Declare Sub App_OnInit( )
Declare Sub App_OnExit( )


Dim Shared As wxApp Ptr wx_app
Dim Shared As wxFrame Ptr wx_frame
Dim Shared As wxPanel Ptr wx_panel


Sub App_OnInit( )
   
    wx_frame = wxFrame( )
    wxImage_InitAllHandlers( )
   
    wxFrame_Create( wx_frame, 0, -1, "Example", wxSize( -1, -1 ), wxSize( 376, 396 ), wxDEFAULT_FRAME_STYLE Or wxCLOSE_BOX Xor wxMAXIMIZE_BOX Xor wxRESIZE_BORDER, "frame" )
    wx_panel = wxPanel_ctor2( wx_frame, -1, wxSize( -1, -1 ), wxSize( -1, -1 ), 0, 0 )
   
    ''
    '' create widget richtext0
    ''
    Dim As wxTextCtrl Ptr richtext0
    richtext0 = wxTextCtrl( )
    wxTextCtrl_Create( richtext0, wx_panel, -1, "", wxSize( 10, 10 ), wxSize( 350, 350 ), wxTE_PROCESS_ENTER Or wxTE_MULTILINE Or wxTE_Rich Or wxTE_RICH2 Or wxVSCROLL Or wxHSCROLL, 0, 0 )
    wxTextCtrl_SetValue( richtext0, !"foobarfoobarfoobarfoobar\nfoobarfoobar\n\n\n\nfoobarfoobar\n\n\n\nfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobar\n\n\n\n\n\n\n\n\n\nfoobarfoobarfoobar\nfoobar\n\n\n\n\n\n\n\nfoobar" )
   
    wxWindow_Show( wx_frame, 1 )
    wxApp_OnInit( wx_app )
   
End Sub

Sub App_OnExit( )
   
    wxApp_OnExit( wx_app )
   
End Sub


''main
wx_app = wxApp( )
wxApp_RegisterVirtual ( wx_app, Cast( Virtual_OnInit, @App_OnInit ), Cast( Virtual_OnExit, @App_OnExit ) )
wxApp_Run(0, 0)
End


For images it seems to be a little trickier. It's easy to show an image but I'm not sure how to set an autoworking scrollbar on it (it's easy to set a scrollbar on it but you would have to do all the handling code by yourself).
TJF
Posts: 3486
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Postby TJF » Jun 01, 2011 18:59

petan wrote:@ TJF
Ok, and has it these examples directly in package ??, actually I have opened 3 projects under old good graphics and not too much time to learn new GUI program flow and coding.Easy understanding of new coding is high priority for change of my working style.

Pete

What do you expect? Examples exactly matching your problem? You won't look for GUI toolkits if you don't need one. So I recommend to spend some time to learn to use a professional toolkit and safe alot of time later on.

Here's an GTK example with a scrollable text view. This program reads one or more files from URI(s) and shows each file in a separate window. The filenames are red from the command line parameters. You'll need GTK-3 to compile it

Code: Select all

' This is file gtk_applicationE110.bas, an example for GTK3
' (C) 2011 by Thomas[ dot ]Freiherr[ at ]gmx{ dot }net
' License GPLv 3
'
' See for details (A simple application)
' http://developer.gnome.org/gtk3/stable/GtkApplication.html

#INCLUDE ONCE "TJF/gtk.bi"

SUB new_window (BYVAL app AS GApplication PTR, _
                BYVAL file AS GFile PTR)
  VAR win = gtk_window_new (GTK_WINDOW_TOPLEVEL)
  gtk_window_set_application (GTK_WINDOW (win), GTK_APPLICATION (app))
  gtk_window_set_title (GTK_WINDOW (win), "Bloatpad")
  VAR scrolled = gtk_scrolled_window_new (NULL, NULL)
  VAR vie = gtk_text_view_new ()
  gtk_container_add (GTK_CONTAINER (scrolled), vie)
  gtk_container_add (GTK_CONTAINER (win), scrolled)

  IF file THEN
    DIM AS gchar PTR contents
    DIM AS gsize length

    IF g_file_load_contents (file, NULL, @contents, @length, NULL, NULL) THEN
      VAR buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (vie))
      gtk_text_buffer_set_text (buffer, contents, length)
      g_free (contents)
    END IF
  END IF

  gtk_widget_show_all (GTK_WIDGET (win))
END SUB

TYPE AS GtkApplication BloatPad
TYPE AS GtkApplicationClass BloatPadClass

G_DEFINE_TYPE (BloatPad, bloat_pad, GTK_TYPE_APPLICATION)

SUB bloat_pad_open CDECL(BYVAL app AS GApplication PTR, _
                         BYVAL files AS GFile PTR PTR, _
                         BYVAL n_files AS gint, _
                         BYVAL hint AS CONST gchar PTR)
  FOR i AS gint = 0 TO n_files - 1
    new_window (app, files[i])
  NEXT
END SUB

SUB bloat_pad_activate CDECL(BYVAL app AS GApplication PTR)
  new_window (app, NULL)
END SUB

SUB bloat_pad_finalize CDECL(BYVAL object AS GObject PTR)
  G_OBJECT_CLASS (bloat_pad_parent_class)->finalize (object)
END SUB

SUB bloat_pad_init CDECL(BYVAL app AS BloatPad PTR)
END SUB

SUB bloat_pad_class_init CDECL(BYVAL clas AS BloatPadClass PTR)
  G_OBJECT_CLASS(clas)->finalize = @bloat_pad_finalize

  G_APPLICATION_CLASS(clas)->activate = @bloat_pad_activate
  G_APPLICATION_CLASS(clas)->open_TJF = @bloat_pad_open
END SUB

FUNCTION bloat_pad_new () AS BloatPad PTR
  g_type_init ()

  RETURN g_object_new (bloat_pad_get_type (), _
                       "application-id", "org.gtk.Test.bloatpad", _
                       "flags", G_APPLICATION_HANDLES_OPEN, _
                       NULL)
END FUNCTION



VAR bloat_pad = bloat_pad_new ()
VAR status = g_application_run (G_APPLICATION (bloat_pad), __FB_ARGC__, __FB_ARGV__)
g_object_unref (bloat_pad)

END status

The code for opening the windows, creating the scrollable textviews and loading the files is in the first SUB new_window. The rest is to handle the command line and to register the application at the OS.
petan
Posts: 683
Joined: Feb 16, 2010 15:34
Location: Europe
Contact:

Postby petan » Jun 02, 2011 9:29

Thanks for both examples, guys !
A man needs a couple of examples to compare easyness or easyless for writing by new syntax etc..Learning is necessary, but first is final choice of new tool for coding.

Pete
D.J.Peters
Posts: 7852
Joined: May 28, 2005 3:28

Postby D.J.Peters » Jul 02, 2011 12:56

hello MOD
first of all wxWidgets are new for me and I don't like to create a second wxDesigner project.

What i know so far:
wxWidgets resources can be defined in an XML file with the *.XRC extension.

The most wx GUI designers (i know) supports the creation of source code or XML.
wxGlade *.h *.cpp and *.py (phyton)
wxSmith (inside of my code::blocks IDE) *.h *.cpp *.wxs (is XML)
wxFormBuilder (standalone and usable via code::blocks) *.h *.cpp *.fbp (is XML)

The XRC (xml) files are an well documented wxWidget resource standard
http://docs.wxwidgets.org/trunk/overview_xrcformat.html

Here my question will your tool support *.xrc files in future too ?

Joshy
Last edited by D.J.Peters on Jul 02, 2011 16:51, edited 1 time in total.

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 1 guest