[DEVELOPMENT ENVIRONMENT]

* BUG: Always correctly round control coordinates in the form editor when 
  the form Scaled property is set.

[GB.FORM]
* BUG: Clicking inside the FontChooser style ListBox now always works 
  correctly.

[GB.GTK]
* BUG: Setting the Control.Tracking property should work correctly in all 
  cases now.
* BUG: Prevent a crash when creating an Image or a Picture with incorrect
  constructor arguments.

[GB.IMAGE.EFFECT]
* BUG: Use accurate compilation flags.

[GB.NET]
* BUG: Clear the CR / NL input conversion flags when initializing a serial 
  port.

[GB.QT4]
* BUG: Setting MovieBox Path property to NULL does not fail anymore.
* BUG: Do not try to reparent a window in its Show() method when it is 
  already visible.


git-svn-id: svn://localhost/gambas/trunk@2618 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2010-01-20 00:52:50 +00:00
parent 4e17272a76
commit 927a153b22
16 changed files with 88 additions and 59 deletions

View File

@ -261,10 +261,12 @@ AC_DEFUN([GB_INIT],
if test "x$gambas_optimization" = "xyes"; then if test "x$gambas_optimization" = "xyes"; then
AM_CFLAGS_OPT="$AM_CFLAGS -O3" AM_CFLAGS_OPT="$AM_CFLAGS -O3"
AM_CFLAGS="$AM_CFLAGS -Os" AM_CFLAGS="$AM_CFLAGS -Os"
AM_CXXFLAGS_OPT="$AM_CXXFLAGS -O3 -fno-omit-frame-pointer"
AM_CXXFLAGS="$AM_CXXFLAGS -Os -fno-omit-frame-pointer" AM_CXXFLAGS="$AM_CXXFLAGS -Os -fno-omit-frame-pointer"
else else
AM_CFLAGS_OPT="$AM_CFLAGS -O0" AM_CFLAGS_OPT="$AM_CFLAGS -O0"
AM_CFLAGS="$AM_CFLAGS -O0" AM_CFLAGS="$AM_CFLAGS -O0"
AM_CXXFLAGS_OPT="$AM_CXXFLAGS -O0"
AM_CXXFLAGS="$AM_CXXFLAGS -O0" AM_CXXFLAGS="$AM_CXXFLAGS -O0"
fi fi
@ -274,6 +276,7 @@ AC_DEFUN([GB_INIT],
AC_SUBST(AM_CFLAGS) AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_CFLAGS_OPT) AC_SUBST(AM_CFLAGS_OPT)
AC_SUBST(AM_CXXFLAGS) AC_SUBST(AM_CXXFLAGS)
AC_SUBST(AM_CXXFLAGS_OPT)
rm -f DISABLED rm -f DISABLED
]) ])

View File

@ -33,9 +33,10 @@ File[6]="/home/benoit/gambas/3.0/trunk/app/src/MakeWebSite/news/2009-11-29.html:
File[7]="/home/benoit/gambas/3.0/trunk/app/src/MakeWebSite/news/2010-01-04.html:3.58" File[7]="/home/benoit/gambas/3.0/trunk/app/src/MakeWebSite/news/2010-01-04.html:3.58"
File[8]="/home/benoit/gambas/3.0/trunk/app/src/MakeWebSite/news.html:6.20" File[8]="/home/benoit/gambas/3.0/trunk/app/src/MakeWebSite/news.html:6.20"
File[9]="/home/benoit/gambas/3.0/trunk/app/src/MakeWebSite/gambas.sourceforge.net/style.css:80.0" File[9]="/home/benoit/gambas/3.0/trunk/app/src/MakeWebSite/gambas.sourceforge.net/style.css:80.0"
Active=10
File[10]="/home/benoit/gambas/3.0/trunk/app/src/MakeWebSite/gambas.sourceforge.net/style-rtl.css:81.0" File[10]="/home/benoit/gambas/3.0/trunk/app/src/MakeWebSite/gambas.sourceforge.net/style-rtl.css:81.0"
Count=10 Active=11
File[11]="/home/benoit/gambas/3.0/trunk/app/src/MakeWebSite/authors.txt:0.0"
Count=11
[Watches] [Watches]
Count=0 Count=0

