From: Wagner, J. <ja...@me...> - 2011-06-09 21:29:33
|
John Henry (or anyone who can help), I need to use the Pythoncard PDF viewer that you built. I downloaded it, put the component in the component directory, put the sample in the sample directory, but I don't know what to do with Win32com and genpy. When I run the LayoutEditor, the component shows up, but it will not load. You stated: 1) Run win32com's genpy to activate Acrobat activeX support 2) Mod to pdfwin.py in wxPython to support Acrobat 9.0. This is not Pythoncard specific. Native wxPython needs this mod too. 3) A mod to an interface file created by win32com. Have no idea why this hack is needed because native wxPython sample program runs fine without it. Hopefully somebody that knows what's going can remove this hack. It looks like this is something Pythoncard users are assumed to know, but it is new to me. Can you explain or point me to a resource that deals with this? Thanks, John W |
From: John H. <ec...@ya...> - 2011-06-11 00:50:52
|
On 6/10/2011 2:54 AM, ec...@gm... wrote: > John, > > Both 1 & 2 are requirements from using win32com - not Pythoncard > specific. Run the genpy program that comes with win32com and select > Acrobox active x support. #2 is Acrobat 9 related. I included a > modified version of pdfwin.py in my upload. > > In short: > > a) Install win32com > b) Install wxpython > c) Locate genpy.py and run it. Select Acrobat Active support. > d) Update pdfwin.py to include Acrobat 9.0 support (compair original > version with the version I uploaded and should be obvious what need to > be done). > e) Try without step 3. May be the newer version of win32com doesn't > require it any more. > > On 6/9/2011 1:55 PM, Wagner, John wrote: >> >> John Henry (or anyone who can help), >> >> I need to use the Pythoncard PDF viewer that you built. I downloaded >> it, put the component in the component directory, put the sample in >> the sample directory, but I don't know what to do with Win32com and >> genpy. When I run the LayoutEditor, the component shows up, but it >> will not load. >> >> You stated: >> >> 1)Run win32com's genpy to activate Acrobat activeX support >> >> 2) Mod to pdfwin.py in wxPython to support Acrobat 9.0. This is not >> Pythoncard specific. Native wxPython needs this mod too. >> >> 3) A mod to an interface file created by win32com. Have no idea why >> this hack is needed because native wxPython sample program runs fine >> without it. Hopefully somebody that knows what's going can remove >> this hack. >> >> It looks like this is something Pythoncard users are assumed to know, >> but it is new to me. Can you explain or point me to a resource that >> deals with this? >> >> Thanks, >> >> John W >> >> >> ------------------------------------------------------------------------------ >> EditLive Enterprise is the world's most technically advanced content >> authoring tool. Experience the power of Track Changes, Inline Image >> Editing and ensure content is compliant with Accessibility Checking. >> http://p.sf.net/sfu/ephox-dev2dev >> >> >> _______________________________________________ >> Pythoncard-users mailing list >> Pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/pythoncard-users > > > -- > Kim Cheung |
From: John H. <ec...@ya...> - 2011-06-16 14:18:41
|
John, did it worked? On 6/10/2011 2:54 AM, ec...@gm... wrote: > John, > > Both 1 & 2 are requirements from using win32com - not Pythoncard > specific. Run the genpy program that comes with win32com and select > Acrobox active x support. #2 is Acrobat 9 related. I included a > modified version of pdfwin.py in my upload. > > In short: > > a) Install win32com > b) Install wxpython > c) Locate genpy.py and run it. Select Acrobat Active support. > d) Update pdfwin.py to include Acrobat 9.0 support (compair original > version with the version I uploaded and should be obvious what need to > be done). > e) Try without step 3. May be the newer version of win32com doesn't > require it any more. > > On 6/9/2011 1:55 PM, Wagner, John wrote: >> >> John Henry (or anyone who can help), >> >> I need to use the Pythoncard PDF viewer that you built. I downloaded >> it, put the component in the component directory, put the sample in >> the sample directory, but I don't know what to do with Win32com and >> genpy. When I run the LayoutEditor, the component shows up, but it >> will not load. >> >> You stated: >> >> 1)Run win32com's genpy to activate Acrobat activeX support >> >> 2) Mod to pdfwin.py in wxPython to support Acrobat 9.0. This is not >> Pythoncard specific. Native wxPython needs this mod too. >> >> 3) A mod to an interface file created by win32com. Have no idea why >> this hack is needed because native wxPython sample program runs fine >> without it. Hopefully somebody that knows what's going can remove >> this hack. >> >> It looks like this is something Pythoncard users are assumed to know, >> but it is new to me. Can you explain or point me to a resource that >> deals with this? >> >> Thanks, >> >> John W >> >> >> ------------------------------------------------------------------------------ >> EditLive Enterprise is the world's most technically advanced content >> authoring tool. Experience the power of Track Changes, Inline Image >> Editing and ensure content is compliant with Accessibility Checking. >> http://p.sf.net/sfu/ephox-dev2dev >> >> >> _______________________________________________ >> Pythoncard-users mailing list >> Pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/pythoncard-users > > > -- > Kim Cheung |
From: hwg <hw...@ya...> - 2011-06-17 20:23:23
|
Is it possible to dynamically (programatically) change the size of the font inside a Text Area? I tried the following: from PythonCard import model class MainWindow(model.Background): def on_Slider1_mouseUp(self, event): sliderValue = self.components.Slider1.value self.components.TextArea1.font['size'] = sliderValue app = model.Application(MainWindow) app.MainLoop() When I run this and move the slider, I get the error: TypeError: 'Font' object does not support item assignment. Is there a way to do this? Thanks, hwg |
From: John H. <ec...@ya...> - 2011-06-19 13:25:32
|
On 6/18/2011 11:45 PM, ec...@gm... wrote: > font is not a dictionary. It's a class. Try font._size > > On 6/17/2011 1:23 PM, hwg wrote: >> from PythonCard import model >> class MainWindow(model.Background): >> def on_Slider1_mouseUp(self, event): >> sliderValue = self.components.Slider1.value >> self.components.TextArea1.font['size'] = sliderValue >> >> app = model.Application(MainWindow) >> app.MainLoop() > > > -- > Kim Cheung |
From: Lawrence A. <la...@gm...> - 2011-06-21 14:45:57
|
try font = self.components.TextArea1.GetFont() instead of font = self.components.TextArea1.font also you will need to ensure the slider output values are legitimate font sizes also should be no need to import wx with SetPointSize method Cheers, Lawrie On Tue, Jun 21, 2011 at 10:23 PM, hwg <hw...@ya...> wrote: > I tried both of the methods below: > I get the following error: > Traceback (most recent call last): > File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408, in > _dispatch > handler(background, aWxEvent) > File > "C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider_text.py", > line 11, in on_Slider1_mouseUp > font.SetPointSize(sliderValue) > AttributeError: 'Font' object has no attribute 'SetPointSize' > > Here's the complete code: > # pc_slider_text.py > # try to change the size of text font in a test box using a slider > > from wx import * > from PythonCard import model > class MainWindow(model.Background): > def on_Slider1_mouseUp(self, event): > sliderValue = self.components.Slider1.value > print sliderValue > font = self.components.TextArea1.font > font.SetPointSize(sliderValue) > self.components.TextArea1.SetFont(font) > print self.components.TextArea1.font > > app = model.Application(MainWindow) > app.MainLoop() > > ________________________________ > From: Lawrence Abbott <la...@gm...> > To: hwg <hw...@ya...> > Sent: Monday, June 20, 2011 10:37 PM > Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea > > A slightly cleaner way > > font = self.components.TextArea1.GetFont() > font.SetPointSize(16) > self.components.TextArea1.SetFont(font) > > Cheers, > Lawrie > > On Tue, Jun 21, 2011 at 12:26 PM, Lawrence Abbott <la...@gm...> wrote: >> Hi, >> >> self.components.TextArea1.font_size = sliderValue >> >> doesnt work for me >> >> print self.components.TextArea1.font.size >> >> gives a dictionary of font attributes, but I can't get them to update >> either >> >> import wx >> >> font_size =16 >> >> font1 = self.components.TextArea1.GetFont() >> font2 = wx.Font(font_size, font1.Family, font1.Style, font1.Weight) >> self.components.TextArea1.SetFont( font2 ) >> >> seems to work >> >> HTH, >> Lawrie >> >> On Mon, Jun 20, 2011 at 2:27 AM, hwg <hw...@ya...> wrote: >>> I tried: >>> >>> self.components.TextArea1.font_size = sliderValue >>> It doesn't throw an exception, but it doesn't change the font size, >>> either. >>> Also, oddly, the slider never seems to lose focus. It keeps sliding back >>> and forth even after the mouse is released and no longer over the >>> slider. I >>> can't get focus on the TextArea. >>> >>> >>> - hwg >>> >>> >>> ________________________________ >>> From: "ec...@gm..." <ec...@gm...> >>> To: hwg <hw...@ya...> >>> Cc: "pyt...@li..." >>> <pyt...@li...> >>> Sent: Saturday, June 18, 2011 11:45 PM >>> Subject: Re: [Pythoncard-users] Dynamically change font size of a >>> TextArea >>> >>> font is not a dictionary. It's a class. Try font._size >>> >>> On 6/17/2011 1:23 PM, hwg wrote: >>> >>> from PythonCard import model >>> class MainWindow(model.Background): >>> def on_Slider1_mouseUp(self, event): >>> sliderValue = self.components.Slider1.value >>> self.components.TextArea1.font['size'] = sliderValue >>> >>> app = model.Application(MainWindow) >>> app.MainLoop() >>> >>> -- >>> Kim Cheung >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> EditLive Enterprise is the world's most technically advanced content >>> authoring tool. Experience the power of Track Changes, Inline Image >>> Editing and ensure content is compliant with Accessibility Checking. >>> http://p.sf.net/sfu/ephox-dev2dev >>> _______________________________________________ >>> Pythoncard-users mailing list >>> Pyt...@li... >>> https://lists.sourceforge.net/lists/listinfo/pythoncard-users >>> >>> >> > > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > > |
From: Lawrence A. <la...@gm...> - 2011-06-21 21:06:41
|
Try adding an event.Skip() As mentioned previously - no need for the wx import. Cheers, Lawrie On Wed, Jun 22, 2011 at 1:43 AM, hwg <hw...@ya...> wrote: > Lawrie, > > That works. Thanks! > > I still have a weird issue where the Slider doesn't give up focus. I start > dragging it, and when I release it (mouseUp), the event handler fires and > the font size changes. But I can't enter the TextArea, and the slider still > moves around as I move the mouse, even with no mouse buttons pressed. I > can't access the TextArea or the Menu, and I can't even close the PythonCard > app window without going into the IDE and stopping the script from there. > > Any idea what's causing this? > > Complete code is attached. > > > Thanks, > hwg > > > ________________________________ > From: Lawrence Abbott <la...@gm...> > To: hwg <hw...@ya...> > Cc: pythoncard-users <pyt...@li...> > Sent: Tue, June 21, 2011 7:45:50 AM > Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea > > try > font = self.components.TextArea1.GetFont() > > instead of > font = self.components.TextArea1.font > > also you will need to ensure the slider output values are legitimate font > sizes > also should be no need to import wx with SetPointSize method > > Cheers, > Lawrie > > > On Tue, Jun 21, 2011 at 10:23 PM, hwg <hw...@ya...> wrote: >> I tried both of the methods below: >> I get the following error: >> Traceback (most recent call last): >> File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408, in >> _dispatch >> handler(background, aWxEvent) >> File >> >> "C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider_text.py", >> line 11, in on_Slider1_mouseUp >> font.SetPointSize(sliderValue) >> AttributeError: 'Font' object has no attribute 'SetPointSize' >> >> Here's the complete code: >> # pc_slider_text.py >> # try to change the size of text font in a test box using a slider >> >> from wx import * >> from PythonCard import model >> class MainWindow(model.Background): >> def on_Slider1_mouseUp(self, event): >> sliderValue = self.components.Slider1.value >> print sliderValue >> font = self.components.TextArea1.font >> font.SetPointSize(sliderValue) >> self.components.TextArea1.SetFont(font) >> print self.components.TextArea1.font >> >> app = model.Application(MainWindow) >> app.MainLoop() >> >> ________________________________ >> From: Lawrence Abbott <la...@gm...> >> To: hwg <hw...@ya...> >> Sent: Monday, June 20, 2011 10:37 PM >> Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea >> >> A slightly cleaner way >> >> font = self.components.TextArea1.GetFont() >> font.SetPointSize(16) >> self.components.TextArea1.SetFont(font) >> >> Cheers, >> Lawrie >> >> On Tue, Jun 21, 2011 at 12:26 PM, Lawrence Abbott <la...@gm...> >> wrote: >>> Hi, >>> >>> self.components.TextArea1.font_size = sliderValue >>> >>> doesnt work for me >>> >>> print self.components.TextArea1.font.size >>> >>> gives a dictionary of font attributes, but I can't get them to update >>> either >>> >>> import wx >>> >>> font_size =16 >>> >>> font1 = self.components.TextArea1.GetFont() >>> font2 = wx.Font(font_size, font1.Family, font1.Style, font1.Weight) >>> self.components.TextArea1.SetFont( font2 ) >>> >>> seems to work >>> >>> HTH, >>> Lawrie >>> >>> On Mon, Jun 20, 2011 at 2:27 AM, hwg <hw...@ya...> wrote: >>>> I tried: >>>> >>>> self.components.TextArea1.font_size = sliderValue >>>> It doesn't throw an exception, but it doesn't change the font size, >>>> either. >>>> Also, oddly, the slider never seems to lose focus. It keeps sliding >>>> back >>>> and forth even after the mouse is released and no longer over the >>>> slider. I >>>> can't get focus on the TextArea. >>>> >>>> >>>> - hwg >>>> >>>> >>>> ________________________________ >>>> From: "ec...@gm..." <ec...@gm...> >>>> To: hwg <hw...@ya...> >>>> Cc: "pyt...@li..." >>>> <pyt...@li...> >>>> Sent: Saturday, June 18, 2011 11:45 PM >>>> Subject: Re: [Pythoncard-users] Dynamically change font size of a >>>> TextArea >>>> >>>> font is not a dictionary. It's a class. Try font._size >>>> >>>> On 6/17/2011 1:23 PM, hwg wrote: >>>> >>>> from PythonCard import model >>>> class MainWindow(model.Background): >>>> def on_Slider1_mouseUp(self, event): >>>> sliderValue = self.components.Slider1.value >>>> self.components.TextArea1.font['size'] = sliderValue >>>> >>>> app = model.Application(MainWindow) >>>> app.MainLoop() >>>> >>>> -- >>>> Kim Cheung >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> EditLive Enterprise is the world's most technically advanced content >>>> authoring tool. Experience the power of Track Changes, Inline Image >>>> Editing and ensure content is compliant with Accessibility Checking. >>>> http://p.sf.net/sfu/ephox-dev2dev >>>> _______________________________________________ >>>> Pythoncard-users mailing list >>>> Pyt...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pythoncard-users >>>> >>>> >>> >> >> >> >> >> ------------------------------------------------------------------------------ >> EditLive Enterprise is the world's most technically advanced content >> authoring tool. Experience the power of Track Changes, Inline Image >> Editing and ensure content is compliant with Accessibility Checking. >> http://p.sf.net/sfu/ephox-dev2dev >> _______________________________________________ >> Pythoncard-users mailing list >> Pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/pythoncard-users >> >> > |
From: Lawrence A. <la...@gm...> - 2011-06-22 05:12:25
|
On-line documentation is going to do a more thorough and accurate job than I can do :( ....try these http://wiki.wxpython.org/EventPropagation http://wiki.wxpython.org/self.Bind%20vs.%20self.button.Bind remembering PythonCard is a wrapper of wxpython Cheers, Lawrie On Wed, Jun 22, 2011 at 6:14 AM, hwg <hw...@ya...> wrote: > That's what I needed. Working perfectly now. (I also removed the > unnecessary wx import.) > I don't understand why I need the event.Skip(). If someone could explain, > it would be much appreciated. > > hwg > > ________________________________ > From: Lawrence Abbott <la...@gm...> > To: hwg <hw...@ya...> > Cc: pythoncard-users <pyt...@li...> > Sent: Tuesday, June 21, 2011 2:06 PM > Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea > > Try adding an > > event.Skip() > > As mentioned previously - no need for the wx import. > > Cheers, > Lawrie > > On Wed, Jun 22, 2011 at 1:43 AM, hwg <hw...@ya...> wrote: >> Lawrie, >> >> That works. Thanks! >> >> I still have a weird issue where the Slider doesn't give up focus. I >> start >> dragging it, and when I release it (mouseUp), the event handler fires and >> the font size changes. But I can't enter the TextArea, and the slider >> still >> moves around as I move the mouse, even with no mouse buttons pressed. I >> can't access the TextArea or the Menu, and I can't even close the >> PythonCard >> app window without going into the IDE and stopping the script from there. >> >> Any idea what's causing this? >> >> Complete code is attached. >> >> >> Thanks, >> hwg >> >> >> ________________________________ >> From: Lawrence Abbott <la...@gm...> >> To: hwg <hw...@ya...> >> Cc: pythoncard-users <pyt...@li...> >> Sent: Tue, June 21, 2011 7:45:50 AM >> Subject: Re: [Pythoncard-users] Dynamically change font size of a TextArea >> >> try >> font = self.components.TextArea1.GetFont() >> >> instead of >> font = self.components.TextArea1.font >> >> also you will need to ensure the slider output values are legitimate font >> sizes >> also should be no need to import wx with SetPointSize method >> >> Cheers, >> Lawrie >> >> >> On Tue, Jun 21, 2011 at 10:23 PM, hwg <hw...@ya...> wrote: >>> I tried both of the methods below: >>> I get the following error: >>> Traceback (most recent call last): >>> File "C:\Python25\lib\site-packages\PythonCard\widget.py", line 408, in >>> _dispatch >>> handler(background, aWxEvent) >>> File >>> >>> >>> "C:\Users\wsande\Documents\Warren\PythonScripts\PC_slider_text\pc_slider_text.py", >>> line 11, in on_Slider1_mouseUp >>> font.SetPointSize(sliderValue) >>> AttributeError: 'Font' object has no attribute 'SetPointSize' >>> >>> Here's the complete code: >>> # pc_slider_text.py >>> # try to change the size of text font in a test box using a slider >>> >>> from wx import * >>> from PythonCard import model >>> class MainWindow(model.Background): >>> def on_Slider1_mouseUp(self, event): >>> sliderValue = self.components.Slider1.value >>> print sliderValue >>> font = self.components.TextArea1.font >>> font.SetPointSize(sliderValue) >>> self.components.TextArea1.SetFont(font) >>> print self.components.TextArea1.font >>> >>> app = model.Application(MainWindow) >>> app.MainLoop() >>> >>> ________________________________ >>> From: Lawrence Abbott <la...@gm...> >>> To: hwg <hw...@ya...> >>> Sent: Monday, June 20, 2011 10:37 PM >>> Subject: Re: [Pythoncard-users] Dynamically change font size of a >>> TextArea >>> >>> A slightly cleaner way >>> >>> font = self.components.TextArea1.GetFont() >>> font.SetPointSize(16) >>> self.components.TextArea1.SetFont(font) >>> >>> Cheers, >>> Lawrie >>> >>> On Tue, Jun 21, 2011 at 12:26 PM, Lawrence Abbott <la...@gm...> >>> wrote: >>>> Hi, >>>> >>>> self.components.TextArea1.font_size = sliderValue >>>> >>>> doesnt work for me >>>> >>>> print self.components.TextArea1.font.size >>>> >>>> gives a dictionary of font attributes, but I can't get them to update >>>> either >>>> >>>> import wx >>>> >>>> font_size =16 >>>> >>>> font1 = self.components.TextArea1.GetFont() >>>> font2 = wx.Font(font_size, font1.Family, font1.Style, font1.Weight) >>>> self.components.TextArea1.SetFont( font2 ) >>>> >>>> seems to work >>>> >>>> HTH, >>>> Lawrie >>>> >>>> On Mon, Jun 20, 2011 at 2:27 AM, hwg <hw...@ya...> wrote: >>>>> I tried: >>>>> >>>>> self.components.TextArea1.font_size = sliderValue >>>>> It doesn't throw an exception, but it doesn't change the font size, >>>>> either. >>>>> Also, oddly, the slider never seems to lose focus. It keeps sliding >>>>> back >>>>> and forth even after the mouse is released and no longer over the >>>>> slider. I >>>>> can't get focus on the TextArea. >>>>> >>>>> >>>>> - hwg >>>>> >>>>> >>>>> ________________________________ >>>>> From: "ec...@gm..." <ec...@gm...> >>>>> To: hwg <hw...@ya...> >>>>> Cc: "pyt...@li..." >>>>> <pyt...@li...> >>>>> Sent: Saturday, June 18, 2011 11:45 PM >>>>> Subject: Re: [Pythoncard-users] Dynamically change font size of a >>>>> TextArea >>>>> >>>>> font is not a dictionary. It's a class. Try font._size >>>>> >>>>> On 6/17/2011 1:23 PM, hwg wrote: >>>>> >>>>> from PythonCard import model >>>>> class MainWindow(model.Background): >>>>> def on_Slider1_mouseUp(self, event): >>>>> sliderValue = self.components.Slider1.value >>>>> self.components.TextArea1.font['size'] = sliderValue >>>>> >>>>> app = model.Application(MainWindow) >>>>> app.MainLoop() >>>>> >>>>> -- >>>>> Kim Cheung >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> EditLive Enterprise is the world's most technically advanced content >>>>> authoring tool. Experience the power of Track Changes, Inline Image >>>>> Editing and ensure content is compliant with Accessibility Checking. >>>>> http://p.sf.net/sfu/ephox-dev2dev >>>>> _______________________________________________ >>>>> Pythoncard-users mailing list >>>>> Pyt...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/pythoncard-users >>>>> >>>>> >>>> >>> >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> EditLive Enterprise is the world's most technically advanced content >>> authoring tool. Experience the power of Track Changes, Inline Image >>> Editing and ensure content is compliant with Accessibility Checking. >>> http://p.sf.net/sfu/ephox-dev2dev >>> _______________________________________________ >>> Pythoncard-users mailing list >>> Pyt...@li... >>> https://lists.sourceforge.net/lists/listinfo/pythoncard-users >>> >>> >> > > > |