Re: [Gambas-user] Unittest for Gambas
Christof, nice work. Thanks. I'll be giving this a once over with me eye :-) danke On Fri, Sep 23, 2016 at 7:48 AM, Christof Thalhofer wrote: > Hello, > > one of the things I felt Gambas was lacking, was unittests. When I was > developping software with Gambas I always had a couple of testmodules in > my projects lying around, but it was not very satisfying. Especially, > because I had to rewrite stuff for each new library. > > So I searched for elaborated solutions for unittests for Gambas, but > couldnt find one. > > The only thing I found was an old framework written in Visual Basic, > called ComUnit. It was kind of software archeology to understand, how > this thing worked as I decided to fork it. And it took a couple of days > (fortunately I suffered with influenza, so I had a little time) to > rewrite it for Gambas. > > But now it is usable, it works in my projects, with Gambas 3.9. > > It is basic (sic!), there are no parameterized tests, I do not know, > whether it is secure, whether classes are exposed unnecessarily, whether > it is useful for automation of tests and it's a mixture of mine and the > original author's coding style. But I think, it could be a good > beginning. It's here: > > https://github.com/Deganius/gb.deg.unittest/ > > And in the Software Farm. But naturally more recent at Github. > > I would be glad if you could try it out. "Throw an eye on it" as the > crazy Germans say ;-) > > > Alles Gute > > Christof Thalhofer > > -- > Dies ist keine Signatur > > > > -- > > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > > -- Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] Columnview "collapse" function
What in the name of American erections am I doing wrong here? Public Sub mnuCollapse_Click() ' Collapse all nodes to the level of the selected node Dim hNode As CNode Dim hAttr As String Dim iLevel As Integer hNode = $hDoc.Index[tvwDoc.Key] iLevel = hNode.Level START_HERE: tvwDoc.MoveFirst While tvwDoc.MoveNext() hNode = $hDoc.Index[tvwDoc.Item.Key] '<-- All "seems" to fall apart here? If hNode.Level >= iLevel Then tvwDoc.Item.Expanded = False Endif Wend End tvwDoc is a ColumnView. There is a selected item in the _TreeView, Thus, tvwDoc.Key provides a key into the $hDoc.Index collection from which I can determine the object that was used to populate that columnView branch and from that objects values I can see the "Level" that I want. All that works fine. What I am trying to do is go through the ColumnView branches and "collapse" any branch of the same "Level". Which gets us to START_HERE. There must be something absolutely, stupidly, simple that I am trying to do wrong here - :-( Any help. rgrds b -- B Bruen -- Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas2 Grab in Gambas3
2016-11-09 17:45 GMT+01:00 Richard Welch : > Fabien, thank you for your reply. > > There are snags with each of these... > > First approach: > > Although the DrawingArea is often fully visible on screen, sometimes it > will be too big. > I can think of a way round this but it is not very elegant! > > Second approach: > > The image is sometimes highly complex and can comprise hundreds of > rectangles and lines as well as text. I already do use generic > functions as you describe, with variable-driven adjustments to cope with > the differences between printing and screen display. There are many > places in the code which may build a display. > > I found in G2 that there were times when the image in a DrawingArea was > not restored if it was partially covered by a window from another > application and then exposed once more. This mechanism enabled it to be > restored easily without having to rebuild it from scratch. Maybe the > DrawingArea in G3 is more robust? And why not using cached mode ? > > Richard > > > On 08/11/16 17:31, Fabien Bodard wrote: >> Well... there is two answers. >> >> First : >> >> Use the Desktop.ScreenShot Function >> (http://gambaswiki.org/wiki/comp/gb.qt4/desktop/screenshot). >> But your widget must be visible on the screen... This is why it is a >> SCREEN shot. >> >> >> Second : >> >> When you are drawing something in a drawingarea you use a generic >> drawing function. >> >> Exemple : >> >> >> Public sub DrawingArea_Draw() >> >> DrawARect() >> >> End >> >> >> Private Sub DrawARect() >> >>Paint.Brush = Brush.Color(Color.Yellow) >>Paint.Rectangle(10,10,Paint.Width - 20, Paint.Height - 20) >>Paint.Fill >> >> End >> >> >> Public Function MakeImage(iWidth as integer, iHeight as integer) as Image >> >>Dim hImage a new Image(iWidth, iHeight, Color.White) >> >>Paint.Begin(hImage) >> DrawARect() >>Paint.End >> >> End >> >> >> With that you have only one drawing function (DrawARect) able to draw >> every where ... even on a printer. This is the way used in most of the >> components too >> >> 2016-11-08 12:52 GMT+01:00 Richard Welch : >>> I need a simple way to copy the current image in a visible DrawingArea >>> to a hidden PictureBox. >>> >>> The project was written in Gambas2, where a simple Grab method did the >>> trick, but in G3 this does something different so the converted code >>> does not function fully. >>> >>> FMain.pbxPicture.W = FMain.drwRep.W >>> FMain.pbxPicture.H = FMain.drwRep.H >>> FMain.pbxPicture.Background = FMain.drwRep.Background >>> FMain.pbxPicture.Picture = FMain.drwRep.Grab() >>> >>> With what do I replace the Grab method? >>> >>> (The DrawingArea is painted in many different pieces of code, depending >>> on context, so I want to make the change which will have the smallest >>> impact possible on the source code) >>> >>> There is a gambas-user thread started around 19 April 2012. >>> Is this fully relevant? >>> Is this the /simplest/ answer? >>> It would need some very tedious testing in my context. >>> >>> -- >>> Developer Access Program for Intel Xeon Phi Processors >>> Access to Intel Xeon Phi processor-based developer platforms. >>> With one year of Intel Parallel Studio XE. >>> Training and support from Colfax. >>> Order your platform today. http://sdm.link/xeonphi >>> ___ >>> Gambas-user mailing list >>> Gambas-user@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/gambas-user >> >> > > > -- > Developer Access Program for Intel Xeon Phi Processors > Access to Intel Xeon Phi processor-based developer platforms. > With one year of Intel Parallel Studio XE. > Training and support from Colfax. > Order your platform today. http://sdm.link/xeonphi > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user -- Fabien Bodard -- Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] FileChooser select bug
Thanks BenoƮt that is useful information. -- View this message in context: http://gambas.8142.n7.nabble.com/FileChooser-select-bug-tp57735p57740.html Sent from the gambas-user mailing list archive at Nabble.com. -- Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas2 Grab in Gambas3
Fabien, thank you for your reply. There are snags with each of these... First approach: Although the DrawingArea is often fully visible on screen, sometimes it will be too big. I can think of a way round this but it is not very elegant! Second approach: The image is sometimes highly complex and can comprise hundreds of rectangles and lines as well as text. I already do use generic functions as you describe, with variable-driven adjustments to cope with the differences between printing and screen display. There are many places in the code which may build a display. I found in G2 that there were times when the image in a DrawingArea was not restored if it was partially covered by a window from another application and then exposed once more. This mechanism enabled it to be restored easily without having to rebuild it from scratch. Maybe the DrawingArea in G3 is more robust? Richard On 08/11/16 17:31, Fabien Bodard wrote: > Well... there is two answers. > > First : > > Use the Desktop.ScreenShot Function > (http://gambaswiki.org/wiki/comp/gb.qt4/desktop/screenshot). > But your widget must be visible on the screen... This is why it is a > SCREEN shot. > > > Second : > > When you are drawing something in a drawingarea you use a generic > drawing function. > > Exemple : > > > Public sub DrawingArea_Draw() > > DrawARect() > > End > > > Private Sub DrawARect() > >Paint.Brush = Brush.Color(Color.Yellow) >Paint.Rectangle(10,10,Paint.Width - 20, Paint.Height - 20) >Paint.Fill > > End > > > Public Function MakeImage(iWidth as integer, iHeight as integer) as Image > >Dim hImage a new Image(iWidth, iHeight, Color.White) > >Paint.Begin(hImage) > DrawARect() >Paint.End > > End > > > With that you have only one drawing function (DrawARect) able to draw > every where ... even on a printer. This is the way used in most of the > components too > > 2016-11-08 12:52 GMT+01:00 Richard Welch : >> I need a simple way to copy the current image in a visible DrawingArea >> to a hidden PictureBox. >> >> The project was written in Gambas2, where a simple Grab method did the >> trick, but in G3 this does something different so the converted code >> does not function fully. >> >> FMain.pbxPicture.W = FMain.drwRep.W >> FMain.pbxPicture.H = FMain.drwRep.H >> FMain.pbxPicture.Background = FMain.drwRep.Background >> FMain.pbxPicture.Picture = FMain.drwRep.Grab() >> >> With what do I replace the Grab method? >> >> (The DrawingArea is painted in many different pieces of code, depending >> on context, so I want to make the change which will have the smallest >> impact possible on the source code) >> >> There is a gambas-user thread started around 19 April 2012. >> Is this fully relevant? >> Is this the /simplest/ answer? >> It would need some very tedious testing in my context. >> >> -- >> Developer Access Program for Intel Xeon Phi Processors >> Access to Intel Xeon Phi processor-based developer platforms. >> With one year of Intel Parallel Studio XE. >> Training and support from Colfax. >> Order your platform today. http://sdm.link/xeonphi >> ___ >> Gambas-user mailing list >> Gambas-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/gambas-user > > -- Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] [Gambas Bug Tracker] Bug #1029: BUG: SpinBar does not block mousewheel scroll when inside a scrollview
http://gambaswiki.org/bugtracker/edit?object=BUG.1029&from=L21haW4- Antonio OREFICE reported a new bug. Summary --- BUG: SpinBar does not block mousewheel scroll when inside a scrollview Type : Bug Priority : Medium Gambas version : 3.9 Product : GUI components Description --- The subject pretty tells you all. When one tries to use the mousewheel on a spinbar inside a scrollview, the scrollview does scroll and the spinbar looses focus. It happens with textboxes too, but not on spinboxes. The following example trigs the bug: Public Sub Form_Open() Dim aScrollView As Scrollview Dim aSpinbar As Spinbar Dim atextbox As Textbox Dim aspinbox As Spinbox Dim i As Integer Me.Arrangement = arrange.fill aScrollView = New ScrollView(Me) aScrollView.expand = True ascrollview.arrangement = Arrange.vertical For i = 1 To 20 aSpinBar = New SpinBar(aScrollView) aSpinbar.h = 30 atextbox = New TextBox(ascrollview) atextbox.h = 30 aspinbox = New Spinbox(ascrollview) aspinbox.h = 30 Next End System information -- [System] Gambas=3.9.1 OperatingSystem=Linux Kernel=4.8.6-1-ARCH Architecture=x86_64 Distribution=Arch Linux Desktop=KDE5 Theme=Breeze Language=it_IT.utf8 Memory=7933M [Libraries] Cairo=libcairo.so.2.11400.6 Curl=libcurl.so.4.4.0 DBus=libdbus-1.so.3.14.8 GStreamer=libgstreamer-0.10.so.0.30.0 GStreamer=libgstreamer-1.0.so.0.1000.0 GTK+2=libgtk-x11-2.0.so.0.2400.31 GTK+3=libgtk-3.so.0.2200.2 OpenGL=libGL.so.1.0.0 OpenGL=libGL.so.1.2.0 Poppler=libpoppler.so.63.0.0 QT4=libQtCore.so.4.7.4 QT4=libQtCore.so.4.8.7 QT5=libQt5Core.so.5.3.2 QT5=libQt5Core.so.5.7.0 SDL=libSDL-1.2.so.0.11.4 SQLite=libsqlite3.so.0.8.6 [Environment] ANT_HOME=/usr/share/apache-ant Automoc4_DIR=/usr/lib/automoc4 CCACHEPATH=/usr/lib/ccache/bin DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus DESKTOP_SESSION=/usr/share/xsessions/plasma DISPLAY=:0 EDITOR=nano GB_GUI=gb.qt5 GS_LIB=/.fonts GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/.gtkrc-2.0:/.config/gtkrc-2.0 GTK_MODULES=canberra-gtk-module GTK_RC_FILES=/etc/gtk/gtkrc:/.gtkrc:/.config/gtkrc HG=/usr/bin/hg HISTCONTROL=ignoredups HISTSIZE=5 HOME= INFINALITY_FT= INFINALITY_FT_AUTOFIT_FORCE_SLIGHT_HINTING=true INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=0 INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=0 INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25 INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE=0 INFINALITY_FT_BOLD_EMBOLDEN_Y_VALUE=0 INFINALITY_FT_BRIGHTNESS=0 INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0 INFINALITY_FT_CONTRAST=-20 INFINALITY_FT_FILTER_PARAMS=7 25 44 25 7 INFINALITY_FT_FRINGE_FILTER_STRENGTH=0 INFINALITY_FT_GAMMA_CORRECTION=0 100 INFINALITY_FT_GLOBAL_EMBOLDEN_X_VALUE=0 INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE=0 INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0 INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=0 INFINALITY_FT_STEM_FITTING_STRENGTH=0 INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0 INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true INFINALITY_FT_USE_VARIOUS_TWEAKS=true INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0 INTEL_BATCH=1 KDE_FULL_SESSION=true KDE_MULTIHEAD=false KDE_SESSION_UID=0 KDE_SESSION_VERSION=5 KMIX_PULSEAUDIO_DISABLE=1 KWIN_NVIDIA_HACK=1 LANG=it_IT.utf8 LANGUAGE=en_US LC_COLLATE=C LD_LIBRARY_PATH=/usr/local/lib/icu-55/ LESS_TERMCAP_mb=[01;31m LESS_TERMCAP_md=[01;31m LESS_TERMCAP_me=[0m LESS_TERMCAP_se=[0m LESS_TERMCAP_so=[01;44;33m LESS_TERMCAP_ue=[0m LESS_TERMCAP_us=[01;32m LOGNAME= LS_COLORS=rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36: *.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36: MAIL=/var/spool/mail MOZ_DISABLE_PANGO=1 MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins NXDIR=/usr/lib/nx OOO_FORCE_DESKTOP=gnome PATH=/usr/lib/ccache/bin:/usr/lib/nx/bin:/usr/lib/hardening-wrapper/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/platform-tools:/opt/cuda/bin:/opt/depot_tools:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_p