View File

@ -409,7 +409,7 @@ Private Sub FromString(sData As String, Optional hParent As CControl)
cCoord = Split(Mid$(sLine, 12, -1)) cCoord = Split(Mid$(sLine, 12, -1))
'TRY PRINT cCoord[0]; ","; cCoord[1]; ","; cCoord[2]; ","; cCoord[3] 'TRY PRINT cCoord[0]; ","; cCoord[1]; ","; cCoord[2]; ","; cCoord[3]
Try hCtrl.Move(CFloat(cCoord[0]) * Desktop.Scale, CFloat(cCoord[1]) * Desktop.Scale, True) Try hCtrl.Move(Round(CFloat(cCoord[0]) * Desktop.Scale), Round(CFloat(cCoord[1]) * Desktop.Scale), True)
'TRY hCtrl.SetProperty("X", Val(cCoord[0])) 'TRY hCtrl.SetProperty("X", Val(cCoord[0]))
'TRY hCtrl.SetProperty("Y", Val(cCoord[1])) 'TRY hCtrl.SetProperty("Y", Val(cCoord[1]))
If cCoord.Count >= 2 Then If cCoord.Count >= 2 Then
@ -422,12 +422,12 @@ Private Sub FromString(sData As String, Optional hParent As CControl)
If eW = 0 Then If eW = 0 Then
iW = 1 iW = 1
Else Else
iW = eW * Desktop.Scale iW = Round(eW * Desktop.Scale)
Endif Endif
If eH = 0 Then If eH = 0 Then
iH = 1 iH = 1
Else Else
iH = eH * Desktop.Scale iH = Round(eH * Desktop.Scale)
Endif Endif
Try hCtrl.Resize(iW, iH, True) Try hCtrl.Resize(iW, iH, True)
Endif Endif

View File

@ -7,7 +7,7 @@
Spacing = True Spacing = True
Padding = 8 Padding = 8
{ fchChoose FileChooser { fchChoose FileChooser
MoveScaled(1,1,75,45) MoveScaled(1,1,87,47)
Expand = True Expand = True
ShowBookmark = True ShowBookmark = True
} }

View File

@ -118,7 +118,7 @@ msgstr ""
msgid "Show files" msgid "Show files"
msgstr "" msgstr ""
#: FFocusBug.class:34 FMain.class:56 #: FFocusBug.class:34 FMain.class:63
msgid "TextBox1" msgid "TextBox1"
msgstr "" msgstr ""
@ -128,43 +128,43 @@ msgid ""
"A message should appear" "A message should appear"
msgstr "" msgstr ""
#: FFontChooser.class:409 #: FFontChooser.class:410
msgid "Family" msgid "Family"
msgstr "" msgstr ""
#: FFontChooser.class:424 #: FFontChooser.class:425
msgid "Style" msgid "Style"
msgstr "" msgstr ""
#: FFontChooser.class:430 #: FFontChooser.class:431
msgid "Normal" msgid "Normal"
msgstr "" msgstr ""
#: FFontChooser.class:430 #: FFontChooser.class:431
msgid "Bold" msgid "Bold"
msgstr "" msgstr ""
#: FFontChooser.class:430 #: FFontChooser.class:431
msgid "Italic" msgid "Italic"
msgstr "" msgstr ""
#: FFontChooser.class:430 #: FFontChooser.class:431
msgid "Bold Italic" msgid "Bold Italic"
msgstr "" msgstr ""
#: FFontChooser.class:438 #: FFontChooser.class:440
msgid "Underline" msgid "Underline"
msgstr "" msgstr ""
#: FFontChooser.class:443 #: FFontChooser.class:445
msgid "Strikeout" msgid "Strikeout"
msgstr "" msgstr ""
#: FFontChooser.class:453 FileView.class:78 #: FFontChooser.class:455 FileView.class:78
msgid "Size" msgid "Size"
msgstr "" msgstr ""
#: FFontChooser.class:491 #: FFontChooser.class:493
msgid "How quickly daft jumping zebras vex" msgid "How quickly daft jumping zebras vex"
msgstr "" msgstr ""
@ -184,23 +184,23 @@ msgstr ""
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: FMain.class:35 #: FMain.class:42
msgid "Menu4" msgid "Menu4"
msgstr "" msgstr ""
#: FMain.class:42 #: FMain.class:49
msgid "Action 1" msgid "Action 1"
msgstr "" msgstr ""
#: FMain.class:46 #: FMain.class:53
msgid "Action 2" msgid "Action 2"
msgstr "" msgstr ""
#: FMain.class:50 #: FMain.class:57
msgid "Action 3" msgid "Action 3"
msgstr "" msgstr ""
#: FMain.class:61 #: FMain.class:69
msgid "Button1" msgid "Button1"
msgstr "" msgstr ""

