Jump to content

Will66

Active Members
  • Posts

    201
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Will66's Achievements

Polymath

Polymath (5/7)

0

Reputation

  1. Interested to transpose guitar tablature and so far this is what i have, any suggestions to further the file reading function would be nice, so far its a proof of concept by playing the first 6 lines of tablature. You'll need the attached guitar.au3 which converts tab notation. eg A2 (second fret on the A string) and any tablature file however so far you need to delete any space at the top of the tab txt file because the script is only pulling the top 6 lines of the file for conversion thus far. btw in yesterdat.txt shows how to handle note duration with the underscore _ character #include <file.au3> #include <midiudf.au3> #include <guitar.au3> Dim $aRecords If Not _FileReadToArray("yesterday.TXT",$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf Dim $last_e_Note ="-" Dim $last_b_Note ="-" Dim $last_g_Note ="-" Dim $last_d_Note ="-" Dim $last_a_Note ="-" Dim $last_E_Note ="-" $Open = _MidiOutOpen() SetInstrument($Open,25);Guitar=25 For $n = 1 to StringLen($aRecords[1]) For $x = 1 to $aRecords[0] $z1 = StringMid($aRecords[$x],$n,1) $z2 = StringMid($aRecords[$x],$n,2) $z3 = StringMid($aRecords[$x],($n-1),1) Switch $z1 case StringIsInt($z1)=1 And StringIsInt($z2) =0 And StringIsInt($z3) =0 ConsoleWrite($x & ":" & $z1 & " - noteOn(" & getString($x, $z1) & ")" & @CRLF) noteOn($open,getString($x, $z1) ) case StringIsInt($z1)=1 And StringIsInt($z2) =1 ConsoleWrite("noteOn(" & getString($x, $z2) & ")" & @CRLF) noteOn($open,getString($x, $z2) ) case "-" If $z3= "_" Or StringIsInt($z3)=1 Then ConsoleWrite(@TAB & "noteOff( " & getNoteOff($x) & " )" & @CRLF) noteOff($open,getNoteOff($x) ) EndIf EndSwitch next ;ConsoleWrite("sleep(200)" & @CRLF) If $z1 <> "|" Then sleep(180);play music next _MidiOutClose($Open) ;end song Func getString($s=1, $fret=0) Local $string Switch $s case 1 $string = "e" $last_e_Note =$string & $fret case 2 $string = "b" $last_b_Note =$string & $fret case 3 $string = "g" $last_g_Note =$string & $fret case 4 $string = "d" $last_d_Note =$string & $fret case 5 $string = "a" $last_a_Note =$string & $fret case 6 $string = "E_" $last_E_Note =$string & $fret EndSwitch return $string & $fret EndFunc Func getNoteOff($s=1) Switch $s case 1 $string = $last_e_Note $last_e_Note ="-" case 2 $string = $last_b_Note $last_b_Note ="-" case 3 $string = $last_g_Note $last_g_Note ="-" case 4 $string = $last_d_Note $last_d_Note ="-" case 5 $string = $last_a_Note $last_a_Note ="-" case 6 $string = $last_E_Note $last_E_Note ="-" EndSwitch return $string EndFunc ;midi functions follow: Func NoteOn($Handle, $Note) $Note = Eval($Note) _MidiOutShortMsg($Handle, "0x0040" & $Note) EndFunc Func NoteOff($Handle, $Note) $Note = Eval($Note) _MidiOutShortMsg($Handle, "0x0000" & $Note) Endfunc Func SetInstrument($Handle, $Instrument) _MidiOutShortMsg($Handle,256 * $Instrument + 192) EndFuncGUITAR.AU3 yesterday.TXT yesterday1.TXT
  2. Ok, i'm new to Win7, #requireadmin fixed it after deleting the dll.
  3. Script fails here using Win7 Pro: If Not IsObj($obj) Then MsgBox (0,"ERROR!","Can not register MPDF.dll...") Exit This line is failing: Global $obj = ObjCreate("MPDFX.MPDF") Where is the activeX object from?
  4. Thanx bo8ster, seperate paramaters with ampersand operator: ShellExecute('AcroRd32.exe', ' /A "toolbar=0&navpanes=0&scrollbar=0&page=4&view=FitB" "D:\WillsAutoit\pdftohtml-0.38-win32\April.pdf"')
  5. Thanx, but i cannot get it to work with parameters....error msg...there was an error opening the file: ShellExecute('AcroRd32.exe', '"D:\WillsAutoit\pdftohtml-0.38-win32\April.pdf page=4"')
  6. ShellExecuteWait(@ScriptDir & "\April.pdf", "#page=4") ;ShellExecute("AcroRd32.exe /A zoom=1000 " & @ScriptDir & "\April.pdf") ;ShellExecute("AcroRd32.exe /A 'page=5' '" & @ScriptDir & "\April.pdf'") http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters_v9.pdf#search=
  7. Web Browsers can open a pdf with paramaters like this: file:///D:/WillsAutoit/April.pdf#toolbar=0&navpanes=0&scrollbar=0&page=4&view=FitB How can i open a PDF directly with Acrobat using paramaters Run or Shell please?
  8. I'm not convinced but you got me thinking about adding at little ooP to $variables like $myCat.name="spotty". Of course this is against syntax rules and $myCat is not an Object. But we can do this: $obama = _newObject("Obama") _addProperty($obama,"Title","President") So i made a little start to see if its useful or not? And bam5's topic heading looks like a good place to put it. demo: #include <oop.au3> $obama = _newObject("Obama") ConsoleWrite($obama & @CRLF & @CRLF) _addProperty($obama,"Title","President") _addProperty($obama,"FirstName","Barack") _addProperty($obama,"HomeState","Chicago") $answer=_getProperty($obama,"Title") ConsoleWrite($answer & @CRLF) $answer=_getProperty($obama,"FirstName") ConsoleWrite($answer & @CRLF & @CRLF) for $p in _lengthObject($obama) ConsoleWrite("Array: " & $p & @CRLF) Next _deleteProperty($obama,"HomeState") ConsoleWrite(@CRLF) for $p in _lengthObject($obama) ConsoleWrite("After Delete: " & $p & @CRLF) Next _deleteObject($obama) ConsoleWrite(@CRLF) for $p in _lengthObject($obama) ConsoleWrite("After Delete2: " & $p & @CRLF) Next oop.au3: Global $js Func _deleteProperty($obj5="",$property="") $js.AddCode("delete " & $obj5 & "." & $property & ";") EndFunc Func _lengthObject($obj4="") $arrString = $js.eval("str='';c=0;for(i in " & $obj4 & "){if(c>0){str+='|';}else{c=1;} str+=i + ','+ " & $obj4 &"[i];}") ;MsgBox(0,"",$arrString) ;debug Return StringSplit($arrString,"|") EndFunc Func _getProperty($obj3="",$property="") return $js.eval($obj3 & "." & $property & ";") EndFunc Func _addProperty($obj2="",$property="",$value="") $invcomma="" if IsString($value) then $invcomma="'" EndIf $property=StringReplace($property," ","") $js.AddCode("" & $obj2 & "." & $property & "=" & $invcomma & $value & $invcomma & ";") EndFunc Func _newObject($obj="") If Not IsObj($js) Then $js=ObjCreate("ScriptControl") $js.language="Javascript" EndIf $js.AddCode("var " & $obj & " = new Object;") return $obj EndFunc Func _deleteObject($obj="") $js.AddCode("var " & $obj & "='';") EndFunc
  9. Well done sandin,thats fantastic work. Thankyou! I too have been interested in midi for a while, alas i dabble in a few scripting languages but am not a master of autoit. I've put this together to play midi notes directly from the keyboard. It has the abilty to play multiple notes at once but i've found it difficult to make it s responsive as it should be to user input. Instrument can be set from the menu. There are some things about the WindowEvents and dll calls i don't really understand fully to know where i've gone wrong. Its eating up CPU, and perhaps those who are more familiar with autoit can help make it better and offer some input on where i've gone wrong. requires MidiUdf #include <SendMessage.au3> ;#include <misc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <Midiudf.au3> Opt("GUIOnEventMode", 1) ; OnEvent mode Global $Q = 2890 ;20 Global $W = 2990 ;20 Global $E = "2A90" ;20 Global $R = "2B90" ;20 Global $T = "2C90" ;20 Global $Y = "2D90" ;20 Global $U = "2E90" ;20 Global $I = "2F90" ;20 Global $O = "3090" ;20 Global $P = "3190" ;20 Global $A = "3290" ;21 Global $S = "3390" ;20 Global $D = "3490" ;20 Global $F = "3590" ;20 Global $G = "3690" ;20 Global $H = "3790" ;20 Global $J = "3890" ;20 Global $K = "3990" ;20 Global $L = "3A90" ;20 Global $Z = "3B90" ;20 Global $X = "3C90" ;20 Global $C = "3D90" ;20 Global $V = "3E90" ;20 Global $B = "3F90" ;20 Global $N = "4090" ;20 Global $M = "4190" ;20 Global $instrument_String="Grand Piano|Bright Piano|Electric Grand Piano|Honky-Tonk Piano|Electric piano|Electric Piano|" & _ "Harpsichord|Clavinet|Celesta|Glockenspiel|Music Box|Vibraphone|Marimba|Xylophone|Tubular bells|Dulcimer|Drawbar Organ|" & _ "Percussive Organ|Rock Organ|Church Organ|Reed Organ|Accordion|Harmonica|Tango Accordion|Nylon String Guitar|Steel String Guitar|" & _ "Jazz Guitar|Clean Electric Guitar|Muted Electric Guitar|Overdrive Guitar|Distortion Guitar|Guitar Harmonics|Accoustic Bass|" & _ "Fingered Bass|Picked Bass|Fretless Bass|Slap Bass 1|Slap Bass 2|Synth Bass 1|Synth Bass 2|Violin|Viola|Cello|Contrabass|" & _ "Tremolo Strings|Pizzicato Strings|Orchestral Harp|Timpani|String Ensemble 1|String Ensemble 2|Synth Strings 1|" & _ "Synth Strings 2|Choir ahh|Choir oohh|Synth Voice|Orchestral Hit|Trumpet|Trombone|Tuba|Muted Trumpet|French Horn|" & _ "Brass Section|Synth Brass 1|Synth Brass 2|Soprano Sax|Alto Sax|Tenor Sax|Baritone Sax|Oboe|English Horn|Bassoon|" & _ "Clarinet|Piccolo|Flute|Recorder|Pan flute|Blown Bottle|Shakuhachi|Whistle|Ocarina|Square Wave|Sawtooth Wave|Caliope|" & _ "Chiff|Charang|Voice|Fifths|Bass & Lead|New Age|Warm|PolySynth|Choir|Bowed|Metallic|Halo|Sweep|FX: Rain|FX: Soundtrack|" & _ "FX: Crystal|FX: Atmosphere|FX: Brightness|FX: Goblins|FX: Echo Drops|FX: Star Theme|Sitar|Banjo|Shamisen|Koto|Kalimba|" & _ "Bagpipe|Fiddle|Shanai|Tinkle bell|Agogo|Steel Drums|Woodblock|Taiko Drum|Melodic Tom|Synth Drum|Reverse Cymbal|" & _ "Guitar Fret Noise|Breath Noise|Seashore|Bird Tweet|Telephone Ring|Helicopter|Applause|Gunshot" Global $instrument_Array= StringSplit($instrument_String,"|") ;Global Const $WM_KEYDOWN = 0x0100 ;Global Const $WM_KEYUP = 0x0101 Dim $iKeyIndex="" Global $sKeyName,$fileitem $Gui = GUICreate("Key Name Demo (Esc to exit)", 400, 50) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") $instr_Menu=GUICtrlCreateMenu("&Instrument") GUICtrlSetOnEvent(-1, "_instChanged") for $zz = 1 to $instrument_Array[0] $men1=GUICtrlCreateMenuItem($instrument_Array[$zz],$instr_Menu,-1,1) GUICtrlSetOnEvent(-1, "_instChanged") if $zz=1 then GUICtrlSetState(-1, $GUI_CHECKED) Next GUISetState(@SW_SHOW, $Gui) GUIRegisterMsg($WM_NCLBUTTONUP, "WindowEvents") GUIRegisterMsg($WM_KEYDOWN, "WindowEvents") GUIRegisterMsg($WM_KEYUP, "WindowEvents") HotKeySet("{Esc}", "Quit"); Esc to Exit Dim $Open = _MidiOutOpen() SetInstrument($Open,0);piano While 1 _SendMessage($Gui, $WM_SYSCOMMAND, 0xF012, 0) $sKeyName = "" ;sleep(100) WEnd Func _instChanged() $ind=GUICtrlRead(@GUI_CtrlId,1) if StringLen($ind>0) Then for $zz = 1 to $instrument_Array[0] if $ind=$instrument_Array[$zz] Then SetInstrument($Open,$zz-1) ;MsgBox(0,"",$ind & ":" & $zz-1) ExitLoop EndIf Next EndIf EndFunc Func NoteOn($Handle, $NoteIdx) If IsDeclared ( $NoteIdx ) Then $NoteIdx = Eval($NoteIdx) _MidiOutShortMsg($Handle, "0x0040" & $NoteIdx) EndIf EndFunc Func NoteOff($Handle, $NoteIdx) If IsDeclared ( $NoteIdx ) Then $NoteIdx = Eval($NoteIdx) _MidiOutShortMsg($Handle, "0x0000" & $NoteIdx) EndIf Endfunc Func Play($Handle, $Notes, $Duration); Can play Single notes or use arrays for chords If Isarray($Notes) Then For $i in $Notes If $i > 87 then Return 0 $i-=1 _MidiOutShortMsg($Handle, $Notes[$i]) Next Sleep($Duration) For $i in $Notes $i-=1 _MidiOutShortMsg($Handle, $Notes[$i]) Next Else _MidiOutShortMsg($Handle, $Notes) Sleep($Duration) _MidiOutShortMsg($Handle, $Notes) EndIf EndFunc Func SetInstrument($Handle, $Instrument) _MidiOutShortMsg($Handle,256 * $Instrument + 192) EndFunc Func Quit() Exit EndFunc ;==>Quit Func OnAutoItExit() _MidiOutClose($Open) GUIDelete($Gui) EndFunc ;==>OnAutoItExit Func WindowEvents($hWnd, $Msg, $wParam, $lParam) Switch $Msg Case $WM_KEYUP $aRet = DllCall('user32.dll', 'int', 'GetKeyNameText', 'int', $lParam, 'str', "", 'int', 256) $sKeyName = $aRet[2] $iKeyIndex=StringReplace($iKeyIndex,$sKeyName,"") NoteOff($Open, $sKeyName) ;ConsoleWrite($iKeyIndex & @CRLF) ;ConsoleWrite("keyUp: " & $sKeyName & @CRLF) Case $WM_KEYDOWN $aRet = DllCall('user32.dll', 'int', 'GetKeyNameText', 'int', $lParam, 'str', "", 'int', 256) $sKeyName = $aRet[2] if Not StringInStr($iKeyIndex,$sKeyName) Then $iKeyIndex = $iKeyIndex & $sKeyName NoteOn($Open, $sKeyName) EndIf ;ConsoleWrite("keyDn: " & $sKeyName & @CRLF) EndSwitch EndFunc ;==>WindowEvents
  10. Not really sure what you need? but this is another way. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister () Dim $oIE = _IECreateEmbedded () Dim $oIE2 = _IECreateEmbedded () Opt("GUIResizeMode", 1) Opt("GUIOnEventMode", 1) ; OnEvent mode Dim $gui = GUICreate("resizable", 800, 600,-1,-1,$WS_OVERLAPPEDWINDOW) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") Dim $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0,800,250) _IENavigate ($oIE, "http://google.com") Dim $GUIActiveX2 = GUICtrlCreateObj($oIE2, 0, 300,800,250) _IENavigate ($oIE2, "http://images.google.com") GUISetState () While 1 Sleep(1000) ; Idle around WEnd Func CLOSEClicked() GUIDelete($gui) Exit EndFunc
  11. Simple image viewer. Selecting Browse for a folder creates clickable thumbs to view the larger original. -rename images -view images and hear them, good learning aid for kids. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <IE.au3> #include <GDIPlus.au3> #Include <File.au3> #Include <Array.au3> _IEErrorHandlerRegister () Global $voice,$ArgumentPairs Dim $guiTitle="Lets Talk" Dim $sHTML,$GetTheParent=@MyDocumentsDir Dim $sFile_Name, $szDrive, $szDir, $szFName, $szExt Dim $imageArray[1] Dim $thumbfolder="LetsTalkThumbs" Dim $myevent,$oEvent $hGUI = GUICreate($guiTitle, 800, 600,-1,-1,$WS_OVERLAPPEDWINDOW) GUISetOnEvent($GUI_EVENT_CLOSE,"_CLOSEClicked") ;GUISetFont (8,-1,"Arial") Opt("GUIOnEventMode",1) Opt("GUIResizeMode", 1) _build_menus() Dim $oIE = _IECreateEmbedded () Dim $GUIActiveX = GUICtrlCreateObj($oIE, 1, 0,798,500) Dim $imgEdit=GUICtrlCreateEdit("",200,510,500,50, $ES_AUTOVSCROLL + $WS_VSCROLL) Dim $imgEditSave=GUICtrlCreateButton("Change",710,510,50,24) Dim $sayItButton=GUICtrlCreateButton("Say It!",10,510,180,26) Dim $hearItButton=GUICtrlCreateButton("Hear It!",10,540,180,26) GUICtrlSetOnEvent($imgEditSave, "_editorUpdated") GUICtrlSetOnEvent($sayItButton, "_sayItButtonPressed") GUICtrlSetOnEvent($hearItButton, "_hearItButtonPressed") _IENavigate ($oIE, "about:blank") _buildHTML() $myevent = _IEGetObjById ($oIE, "sinkField") $oEvent = ObjEvent( $myevent, "my_Event_") GUISetState () While 1 Sleep(100) WEnd Func _sayItButtonPressed() ;MsgBox(0,"",GUICtrlRead($imgEdit)) $voice = ObjCreate("SAPI.SpVoice") $voice.Speak (GUICtrlRead($imgEdit)) $voice = "" EndFunc Func _hearItButtonPressed() $hearFile=GUICtrlRead($imgEdit) ;MsgBox(0,"",$hearFile) If FileExists($hearFile & ".wav") Then SoundPlay($hearFile & ".wav") EndIf EndFunc Func _editorUpdated() If IsArray($ArgumentPairs) Then $thePath = _PathSplit($ArgumentPairs[2], $szDrive, $szDir, $szFName, $szExt) $x=_IEGetObjById ($oIE, $ArgumentPairs[2]);get current id(filename reference) $FileNameInput = $thePath[1] & $thePath[2] & GUICtrlRead($imgEdit) & $thePath[4] If _IsFileName(GUICtrlRead($imgEdit)) Then If FileExists($FileNameInput) Then MsgBox(0,"Cannot Rename:","An image named " & GUICtrlRead($imgEdit) & $thePath[4] & " already exists!") ElseIf FileMove($ArgumentPairs[2], $FileNameInput) = 0 Then;failed to rename file MsgBox(16,"Cannot Rename:","Failed to rename File: " & GUICtrlRead($imgEdit) & $thePath[4] & " !" & @CRLF & "File name may be too long!") Else $x.setAttribute("alt",GUICtrlRead($imgEdit));update alt to edit value $x.setAttribute("id",$FileNameInput);update id to new path EndIf Else MsgBox(16, 'Error', 'The file name includes an invalid character/s' & @CR & '< > | ? : * / \ "', $hGui) EndIf EndIf EndFunc Func _IsFileName($Test) If StringRegExp($Test, '[<>|?:"*/\\]') <> 0 Or StringLen($test) < 1 Then ;MsgBox(16, 'Error', 'The file name include an invalid characters' & @CR & '< > | ? : * / \ "', $hGUI) Return False Else Return True EndIf EndFunc Func my_Event_onpropertychange() $ArgumentPairs = StringSplit($myevent.value, "|") GUICtrlSetData($imgEdit, $ArgumentPairs[1]) ;MsgBox(0,"",$myevent.value) EndFunc Func _browsePressed() $sFile_Name = FileOpenDialog("Browse images", $GetTheParent & "", "Images (*.jpeg;*.jpg;*.bmp)", 1 + 4 ) $thePath = _PathSplit($sFile_Name, $szDrive, $szDir, $szFName, $szExt) If $thePath[2] Then $GetTheParent=$thePath[1] & $thePath[2] $FileList=_FileListToArray($GetTheParent) ;_ArrayDisplay($FileList,"$FileList") If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf Local $imageArray[1] $c=0 For $i =1 to $FileList[0] If $c>100 Then ExitLoop $filePath = _PathSplit($FileList[$i], $szDrive, $szDir, $szFName, $szExt) $ext=$filePath[4] if $ext = ".jpg" Or $ext = ".gif" Or $ext = ".jpeg" then _ArrayAdd($imageArray,$filePath[3] & $filePath[4]) $c=$c+1 $imageArray[0]=$c EndIf Next DirCreate($GetTheParent & $thumbfolder) _GetThumb($GetTheParent, $imageArray,0,0);-->create thumbnails ;_ArrayDisplay($imageArray,"Demo _PathSplit()") _loadThumbsdiv($GetTheParent, $imageArray,0,0) DirRemove($GetTheParent & $thumbfolder,1) EndIf EndFunc Func _loadThumbsdiv($Fparent="",$sFiles="",$iW="", $iH="") $sHTML = "" $oDiv = _IEGetObjById ($oIE, "thumbsDiv") For $i=1 to $sFiles[0] $fileSplit = _PathSplit($sFiles[$i], $szDrive, $szDir, $szFName, $szExt) Out("<img alt='"&$fileSplit[3]&"' id='" & $Fparent & $sFiles[$i] & "' src='" & $Fparent & $thumbfolder & "\" & $sFiles[$i] & "' onclick='loadImage(this);'>") next _IEPropertySet ($oDiv, "innerhtml", $sHTML) EndFunc Func _GetThumb($Fparent="",$sFiles="",$iW="", $iH="") Local $hImage, $aResult, $hThumb,$hGraphic _GDIPlus_Startup() For $i =1 to $sFiles[0] $hImage = _GDIPlus_ImageLoadFromFile($Fparent & $sFiles[$i]) $iX = _GDIPlus_ImageGetWidth ($hImage) $iY = _GDIPlus_ImageGetHeight ($hImage) ;MsgBox(0,"",$Fparent & $thumbfolder & "\" & $sFiles[$i]) $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageThumbnail", "hwnd", $hImage, "int", $iW, "int", $iH, _ "int*", 0, "ptr", 0, "ptr", 0) $hThumb = _GDIPlus_BitmapCreateHBITMAPFromBitmap($aResult[4]) _GDIPlus_ImageSaveToFile($aResult[4], $Fparent & $thumbfolder & "\" & $sFiles[$i]) _GDIPlus_ImageDispose($aResult[4]) _GDIPlus_ImageDispose($hImage) next _GDIPlus_Shutdown() ; Return $hThumb EndFunc ;==>_GetThumb Func _buildHTML() $sHTML = "" Out('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">') Out("<HEAD>") Out("<TITLE>Amba-view</TITLE>") Out("<style>BODY{border:0;font size:8pt;font-family:arial;} ") Out(".buttons{background:#fff000;} #myImg{max-width:400px;max-height:500px;}</style>") Out("<script type='text/javascript'>") Out("function loadImage (imgId){") ;Out("alert(imgId.id);") Out("var myImgDiv=document.getElementById('myImgDiv');") Out("var myImg=document.getElementById('myImg');") Out("var mySink=document.getElementById('sinkField');") Out("mySink.setAttribute('value',imgId.alt + '|' + imgId.id);") Out("divW=myImgDiv.offsetWidth;") Out("divH=myImgDiv.offsetHeight;") Out("myImg.setAttribute('src',imgId.id);") Out("myImg.setAttribute('alt',imgId.alt);") Out("myImg.style.maxWidth=divW-2+'px';") Out("myImg.style.maxHeight=divH-2+'px';") Out("myImg.style.display='';") Out("}") Out("function renameImage (imgId){") Out("}") Out("</script>") Out("</HEAD>") Out("<BODY scroll='no'>") Out("<div id='thumbsDiv' style='position:absolute;top:0px;left:0px;width:180px;height:100%;border-right:1px solid;overflow:auto;'></div>") Out("<div id='myImgDiv' style='position:absolute;top:0px;left:181px;width:100%;height:100%'>") Out("<form id='sinkForm'><input id='sinkField' type='hidden' value=''></form>") Out("<img id='myImg' style='display:none;' src=''>") Out("</div>") Out("</BODY>") Out("</HTML>") _IEDocWriteHTML ($oIE, $sHtml) _IEAction ($oIE, "refresh") EndFunc Func _build_menus() $ViewMenu = GUICtrlCreateMenu ("&Browse") GUICtrlCreateMenuitem ("Browse Images",$ViewMenu) GUICtrlSetOnEvent(-1, "_browsePressed") $browse=GUICtrlCreateMenu ("&Settings") GUICtrlCreateMenuitem ("Browse",$browse) GUICtrlSetState(-1, $GUI_CHECKED) ;GUICtrlSetOnEvent(-1, "TablesMenu_clicked") $x=GUICtrlCreateMenuitem ("Browse2",$browse) GUICtrlSetState($x, $GUI_CHECKED) EndFunc Func Out($temp) $sHtml &= $temp & @CRLF EndFunc Func _CLOSEClicked() GUIDelete($hGUI) Exit EndFunc
  12. thanx, I can live with that. One more thing would make it complete is getting the checkbox to display...doable? $browse=GUICtrlCreateMenu ("") GUICtrlCreateMenuitem ("Browse",-1) ;GUICtrlSetOnEvent(-1, "TablesMenu_clicked") $x=GUICtrlCreateMenuitem ("Browse2",-1) GUICtrlSetState(-1, $GUI_CHECKED);check submenu item
  13. doesn't work for me? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiButton.au3> Dim $guiTitle="Lets Talk" Dim $sHTML $hGUI = GUICreate($guiTitle, 800, 600,-1,-1,$WS_OVERLAPPEDWINDOW) GUISetOnEvent($GUI_EVENT_CLOSE,"_CLOSEClicked") GUISetFont (8,-1,"Arial") Opt("GUIOnEventMode",1) Opt("GUIResizeMode", 1) ;$btn = _GUICtrlButton_Create($hGUI, "Browse", 10, 10, 50, 20) ;GUICtrlSetOnEvent(-1, "_browsePressed") ;GUICtrlCreateMenu("") ;$HelpM = GUICtrlCreateMenuItem("Click Me", -1) ;GUICtrlSetOnEvent(-1, "_browsePressed") ;GUICtrlCreateMenu("") ;$HelpM2 = GUICtrlCreateMenuItem("Click Me", -1) ;GUICtrlSetOnEvent(-1, "_browsePressed") $Mnu_Item = GUICtrlCreateMenuItem("My Item","") GUISetState () While 1 Sleep(100) WEnd Func _CLOSEClicked() GUIDelete($hGUI) Exit EndFunc
  14. I like the look of the menus eg:GUICtrlCreateMenu , is it possible to call a function directly without requiring to click on a submen? I could use GUICtrlCreateButton but i want to use Opt("GUIResizeMode", 1) wich causes buttons to grow or shrink when the gui is resized. _GUICtrlButton_Create fixes this problem though i prefer Opt("GUIOnEventMode",1) which seems not to work with these buttons. basically i want to style a button like the menus.
  15. Thanks Authenticity, I appreciate your code, it works well Before your post i went with this: Func okButton_Clicked() $Text=GUICtrlRead($textBox) $c = StringLen($Text) $oSp.Speak($Text) GUICtrlSetState($textBox, $GUI_FOCUS) _GUICtrlEdit_SetSel($textBox,0,$c);;select all text here EndFunc
×
×
  • Create New...