View File

@ -1,5 +1,5 @@
# Gambas Project File 3.0 # Gambas Project File 3.0
# Compiled with Gambas 2.99.0 (r2587) # Compiled with Gambas 2.99.0 (r2606)
Startup=FMain Startup=FMain
StackTrace=1 StackTrace=1
Version=2.99.0 Version=2.99.0

View File

@ -176,7 +176,8 @@ Public Sub SetFont(sFont As String)
If Bold Then iStyle += 1 If Bold Then iStyle += 1
If Italic Then iStyle += 2 If Italic Then iStyle += 2
lstStyle[iStyle].Selected = True 'lstStyle[iStyle].Selected = True
lstStyle.Index = iStyle
chkUnderline.Value = UnderLine chkUnderline.Value = UnderLine
chkStrikeout.Value = StrikeOut chkStrikeout.Value = StrikeOut

View File

@ -1,18 +1,18 @@
# Gambas Form File 3.0 # Gambas Form File 3.0
{ Form Form { Form Form
MoveScaled(3,26,71.1667,44.1667) MoveScaled(3,26,71.1429,44.1429)
Text = ("") Text = ("")
Arrangement = Arrange.Vertical Arrangement = Arrange.Vertical
Spacing = 8 Spacing = True
{ HBox1 HBox { HBox1 HBox
MoveScaled(1,1,68,32) MoveScaled(1,1,68,32)
Expand = True Expand = True
Spacing = 8 Spacing = True
{ VBox1 VBox { VBox1 VBox
MoveScaled(2,2,24,27) MoveScaled(2,2,24,27)
Expand = True Expand = True
Spacing = 8 Spacing = True
{ lblFamily Label { lblFamily Label
MoveScaled(2,1,20,3) MoveScaled(2,1,20,3)
Text = ("Family") Text = ("Family")
@ -24,7 +24,7 @@
} }
{ panStyle VBox { panStyle VBox
MoveScaled(28,2,13,28) MoveScaled(28,2,13,28)
Spacing = 8 Spacing = True
{ lblStyle Label { lblStyle Label
MoveScaled(2,1,9,3) MoveScaled(2,1,9,3)
Text = ("Style") Text = ("Style")
@ -35,13 +35,14 @@
List = [("Normal"), ("Bold"), ("Italic"), ("Bold Italic")] List = [("Normal"), ("Bold"), ("Italic"), ("Bold Italic")]
} }
{ VBox2 VBox { VBox2 VBox
MoveScaled(1,20,11,7) MoveScaled(0,19,13,8)
AutoResize = True
{ chkUnderline CheckBox { chkUnderline CheckBox
MoveScaled(0,0,10,4) MoveScaled(0,0,13,4)
Text = ("Underline") Text = ("Underline")
} }
{ chkStrikeOut CheckBox { chkStrikeOut CheckBox
MoveScaled(0,3,10,4) MoveScaled(0,3,13,4)
Text = ("Strikeout") Text = ("Strikeout")
} }
} }

View File

@ -11,3 +11,9 @@ Public Sub Button1_Click()
Balloon.Info("Bonjour tout le monde !", Last) Balloon.Info("Bonjour tout le monde !", Last)
End End
Public Sub FontChooser1_Activate()
Debug FontChooser1.SelectedFont
End

View File

@ -20,11 +20,15 @@
} }
} }
{ TextBox1 TextBox { TextBox1 TextBox
MoveScaled(7,13,39,6) MoveScaled(9,6,39,6)
Text = ("TextBox1") Text = ("TextBox1")
} }
{ Button1 Button { Button1 Button
MoveScaled(21,5,12,5) MoveScaled(33,1,12,5)
Font = Font["Bold"]
Text = ("Button1") Text = ("Button1")
} }
{ FontChooser1 FontChooser
MoveScaled(1,15,71,38)
}
} }

View File

@ -167,7 +167,7 @@ END_METHOD
BEGIN_METHOD_VOID(CPICTURE_free) BEGIN_METHOD_VOID(CPICTURE_free)
PICTURE->unref(); if (PICTURE) PICTURE->unref();
END_METHOD END_METHOD

View File

@ -1634,19 +1634,23 @@ void gControl::setTracking(bool v)
{ {
if (v != _tracking) if (v != _tracking)
{ {
uint event_mask = gtk_widget_get_events(widget);
_tracking = v; _tracking = v;
if (v) if (v)
{ {
uint event_mask = gtk_widget_get_events(widget);
_old_tracking = event_mask & GDK_POINTER_MOTION_MASK; _old_tracking = event_mask & GDK_POINTER_MOTION_MASK;
gtk_widget_set_events(widget, event_mask | GDK_POINTER_MOTION_MASK); event_mask |= GDK_POINTER_MOTION_MASK;
} }
else else
{ {
if (_old_tracking) event_mask &= ~GDK_POINTER_MOTION_MASK;
gtk_widget_set_events(widget, gtk_widget_get_events(widget) | GDK_POINTER_MOTION_MASK); }
else
gtk_widget_set_events(widget, gtk_widget_get_events(widget) & ~GDK_POINTER_MOTION_MASK); if (!_old_tracking)
{
gtk_widget_unrealize(widget);
gtk_widget_set_events(widget, event_mask);
gtk_widget_realize(widget);
} }
} }
} }

View File

@ -391,7 +391,7 @@ int OpenSerialPort(int *fd,int iflow,struct termios *oldtio,char *sName,int nBau
} }
// cleaning default options // cleaning default options
newtio.c_cflag &= ~(CSIZE | CSTOPB | PARENB | PARODD | CRTSCTS); newtio.c_cflag &= ~(CSIZE | CSTOPB | PARENB | PARODD | CRTSCTS);
newtio.c_iflag &= ~( INPCK | ISTRIP | IGNPAR | IXON | IXOFF | IXANY ); newtio.c_iflag &= ~( INPCK | ISTRIP | IGNPAR | IXON | IXOFF | IXANY | ICRNL | INLCR );
newtio.c_lflag &= ~( ICANON | ECHO | ECHOE | ISIG ); newtio.c_lflag &= ~( ICANON | ECHO | ECHOE | ISIG );
// setting options // setting options
newtio.c_cflag= Of_Bits | Of_Stop | Of_Par | CLOCAL | CREAD | HUPCL | HardFlow; newtio.c_cflag= Of_Bits | Of_Stop | Of_Par | CLOCAL | CREAD | HUPCL | HardFlow;

View File

@ -46,24 +46,30 @@ static void free_movie(void *_object)
GB.ReleaseFile(THIS->addr, THIS->len); GB.ReleaseFile(THIS->addr, THIS->len);
GB.StoreString(NULL, &THIS->path); GB.StoreString(NULL, &THIS->path);
if (WIDGET)
WIDGET->setText("");
} }
static bool load_movie(void *_object, char *path, int len) static bool load_movie(void *_object, char *path, int len)
{ {
free_movie(THIS); free_movie(THIS);
//qDebug("load_movie: %.*s", (int)len, path); if (len > 0)
if (GB.LoadFile(path, len, &THIS->addr, &THIS->len)) {
return true; //qDebug("load_movie: %.*s", (int)len, path);
if (GB.LoadFile(path, len, &THIS->addr, &THIS->len))
return true;
THIS->ba = new QByteArray(); THIS->ba = new QByteArray();
THIS->ba->fromRawData((const char *)THIS->addr, THIS->len); THIS->ba->fromRawData((const char *)THIS->addr, THIS->len);
THIS->movie = new QMovie(*(THIS->ba)); THIS->movie = new QMovie(*(THIS->ba));
GB.NewString(&THIS->path, path, len); GB.NewString(&THIS->path, path, len);
//qDebug("setMovie"); //qDebug("setMovie");
WIDGET->setMovie(THIS->movie); WIDGET->setMovie(THIS->movie);
}
return false; return false;
} }
@ -100,7 +106,7 @@ BEGIN_PROPERTY(CMOVIEBOX_path)
if (load_movie(THIS, PSTRING(), PLENGTH())) if (load_movie(THIS, PSTRING(), PLENGTH()))
return; return;
if (!playing) if (!playing && THIS->movie)
THIS->movie->setPaused(true); THIS->movie->setPaused(true);
} }

View File

@ -1583,10 +1583,13 @@ void MyMainWindow::showActivate(QWidget *transient)
{ {
newParentWidget = CWINDOW_Current->widget.widget; newParentWidget = CWINDOW_Current->widget.widget;
if (newParentWidget && parentWidget() != newParentWidget) if (!isVisible())
{ {
//qDebug("showActivate"); if (newParentWidget && parentWidget() != newParentWidget)
doReparent(newParentWidget, windowFlags(), pos()); {
//qDebug("showActivate");
doReparent(newParentWidget, windowFlags(), pos());
}
} }
} }

View File

@ -6,7 +6,7 @@ gblib_LTLIBRARIES = gb.image.effect.la
libimageeffect_la_LIBADD = libimageeffect_la_LIBADD =
libimageeffect_la_LDFLAGS = -module @LD_FLAGS@ libimageeffect_la_LDFLAGS = -module @LD_FLAGS@
libimageeffect_la_CXXFLAGS = -I$(top_srcdir)/share $(AM_CFLAGS_OPT) libimageeffect_la_CXXFLAGS = -I$(top_srcdir)/share $(AM_CXXFLAGS_OPT)
libimageeffect_la_SOURCES = \ libimageeffect_la_SOURCES = \
kimageeffect.h kimageeffect.cpp \ kimageeffect.h kimageeffect.cpp \
@ -14,7 +14,7 @@ libimageeffect_la_SOURCES = \
gb_image_effect_la_LIBADD = libimageeffect.la gb_image_effect_la_LIBADD = libimageeffect.la
gb_image_effect_la_LDFLAGS = -module @LD_FLAGS@ gb_image_effect_la_LDFLAGS = -module @LD_FLAGS@
gb_image_effect_la_CXXFLAGS = -I$(top_srcdir)/share $(AM_CFLAGS) gb_image_effect_la_CXXFLAGS = -I$(top_srcdir)/share $(AM_CXXFLAGS)
gb_image_effect_la_SOURCES = \ gb_image_effect_la_SOURCES = \
main.cpp main.h qt.h \ main.cpp main.h qt.h \